Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve CI and test errors #34

Merged
merged 32 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d4d7ccd
Remove depguard from golangci-lint
drklee3 Jan 31, 2024
1a6d9d0
Remove cachix/cachix-action step in integration_tests job
drklee3 Jan 31, 2024
fe97798
Remove cachix/cachix-action step from gomod2nix
drklee3 Jan 31, 2024
603f67c
Remove cachix/cachix-action step from python-lint
drklee3 Jan 31, 2024
afa610b
Remove cache upload job
drklee3 Jan 31, 2024
f8323d9
Trigger ci tests
drklee3 Jan 31, 2024
461ce01
Use go 1.20 for iavl v1
drklee3 Jan 31, 2024
ad77ef4
Use go 1.20 in ci
drklee3 Jan 31, 2024
340cfa7
Fix yaml parsing 1.20
drklee3 Jan 31, 2024
51061ce
Resolve lint issues
drklee3 Jan 31, 2024
2e95a62
Update ibc-go to v6.1.1, [email protected]
drklee3 Jan 31, 2024
72f3cb9
Exclude .pb.go from lll linter
drklee3 Jan 31, 2024
189dfa9
Resolve unused lint errors
drklee3 Jan 31, 2024
a8f1f6b
Add get-diff-action step to integration tests
drklee3 Jan 31, 2024
86e098f
Update integration_tests nix setup
drklee3 Feb 1, 2024
1fd7052
Add nix-community/cache-nix-action for integration tests
drklee3 Feb 1, 2024
793a176
test: Fix tracing tests mock error
drklee3 Feb 1, 2024
58fc906
ci: Remove codecov upload
drklee3 Feb 1, 2024
3c84f46
Add goleveldb replace directive to fix version not found errors in te…
drklee3 Feb 2, 2024
ccf630b
Use json string instead of byte array for tests data clarity
drklee3 Feb 2, 2024
66670f0
Ignore lint lll error on server.FlagAPISwagger
drklee3 Feb 2, 2024
bc969af
Resolve lint errors
drklee3 Feb 2, 2024
c52671d
fix: tx trace gasUsed camel case instead of snake
drklee3 Feb 2, 2024
a4f8db9
Prevent modifying trace response if missing fail or non gas error
drklee3 Feb 5, 2024
c5df89f
Add note for tracing test
drklee3 Feb 5, 2024
6874996
Revert tracing changes with minimum fix
drklee3 Feb 5, 2024
9c5e59b
gofumpt
drklee3 Feb 5, 2024
9564d88
test: Update test_pruned_node expected error integration test
drklee3 Feb 6, 2024
8e787bb
Handle connection refused error in integration test
drklee3 Feb 6, 2024
2730283
Restore jose2go version in gomod2nix.toml
drklee3 Feb 6, 2024
1494668
Resolve flake8 lint errors on integration tests
drklee3 Feb 6, 2024
5fe38f6
Add -I nixpkgs=./nix to integration Makefile
drklee3 Feb 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions rpc/backend/evm_query_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,23 @@ import (
// To use a mock method it has to be registered in a given test.
var _ evmtypes.QueryClient = &mocks.EVMQueryClient{}

// {"failed": false, "test": "hello"}
var data = []byte{
0x7B, 0x22, 0x66, 0x61, 0x69, 0x6C, 0x65, 0x64,
0x22, 0x3A, 0x20, 0x66, 0x61, 0x6C, 0x73, 0x65,
0x2C, 0x20, 0x22, 0x74, 0x65, 0x73, 0x74, 0x22,
0x3A, 0x20, 0x22, 0x68, 0x65, 0x6C, 0x6C, 0x6F,
0x22, 0x7D,
}

// TraceTransaction
func RegisterTraceTransactionWithPredecessors(queryClient *mocks.EVMQueryClient, msgEthTx *evmtypes.MsgEthereumTx, predecessors []*evmtypes.MsgEthereumTx) {
data := []byte{0x7b, 0x22, 0x74, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x22, 0x7d}
drklee3 marked this conversation as resolved.
Show resolved Hide resolved
queryClient.On("TraceTx", rpc.ContextWithHeight(1),
&evmtypes.QueryTraceTxRequest{Msg: msgEthTx, BlockNumber: 1, Predecessors: predecessors, ChainId: 9000}).
Return(&evmtypes.QueryTraceTxResponse{Data: data}, nil)
}

func RegisterTraceTransaction(queryClient *mocks.EVMQueryClient, msgEthTx *evmtypes.MsgEthereumTx) {
data := []byte{0x7b, 0x22, 0x74, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x22, 0x7d}
queryClient.On("TraceTx", rpc.ContextWithHeight(1), &evmtypes.QueryTraceTxRequest{Msg: msgEthTx, BlockNumber: 1, ChainId: 9000}).
Return(&evmtypes.QueryTraceTxResponse{Data: data}, nil)
}
Expand Down
19 changes: 9 additions & 10 deletions rpc/backend/tracing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
abci "github.com/tendermint/tendermint/abci/types"
tmlog "github.com/tendermint/tendermint/libs/log"
tmrpctypes "github.com/tendermint/tendermint/rpc/core/types"
"github.com/tendermint/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"
)
Expand Down Expand Up @@ -50,15 +49,15 @@ func (suite *BackendTestSuite) TestTraceTransaction() {
testCases := []struct {
name string
registerMock func()
block *types.Block
block *tmtypes.Block
responseBlock []*abci.ResponseDeliverTx
expResult interface{}
expPass bool
}{
{
"fail - tx not found",
func() {},
&types.Block{Header: types.Header{Height: 1}, Data: types.Data{Txs: []types.Tx{}}},
&tmtypes.Block{Header: tmtypes.Header{Height: 1}, Data: tmtypes.Data{Txs: []tmtypes.Tx{}}},
[]*abci.ResponseDeliverTx{
{
Code: 0,
Expand All @@ -84,7 +83,7 @@ func (suite *BackendTestSuite) TestTraceTransaction() {
client := suite.backend.clientCtx.Client.(*mocks.Client)
RegisterBlockError(client, 1)
},
&types.Block{Header: types.Header{Height: 1}, Data: types.Data{Txs: []types.Tx{txBz}}},
&tmtypes.Block{Header: tmtypes.Header{Height: 1}, Data: tmtypes.Data{Txs: []tmtypes.Tx{txBz}}},
[]*abci.ResponseDeliverTx{
{
Code: 0,
Expand All @@ -100,18 +99,18 @@ func (suite *BackendTestSuite) TestTraceTransaction() {
},
},
},
map[string]interface{}{"test": "hello"},
map[string]interface{}{"failed": false, "test": "hello"},
false,
},
{
"pass - transaction found in a block with multiple transactions",
func() {
queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient)
client := suite.backend.clientCtx.Client.(*mocks.Client)
RegisterBlockMultipleTxs(client, 1, []types.Tx{txBz, txBz2})
RegisterBlockMultipleTxs(client, 1, []tmtypes.Tx{txBz, txBz2})
RegisterTraceTransactionWithPredecessors(queryClient, msgEthereumTx, []*evmtypes.MsgEthereumTx{msgEthereumTx})
},
&types.Block{Header: types.Header{Height: 1, ChainID: ChainID}, Data: types.Data{Txs: []types.Tx{txBz, txBz2}}},
&tmtypes.Block{Header: tmtypes.Header{Height: 1, ChainID: ChainID}, Data: tmtypes.Data{Txs: []tmtypes.Tx{txBz, txBz2}}},
[]*abci.ResponseDeliverTx{
{
Code: 0,
Expand Down Expand Up @@ -140,7 +139,7 @@ func (suite *BackendTestSuite) TestTraceTransaction() {
},
},
},
map[string]interface{}{"test": "hello"},
map[string]interface{}{"failed": false, "test": "hello"},
true,
},
{
Expand All @@ -151,7 +150,7 @@ func (suite *BackendTestSuite) TestTraceTransaction() {
RegisterBlock(client, 1, txBz)
RegisterTraceTransaction(queryClient, msgEthereumTx)
},
&types.Block{Header: types.Header{Height: 1}, Data: types.Data{Txs: []types.Tx{txBz}}},
&tmtypes.Block{Header: tmtypes.Header{Height: 1}, Data: tmtypes.Data{Txs: []tmtypes.Tx{txBz}}},
[]*abci.ResponseDeliverTx{
{
Code: 0,
Expand All @@ -167,7 +166,7 @@ func (suite *BackendTestSuite) TestTraceTransaction() {
},
},
},
map[string]interface{}{"test": "hello"},
map[string]interface{}{"failed": false, "test": "hello"},
true,
},
}
Expand Down
Loading