Skip to content

Commit 54b0666

Browse files
authored
Add err log info for sig verification (#6)
1 parent af5edde commit 54b0666

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

x/auth/ante/sigverify.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,18 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul
207207
return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidPubKey, "pubkey on account is not set")
208208
}
209209

210+
// get accNum
211+
genesis := ctx.BlockHeight() == 0
212+
var accNum uint64
213+
if !genesis {
214+
accNum = signerAccs[i].GetAccountNumber()
215+
}
216+
210217
// verify signature
211218
if !simulate && !pubKey.VerifyBytes(signBytes, sig) {
212-
return ctx, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "signature verification failed; verify correct account sequence and chain-id")
219+
return ctx, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized,
220+
"signature verification failed; verify correct account sequence and chain-id; %s acct %s, accnum %d, seq %d",
221+
signerAccs[i].GetAddress(), ctx.ChainID(), accNum, signerAccs[i].GetSequence())
213222
}
214223
}
215224

0 commit comments

Comments
 (0)