[PIE-2267] Automated tests for handling ERC20 contract (#529)

* update changelog

Signed-off-by: Karim TAAM <karim.t2am@gmail.com>

* Init test for ERC20 deployment and transfert

Signed-off-by: Karim TAAM <karim.t2am@gmail.com>

* add automated tests for handling of ERC20 token contract.

Signed-off-by: Karim TAAM <karim.t2am@gmail.com>

* remove useless change

Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
pull/545/head
Karim T 5 years ago committed by GitHub
parent fff1f5e13f
commit 0a9ccc1ed8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/chain-data/blocks.json
  2. 9821
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/replay-trace-transaction/all/trace_replayBlockTransactions_all_0x19.json
  3. 70
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/replay-trace-transaction/flat/trace_replayBlockTransactions_traceOnly_0x19.json
  4. 140
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/replay-trace-transaction/statediff/trace_replayBlockTransactions_diffOnly_0x19.json
  5. 9677
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/replay-trace-transaction/vm-trace/trace_replayBlockTransactions_0x19.json
  6. 76
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-block/trace_block_0x17.json
  7. 125
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-block/trace_block_0x18.json
  8. 74
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-block/trace_block_0x19.json
  9. 114
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-transaction/trace_transaction_0x18.json
  10. 77
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-transaction/trace_transaction_0x19.json

@ -0,0 +1,76 @@
{
"request": {
"jsonrpc": "2.0",
"method": "trace_block",
"params": [
"0x17"
],
"id": 415
},
"response": {
"jsonrpc": "2.0",
"result": [
{
"action": {
"callType": "call",
"from": "0x627306090abab3a6e1400e9345bc60c78a8bef57",
"gas": "0x2b654",
"input": "0x0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000120785e45de3d6be050ba3c4d33ff0bb2d010ace3b1dfe9c49f4c7a8075102fa19a86c010ace3b1dfe9c49f4c7a8075102fa19a86d",
"to": "0x0120000000000000000000000000000000000000",
"value": "0x0"
},
"blockHash": "0xb26cef9823c3c5af6dd3a8c70641f13a9a5ed2cebc96535b443ad1fc57d4027c",
"blockNumber": 23,
"result": {
"gasUsed": "0x301",
"output": "0x0000000000000000000000000000000000000000000000000000000000000012"
},
"subtraces": 1,
"traceAddress": [],
"transactionHash": "0xea357b8947f2aa968eba99ac995f07dbd5d006dc2eb4c2f1a2d4f4278a150373",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"callType": "staticcall",
"from": "0x0120000000000000000000000000000000000000",
"gas": "0x2a88c",
"input": "0x",
"to": "0x0000000000000000000000000000000000000010",
"value": "0x0"
},
"blockHash": "0xb26cef9823c3c5af6dd3a8c70641f13a9a5ed2cebc96535b443ad1fc57d4027c",
"blockNumber": 23,
"result": {
"gasUsed": "0x0",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [
0
],
"transactionHash": "0xea357b8947f2aa968eba99ac995f07dbd5d006dc2eb4c2f1a2d4f4278a150373",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"author": "0x0000000000000000000000000000000000000000",
"rewardType": "block",
"value": "0x1bc16d674ec80000"
},
"blockHash": "0xb26cef9823c3c5af6dd3a8c70641f13a9a5ed2cebc96535b443ad1fc57d4027c",
"blockNumber": 23,
"result": null,
"subtraces": 0,
"traceAddress": [],
"transactionHash": null,
"transactionPosition": null,
"type": "reward"
}
],
"id": 415
},
"statusCode": 200
}

@ -0,0 +1,125 @@
{
"request": {
"jsonrpc": "2.0",
"method": "trace_block",
"params": [
"0x18"
],
"id": 415
},
"response": {
"jsonrpc": "2.0",
"result": [
{
"action": {
"callType": "call",
"from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
"gas": "0xffa7e2",
"input": "0x000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000120785e45de3d6be050ba3c4d33ff0bb2d010ace3b1dfe9c49f4c7a8075102fa19a86c010ace3b1dfe9c49f4c7a8075102fa19a86d",
"to": "0x0040000000000000000000000000000000000000",
"value": "0x0"
},
"blockHash": "0x45763af427cf4569461f77403bcce571f194fba0d364f3a51fe3d3328267eefa",
"blockNumber": 24,
"result": {
"gasUsed": "0x915",
"output": "0x0000000000000000000000000000000000000000000000000000000000000012"
},
"subtraces": 1,
"traceAddress": [],
"transactionHash": "0x2f92ad4d4433cd8f78214c1ba3b3d3d8a2b1e993b6cf336eb9200c8d9ac3b94d",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"callType": "call",
"from": "0x0040000000000000000000000000000000000000",
"gas": "0xfba648",
"input": "0x00000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000120785e45de3d6be050ba3c4d33ff0bb2d010ace3b1dfe9c49f4c7a8075102fa19a86c010ace3b1dfe9c49f4c7a8075102fa19a86d",
"to": "0x0040000000000000000000000000000000000000",
"value": "0x0"
},
"blockHash": "0x45763af427cf4569461f77403bcce571f194fba0d364f3a51fe3d3328267eefa",
"blockNumber": 24,
"result": {
"gasUsed": "0x608",
"output": "0x0000000000000000000000000000000000000000000000000000000000000012"
},
"subtraces": 1,
"traceAddress": [
0
],
"transactionHash": "0x2f92ad4d4433cd8f78214c1ba3b3d3d8a2b1e993b6cf336eb9200c8d9ac3b94d",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"callType": "call",
"from": "0x0040000000000000000000000000000000000000",
"gas": "0xf7b4ba",
"input": "0x0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000120785e45de3d6be050ba3c4d33ff0bb2d010ace3b1dfe9c49f4c7a8075102fa19a86c010ace3b1dfe9c49f4c7a8075102fa19a86d",
"to": "0x0120000000000000000000000000000000000000",
"value": "0x0"
},
"blockHash": "0x45763af427cf4569461f77403bcce571f194fba0d364f3a51fe3d3328267eefa",
"blockNumber": 24,
"result": {
"gasUsed": "0x301",
"output": "0x0000000000000000000000000000000000000000000000000000000000000012"
},
"subtraces": 1,
"traceAddress": [
0,
0
],
"transactionHash": "0x2f92ad4d4433cd8f78214c1ba3b3d3d8a2b1e993b6cf336eb9200c8d9ac3b94d",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"callType": "staticcall",
"from": "0x0120000000000000000000000000000000000000",
"gas": "0xf3d2f9",
"input": "0x",
"to": "0x0000000000000000000000000000000000000010",
"value": "0x0"
},
"blockHash": "0x45763af427cf4569461f77403bcce571f194fba0d364f3a51fe3d3328267eefa",
"blockNumber": 24,
"result": {
"gasUsed": "0x0",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [
0,
0,
0
],
"transactionHash": "0x2f92ad4d4433cd8f78214c1ba3b3d3d8a2b1e993b6cf336eb9200c8d9ac3b94d",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"author": "0x0000000000000000000000000000000000000000",
"rewardType": "block",
"value": "0x1bc16d674ec80000"
},
"blockHash": "0x45763af427cf4569461f77403bcce571f194fba0d364f3a51fe3d3328267eefa",
"blockNumber": 24,
"result": null,
"subtraces": 0,
"traceAddress": [],
"transactionHash": null,
"transactionPosition": null,
"type": "reward"
}
],
"id": 415
},
"statusCode": 200
}

@ -0,0 +1,114 @@
{
"request": [
{
"jsonrpc": "2.0",
"method": "trace_transaction",
"params": [
"0x2f92ad4d4433cd8f78214c1ba3b3d3d8a2b1e993b6cf336eb9200c8d9ac3b94d"
],
"id": 415
}
],
"response": [
{
"jsonrpc": "2.0",
"result": [
{
"action": {
"callType": "call",
"from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
"gas": "0xffa7e2",
"input": "0x000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000120785e45de3d6be050ba3c4d33ff0bb2d010ace3b1dfe9c49f4c7a8075102fa19a86c010ace3b1dfe9c49f4c7a8075102fa19a86d",
"to": "0x0040000000000000000000000000000000000000",
"value": "0x0"
},
"blockHash": "0x45763af427cf4569461f77403bcce571f194fba0d364f3a51fe3d3328267eefa",
"blockNumber": 24,
"result": {
"gasUsed": "0x915",
"output": "0x0000000000000000000000000000000000000000000000000000000000000012"
},
"subtraces": 1,
"traceAddress": [],
"transactionHash": "0x2f92ad4d4433cd8f78214c1ba3b3d3d8a2b1e993b6cf336eb9200c8d9ac3b94d",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"callType": "call",
"from": "0x0040000000000000000000000000000000000000",
"gas": "0xfba648",
"input": "0x00000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000120785e45de3d6be050ba3c4d33ff0bb2d010ace3b1dfe9c49f4c7a8075102fa19a86c010ace3b1dfe9c49f4c7a8075102fa19a86d",
"to": "0x0040000000000000000000000000000000000000",
"value": "0x0"
},
"blockHash": "0x45763af427cf4569461f77403bcce571f194fba0d364f3a51fe3d3328267eefa",
"blockNumber": 24,
"result": {
"gasUsed": "0x608",
"output": "0x0000000000000000000000000000000000000000000000000000000000000012"
},
"subtraces": 1,
"traceAddress": [
0
],
"transactionHash": "0x2f92ad4d4433cd8f78214c1ba3b3d3d8a2b1e993b6cf336eb9200c8d9ac3b94d",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"callType": "call",
"from": "0x0040000000000000000000000000000000000000",
"gas": "0xf7b4ba",
"input": "0x0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000120785e45de3d6be050ba3c4d33ff0bb2d010ace3b1dfe9c49f4c7a8075102fa19a86c010ace3b1dfe9c49f4c7a8075102fa19a86d",
"to": "0x0120000000000000000000000000000000000000",
"value": "0x0"
},
"blockHash": "0x45763af427cf4569461f77403bcce571f194fba0d364f3a51fe3d3328267eefa",
"blockNumber": 24,
"result": {
"gasUsed": "0x301",
"output": "0x0000000000000000000000000000000000000000000000000000000000000012"
},
"subtraces": 1,
"traceAddress": [
0,
0
],
"transactionHash": "0x2f92ad4d4433cd8f78214c1ba3b3d3d8a2b1e993b6cf336eb9200c8d9ac3b94d",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"callType": "staticcall",
"from": "0x0120000000000000000000000000000000000000",
"gas": "0xf3d2f9",
"input": "0x",
"to": "0x0000000000000000000000000000000000000010",
"value": "0x0"
},
"blockHash": "0x45763af427cf4569461f77403bcce571f194fba0d364f3a51fe3d3328267eefa",
"blockNumber": 24,
"result": {
"gasUsed": "0x0",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [
0,
0,
0
],
"transactionHash": "0x2f92ad4d4433cd8f78214c1ba3b3d3d8a2b1e993b6cf336eb9200c8d9ac3b94d",
"transactionPosition": 0,
"type": "call"
}
],
"id": 415
}
],
"statusCode": 200
}
Loading…
Cancel
Save