Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

Commit e99d6cf

Browse files
committed
fix tests
1 parent 21c63f0 commit e99d6cf

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

rpc/backend/sign_tx_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
goethcrypto "github.com/ethereum/go-ethereum/crypto"
1111
"github.com/ethereum/go-ethereum/signer/core/apitypes"
1212
"github.com/evmos/ethermint/crypto/ethsecp256k1"
13-
"github.com/evmos/ethermint/ethereum/eip712"
1413
"github.com/evmos/ethermint/rpc/backend/mocks"
1514
"github.com/evmos/ethermint/tests"
1615
evmtypes "github.com/evmos/ethermint/x/evm/types"
@@ -248,7 +247,7 @@ func (suite *BackendTestSuite) TestSignTypedData() {
248247
responseBz, err := suite.backend.SignTypedData(tc.fromAddr, tc.inputTypedData)
249248

250249
if tc.expPass {
251-
sigHash, err := eip712.ComputeTypedDataHash(tc.inputTypedData)
250+
sigHash, _, err := apitypes.TypedDataAndHash(tc.inputTypedData)
252251
signature, _, err := suite.backend.clientCtx.Keyring.SignByAddress((sdk.AccAddress)(from.Bytes()), sigHash)
253252
signature[goethcrypto.RecoveryIDOffset] += 27
254253
suite.Require().NoError(err)

rpc/backend/tx_info_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (suite *BackendTestSuite) TestGetTransactionByHash() {
4141
},
4242
}
4343

44-
rpcTransaction, _ := rpctypes.NewRPCTransaction(msgEthereumTx.AsTransaction(), common.Hash{}, 0, 0, big.NewInt(1))
44+
rpcTransaction, _ := rpctypes.NewRPCTransaction(msgEthereumTx.AsTransaction(), common.Hash{}, 0, 0, big.NewInt(1), suite.backend.chainID)
4545

4646
testCases := []struct {
4747
name string
@@ -123,7 +123,7 @@ func (suite *BackendTestSuite) TestGetTransactionByHash() {
123123

124124
func (suite *BackendTestSuite) TestGetTransactionsByHashPending() {
125125
msgEthereumTx, bz := suite.buildEthereumTx()
126-
rpcTransaction, _ := rpctypes.NewRPCTransaction(msgEthereumTx.AsTransaction(), common.Hash{}, 0, 0, big.NewInt(1))
126+
rpcTransaction, _ := rpctypes.NewRPCTransaction(msgEthereumTx.AsTransaction(), common.Hash{}, 0, 0, big.NewInt(1), suite.backend.chainID)
127127

128128
testCases := []struct {
129129
name string
@@ -183,7 +183,7 @@ func (suite *BackendTestSuite) TestGetTransactionsByHashPending() {
183183

184184
func (suite *BackendTestSuite) TestGetTxByEthHash() {
185185
msgEthereumTx, bz := suite.buildEthereumTx()
186-
rpcTransaction, _ := rpctypes.NewRPCTransaction(msgEthereumTx.AsTransaction(), common.Hash{}, 0, 0, big.NewInt(1))
186+
rpcTransaction, _ := rpctypes.NewRPCTransaction(msgEthereumTx.AsTransaction(), common.Hash{}, 0, 0, big.NewInt(1), suite.backend.chainID)
187187

188188
testCases := []struct {
189189
name string
@@ -299,6 +299,7 @@ func (suite *BackendTestSuite) TestGetTransactionByBlockAndIndex() {
299299
1,
300300
0,
301301
big.NewInt(1),
302+
suite.backend.chainID,
302303
)
303304
testCases := []struct {
304305
name string
@@ -392,6 +393,7 @@ func (suite *BackendTestSuite) TestGetTransactionByBlockNumberAndIndex() {
392393
1,
393394
0,
394395
big.NewInt(1),
396+
suite.backend.chainID,
395397
)
396398
testCases := []struct {
397399
name string
@@ -583,7 +585,8 @@ func (suite *BackendTestSuite) TestGetTransactionReceipt() {
583585

584586
db := dbm.NewMemDB()
585587
suite.backend.indexer = indexer.NewKVIndexer(db, tmlog.NewNopLogger(), suite.backend.clientCtx)
586-
err := suite.backend.indexer.IndexBlock(tc.block, tc.blockResult)
588+
err := suite.backend.indexer.IndexBlock(tc.block, tc.blockResult)
589+
suite.Require().NoError(err)
587590

588591
txReceipt, err := suite.backend.GetTransactionReceipt(common.HexToHash(tc.tx.Hash))
589592
if tc.expPass {

0 commit comments

Comments
 (0)