Skip to content

Commit 1bd31c2

Browse files
gtreptarv-jenkins
authored andcommitted
Fix failing web3 tests (#600)
* state-loader.md: Change default gasPrice to ganache's default tests/failing.web3: Remove eth_getBlockByNumber1Tx * tests/web3/: Replace temporary tests with originals from the failing subdirectory tests/failing.web3: Update * web3.md: use #getParentHash before mining a block instead of after tests/failing.web3: Remove eth_getBlockByNumberNoTx * tests/web3/getBlock_singleTransaction: Fix (reran it through ganache) tests/failing.web3: remove getBlock_singleTransaction * tests/web3/getBlock_singleAccount: Update to new firefly_genesisBlock semantics tests/failing.web3: remove getBlock_singleAccount * tests/web3/getBlock_multipleTransactions: Fix (reran through ganache) tests/failing.web3: remove getBlock_multipleTransactions * tests/web3/getBlock_multipleAccounts: Update to use firefly_genesisBlock semantics tests/failing.web3: remove getBlock_multipleAccounts * tests/web3/eth_getTransactionReceipt: Fix (reran through ganache) tests/failing.web3: remove eth_getTransactionReceipt
1 parent 0e124ae commit 1bd31c2

19 files changed

+212
-210
lines changed

state-loader.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ The `"rlp"` key loads the block information.
213213
( .Bag
214214
=> <message>
215215
<msgID> TXID:Int </msgID>
216-
<txGasPrice> 1 </txGasPrice>
217-
<txGasLimit> 90000 </txGasLimit>
216+
<txGasPrice> 20000000000 </txGasPrice>
217+
<txGasLimit> 90000 </txGasLimit>
218218
...
219219
</message>
220220
)

tests/failing.web3

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
tests/web3/erc20/erc20capped.in.json
22
tests/web3/erc20/erc20detailed.in.json
33
tests/web3/erc20/tokentimelock.in.json
4-
tests/web3/eth_getBlockByNumber1Tx-2.in.json
5-
tests/web3/eth_getBlockByNumberNoTx-2.in.json
6-
tests/web3/eth_getTransactionReceipt.in.json
7-
tests/web3/getBlock_multipleAccounts.in.json
8-
tests/web3/getBlock_multipleTransactions.in.json
9-
tests/web3/getBlock_singleAccount.in.json
10-
tests/web3/getBlock_singleTransaction.in.json

tests/web3/eth_getBlockByNumber1Tx-2.expected.json

Lines changed: 0 additions & 55 deletions
This file was deleted.

tests/web3/eth_getBlockByNumber1Tx-2.in.json

Lines changed: 0 additions & 42 deletions
This file was deleted.

tests/web3/eth_getBlockByNumber1Tx.expected.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@
2222
{
2323
"jsonrpc": "2.0",
2424
"id": 3,
25-
"result": "0x7cb24e9b7bb1a5bfeef17ea9531aa09c85512bb3fb36842e8167cf52711e8ca6"
25+
"result": "0x0e0e58533e93a19bc4a0b0656e186d9ba1062ce2661b8bc3d120d3a2a54a6783"
2626
},
2727
{
2828
"jsonrpc": "2.0",
2929
"id": 4,
3030
"result": {
3131
"number": "0x1",
32-
"hash": "0xb76ae4ea2d9932e9d586e0b66a6086c100af4a27c8aa55f1e3a06cbb10c07644",
32+
"hash": "0xccffb475947ec2a4f855a1e56387ddebf09f0d97077c42bd1daf24596341f174",
3333
"parentHash": "0x8dbc1f5985436ad7a31d0205238c8bdab6c4537913fe301f0d5732c1c7d1fada",
3434
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
3535
"nonce": "0x0000000000000000",
3636
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
3737
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
38-
"transactionsRoot": "0x11873442a563a07f22a326b68ffc810b80ecc4ec9273827c07df48fbd371fa47",
39-
"stateRoot": "0xd1e05dbd5b6eff3b3b766b958a93d087d611b4f025954c2b47aceb540b4ea56a",
38+
"transactionsRoot": "0x314104ec9dfee7f59ea3acce683e78c8d7aacb062337f8d5abc00fb0e4af124e",
39+
"stateRoot": "0xce0fffe3c38ad0f0759bc87cd579b426105353fd9b1e664cb0ecb64a3aa5b5d6",
4040
"receiptsRoot": "0x65c4d1b533902562730f0d110bcce51643ce4725ca03d85c33d5812c0ed308bf",
4141
"miner": "0x0000000000000000000000000000000000000000",
4242
"difficulty": "0x0",
@@ -47,7 +47,7 @@
4747
"gasUsed": "0xcf08",
4848
"timestamp": "0x5dcc9900",
4949
"transactions": [
50-
"0x7cb24e9b7bb1a5bfeef17ea9531aa09c85512bb3fb36842e8167cf52711e8ca6"
50+
"0x0e0e58533e93a19bc4a0b0656e186d9ba1062ce2661b8bc3d120d3a2a54a6783"
5151
],
5252
"uncles": []
5353
}

tests/web3/eth_getBlockByNumberNoTx-2.expected.json

Lines changed: 0 additions & 48 deletions
This file was deleted.

tests/web3/eth_getBlockByNumberNoTx-2.in.json

Lines changed: 0 additions & 33 deletions
This file was deleted.

tests/web3/eth_getBlockByNumberNoTx.expected.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"id": 3,
2525
"result": {
2626
"number": "0x0",
27-
"hash": "0xf0ff1cf2840c93787c52256f759c9bd5920dd25e515db055d3de8b9660d615b9",
28-
"parentHash": "0x8dbc1f5985436ad7a31d0205238c8bdab6c4537913fe301f0d5732c1c7d1fada",
27+
"hash": "0x8dbc1f5985436ad7a31d0205238c8bdab6c4537913fe301f0d5732c1c7d1fada",
28+
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
2929
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
3030
"nonce": "0x0000000000000000",
3131
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",

tests/web3/eth_getTransactionReceipt.expected.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@
44
"id": 1,
55
"result": true
66
},
7+
{
8+
"jsonrpc": "2.0",
9+
"id": 1,
10+
"result": true
11+
},
12+
{
13+
"jsonrpc": "2.0",
14+
"id": 1,
15+
"result": true
16+
},
17+
{
18+
"jsonrpc": "2.0",
19+
"id": 1,
20+
"result": true
21+
},
22+
{
23+
"jsonrpc": "2.0",
24+
"id": 1,
25+
"result": "1575490155"
26+
},
727
{
828
"jsonrpc": "2.0",
929
"id": 2,
@@ -15,7 +35,7 @@
1535
"result": {
1636
"transactionHash": "0x48b3bce222588aff4329c7c7aebaa39ffb66045254c1ca16b9b1a5482463682b",
1737
"transactionIndex": "0x0",
18-
"blockHash": "0xef122182b5260879e82a5495c5dbe57ebcf6f8b2cb8b6cf50dbfc96a1d39b776",
38+
"blockHash": "0xa623a7934462fe954331f8e2c96a036b6c7e516ce7755275a7797fc3249f8034",
1939
"blockNumber": "0x1",
2040
"from": "0x79a59cf0083efdf696befda81655104787f938d0",
2141
"to": null,

tests/web3/eth_getTransactionReceipt.in.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,30 @@
1010
}
1111
]
1212
},
13+
{
14+
"jsonrpc": "2.0",
15+
"id": 1,
16+
"method": "firefly_setGasLimit",
17+
"params": [ "0x6691b7" ]
18+
},
19+
{
20+
"jsonrpc": "2.0",
21+
"id": 1,
22+
"method": "firefly_setTime",
23+
"params": [ "0x5de81233" ]
24+
},
25+
{
26+
"jsonrpc": "2.0",
27+
"id": 1,
28+
"method": "firefly_genesisBlock",
29+
"params": [ ]
30+
},
31+
{
32+
"jsonrpc": "2.0",
33+
"id": 1,
34+
"method": "evm_increaseTime",
35+
"params": [ 56 ]
36+
},
1337
{
1438
"jsonrpc": "2.0",
1539
"id": 2,
@@ -31,4 +55,4 @@
3155
"0x48b3bce222588aff4329c7c7aebaa39ffb66045254c1ca16b9b1a5482463682b"
3256
]
3357
}
34-
]
58+
]

0 commit comments

Comments
 (0)