fix: check for unread params bytes in all cases (#10018)
This commit is contained in:
parent
5372ab907f
commit
2a3989e4bd
@ -104,9 +104,6 @@ func EthTxArgsFromMessage(msg *types.Message) (EthTxArgs, error) {
|
|||||||
return EthTxArgs{}, xerrors.Errorf("failed to read params byte array: %w", err)
|
return EthTxArgs{}, xerrors.Errorf("failed to read params byte array: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if paramsReader.Len() != 0 {
|
|
||||||
return EthTxArgs{}, xerrors.Errorf("extra data found in params")
|
|
||||||
}
|
|
||||||
if len(params) == 0 {
|
if len(params) == 0 {
|
||||||
// Otherwise, we don't get a guaranteed round-trip.
|
// Otherwise, we don't get a guaranteed round-trip.
|
||||||
return EthTxArgs{}, xerrors.Errorf("cannot invoke contracts with empty parameters from an eth-account")
|
return EthTxArgs{}, xerrors.Errorf("cannot invoke contracts with empty parameters from an eth-account")
|
||||||
@ -114,6 +111,10 @@ func EthTxArgsFromMessage(msg *types.Message) (EthTxArgs, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if paramsReader.Len() != 0 {
|
||||||
|
return EthTxArgs{}, xerrors.Errorf("extra data found in params")
|
||||||
|
}
|
||||||
|
|
||||||
return EthTxArgs{
|
return EthTxArgs{
|
||||||
ChainID: build.Eip155ChainId,
|
ChainID: build.Eip155ChainId,
|
||||||
Nonce: int(msg.Nonce),
|
Nonce: int(msg.Nonce),
|
||||||
|
Loading…
Reference in New Issue
Block a user