@@ -8,10 +8,6 @@ import (
8
8
"testing"
9
9
"time"
10
10
11
- "github.com/hyperledger/burrow/rpc/web3"
12
- "github.com/hyperledger/burrow/txs"
13
- "github.com/hyperledger/burrow/txs/payload"
14
-
15
11
"github.com/hyperledger/burrow/acm/balance"
16
12
"github.com/hyperledger/burrow/crypto"
17
13
"github.com/hyperledger/burrow/execution/evm/abi"
@@ -20,17 +16,23 @@ import (
20
16
"github.com/hyperledger/burrow/logging"
21
17
"github.com/hyperledger/burrow/project"
22
18
"github.com/hyperledger/burrow/rpc"
19
+ "github.com/hyperledger/burrow/rpc/web3"
20
+ "github.com/hyperledger/burrow/txs"
21
+ "github.com/hyperledger/burrow/txs/payload"
23
22
"github.com/stretchr/testify/require"
24
23
)
25
24
26
25
var d = new (web3.HexDecoder ).Must ()
27
26
27
+ // Check we can force set a decimal ChainID
28
+ const chainID = "15321"
29
+
28
30
func TestWeb3Service (t * testing.T ) {
29
31
ctx := context .Background ()
30
32
genesisAccounts := integration .MakePrivateAccounts ("burrow" , 1 )
31
33
genesisAccounts = append (genesisAccounts , integration .MakeEthereumAccounts ("ethereum" , 3 )... )
32
34
genesisDoc := integration .TestGenesisDoc (genesisAccounts , 0 )
33
-
35
+ genesisDoc . ChainID = chainID
34
36
config , _ := integration .NewTestConfig (genesisDoc )
35
37
logger := logging .NewNoopLogger ()
36
38
kern , err := integration .TestKernel (genesisAccounts [0 ], genesisAccounts , config )
@@ -91,7 +93,7 @@ func TestWeb3Service(t *testing.T) {
91
93
t .Run ("NetVersion" , func (t * testing.T ) {
92
94
result , err := eth .NetVersion ()
93
95
require .NoError (t , err )
94
- require .Equal (t , crypto .GetEthChainID (genesisDoc .ChainID ()). String ( ), result .ChainID )
96
+ require .Equal (t , web3 . HexEncoder . BigInt ( crypto .GetEthChainID (genesisDoc .GetChainID ())), result .ChainID )
95
97
})
96
98
97
99
t .Run ("EthProtocolVersion" , func (t * testing.T ) {
@@ -104,7 +106,7 @@ func TestWeb3Service(t *testing.T) {
104
106
result , err := eth .EthChainId ()
105
107
require .NoError (t , err )
106
108
doc := config .GenesisDoc
107
- require .Equal (t , doc .ChainID ( ), result .ChainId )
109
+ require .Equal (t , web3 . HexEncoder . BigInt ( crypto . GetEthChainID ( doc .GetChainID ()) ), result .ChainId )
108
110
})
109
111
})
110
112
@@ -118,7 +120,7 @@ func TestWeb3Service(t *testing.T) {
118
120
before := acc .GetBalance ()
119
121
120
122
t .Run ("EthSendRawTransaction" , func (t * testing.T ) {
121
- txEnv := txs .Enclose (genesisDoc . ChainID () , & payload.CallTx {
123
+ txEnv := txs .Enclose (chainID , & payload.CallTx {
122
124
Input : & payload.TxInput {
123
125
Address : sender .GetAddress (),
124
126
Amount : 1 ,
0 commit comments