From 0a9830564ff2c91d8777156389c3aaf3bdfb2b8a Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 25 Oct 2023 15:58:22 +0300 Subject: [PATCH] [#752] morph: Adopt neo-go RPC statuses Signed-off-by: Evgenii Stratonikov --- pkg/morph/client/notary.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/morph/client/notary.go b/pkg/morph/client/notary.go index 17644361..0bbe526a 100644 --- a/pkg/morph/client/notary.go +++ b/pkg/morph/client/notary.go @@ -706,13 +706,17 @@ func WithProxyContract(h util.Uint160) NotaryOption { } } -// Neo RPC node can return `core.ErrInvalidAttribute` error with +// Neo RPC node can return `neorpc.ErrInvalidAttribute` error with // `conflicting transaction <> is already on chain` message. This // error is expected and ignored. As soon as main tx persisted on // chain everything is fine. This happens because notary contract // requires 5 out of 7 signatures to send main tx, thus last two // notary requests may be processed after main tx appeared on chain. func alreadyOnChainError(err error) bool { + if !errors.Is(err, neorpc.ErrInvalidAttribute) { + return false + } + const alreadyOnChainErrorMessage = "already on chain" return strings.Contains(err.Error(), alreadyOnChainErrorMessage)