evm: fix signature verification (#61)

* evm: fix sig verification

* fixes

* test fixes
This commit is contained in:
Federico Kunze
2021-06-01 13:14:33 -04:00
committed by GitHub
parent abcfc9a6ba
commit 8e7ebe80e9
8 changed files with 169 additions and 92 deletions
+5 -1
View File
@@ -380,8 +380,12 @@ func (e *PublicEthAPI) SendTransaction(args rpctypes.SendTxArgs) (common.Hash, e
return common.Hash{}, err
}
// creates a new EIP2929 signer
// TODO: support legacy txs
signer := ethtypes.LatestSignerForChainID(args.ChainID.ToInt())
// Sign transaction
if err := tx.Sign(e.chainIDEpoch, e.clientCtx.Keyring); err != nil {
if err := tx.Sign(signer, e.clientCtx.Keyring); err != nil {
e.logger.Debugln("failed to sign tx", "error", err)
return common.Hash{}, err
}