Skip to content

Commit

Permalink
chore: In processSig, clarify the signature verification failed error…
Browse files Browse the repository at this point in the history
… message (#1383)

There are three ways that a signature verification can fail: bad account
number, bad sequence number and wrong chain ID. The current error
message says "verify correct account sequence and chain-id". This is
confusing. For example, it may seem that "account sequence" is one
thing. This PR clarifies the error message by adding commas: "verify
correct account, sequence, and chain-id".

Signed-off-by: Jeff Thompson <[email protected]>
  • Loading branch information
jefft0 authored Nov 20, 2023
1 parent 8e2386a commit 6688d1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tm2/pkg/sdk/auth/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func processSig(
}

if !simulate && !pubKey.VerifyBytes(signBytes, sig.Signature) {
return nil, abciResult(std.ErrUnauthorized("signature verification failed; verify correct account sequence and chain-id"))
return nil, abciResult(std.ErrUnauthorized("signature verification failed; verify correct account, sequence, and chain-id"))
}

if err := acc.SetSequence(acc.GetSequence() + 1); err != nil {
Expand Down

0 comments on commit 6688d1d

Please sign in to comment.