laconicd-deprecated/rpc/backend/evm_backend_test.go
Daniel Burckhardt c626a5c8ee
testing(json rpc): Add backend test suite with mock grpc query client (#1199)
* tests(json-rpc): wip evm_backend unit test setup

* tests(json-rpc): wip evm_backend unit test setup

* fix viper

* wip query client mock

* fix first backend test except error message

* clean up

* wip Context with Height

* fix JSON RPC backend test setup

* typo

* refactor folder structure

* Update rpc/backend/evm_backend_test.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2022-07-23 11:16:23 +02:00

31 lines
554 B
Go

package backend
import "github.com/ethereum/go-ethereum/common/hexutil"
func (suite *BackendTestSuite) TestBlockNumber() {
testCases := []struct {
mame string
malleate func()
expBlockNumber hexutil.Uint64
expPass bool
}{
{
"pass",
func() {
},
0x1,
true,
},
}
for _, tc := range testCases {
blockNumber, err := suite.backend.BlockNumber()
if tc.expPass {
suite.Require().NoError(err)
suite.Require().Equal(tc.expBlockNumber, blockNumber)
} else {
suite.Require().Error(err)
}
}
}