clear up error message.
This commit is contained in:
parent
08ae1391ad
commit
1c7db7c782
@ -19,7 +19,8 @@ import (
|
|||||||
func AuthenticateMessage(msg *types.SignedMessage, signer address.Address) error {
|
func AuthenticateMessage(msg *types.SignedMessage, signer address.Address) error {
|
||||||
var digest []byte
|
var digest []byte
|
||||||
|
|
||||||
switch typ := msg.Signature.Type; typ {
|
typ := msg.Signature.Type
|
||||||
|
switch typ {
|
||||||
case crypto.SigTypeDelegated:
|
case crypto.SigTypeDelegated:
|
||||||
txArgs, err := ethtypes.NewEthTxArgsFromMessage(&msg.Message)
|
txArgs, err := ethtypes.NewEthTxArgsFromMessage(&msg.Message)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -35,7 +36,7 @@ func AuthenticateMessage(msg *types.SignedMessage, signer address.Address) error
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := sigs.Verify(&msg.Signature, signer, digest); err != nil {
|
if err := sigs.Verify(&msg.Signature, signer, digest); err != nil {
|
||||||
return xerrors.Errorf("secpk message %s has invalid signature: %w", msg.Cid(), err)
|
return xerrors.Errorf("message %s has invalid signature (type %d): %w", msg.Cid(), typ, err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user