@@ -11,8 +11,11 @@ import (
11
11
12
12
"github.com/stretchr/testify/suite"
13
13
14
+ "github.com/ethereum/go-ethereum"
14
15
"github.com/ethereum/go-ethereum/common"
15
16
"github.com/ethereum/go-ethereum/ethclient"
17
+ "github.com/ethereum/go-ethereum/ethclient/gethclient"
18
+ "github.com/ethereum/go-ethereum/rpc"
16
19
17
20
"github.com/tharsis/ethermint/server/config"
18
21
"github.com/tharsis/ethermint/testutil/network"
@@ -34,6 +37,8 @@ type IntegrationTestSuite struct {
34
37
ctx context.Context
35
38
cfg network.Config
36
39
network * network.Network
40
+
41
+ gethClient * gethclient.Client
37
42
}
38
43
39
44
func (s * IntegrationTestSuite ) SetupSuite () {
@@ -53,11 +58,17 @@ func (s *IntegrationTestSuite) SetupSuite() {
53
58
_ , err = s .network .WaitForHeight (1 )
54
59
s .Require ().NoError (err )
55
60
61
+ address := fmt .Sprintf ("http://%s" , s .network .Validators [0 ].AppConfig .JSONRPC .Address )
62
+
56
63
if s .network .Validators [0 ].JSONRPCClient == nil {
57
- address := fmt .Sprintf ("http://%s" , s .network .Validators [0 ].AppConfig .JSONRPC .Address )
58
64
s .network .Validators [0 ].JSONRPCClient , err = ethclient .Dial (address )
59
65
s .Require ().NoError (err )
60
66
}
67
+
68
+ rpcClient , err := rpc .DialContext (s .ctx , address )
69
+ s .Require ().NoError (err )
70
+ s .gethClient = gethclient .New (rpcClient )
71
+ s .Require ().NotNil (s .gethClient )
61
72
}
62
73
63
74
func (s * IntegrationTestSuite ) TestChainID () {
@@ -79,6 +90,20 @@ func (s *IntegrationTestSuite) TestChainID() {
79
90
s .Require ().Equal (eip155ChainID , eip155ChainIDGen )
80
91
}
81
92
93
+ func (s * IntegrationTestSuite ) TestNodeInfo () {
94
+ // Not implemented
95
+ info , err := s .gethClient .GetNodeInfo (s .ctx )
96
+ s .Require ().Error (err )
97
+ s .Require ().Empty (info )
98
+ }
99
+
100
+ func (s * IntegrationTestSuite ) TestCreateAccessList () {
101
+ // Not implemented
102
+ accessList , _ , _ , err := s .gethClient .CreateAccessList (s .ctx , ethereum.CallMsg {})
103
+ s .Require ().Error (err )
104
+ s .Require ().Nil (accessList )
105
+ }
106
+
82
107
func (s * IntegrationTestSuite ) TestBlock () {
83
108
blockNum , err := s .network .Validators [0 ].JSONRPCClient .BlockNumber (s .ctx )
84
109
s .Require ().NoError (err )
0 commit comments