Skip to content

Commit

Permalink
feat(input-reader): Add input-reader tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoura committed Jun 28, 2024
1 parent 32079ad commit 08a5484
Show file tree
Hide file tree
Showing 8 changed files with 808 additions and 0 deletions.
686 changes: 686 additions & 0 deletions internal/inputreader/inputreader_test.go

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions internal/inputreader/test_data/header_0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"number": "0x11",
"gasUsed": "0x11ddc",
"gasLimit": "0x1c9c380",
"extraData": "0x",
"timestamp": "0x6653e99a",
"difficulty": "0x0",
"parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"sha3Uncles":"0x0000000000000000000000000000000000000000000000000000000000000000",
"stateRoot":"0x0000000000000000000000000000000000000000000000000000000000000000",
"transactionsRoot":"0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot":"0x0000000000000000000000000000000000000000000000000000000000000000",
"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
14 changes: 14 additions & 0 deletions internal/inputreader/test_data/header_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"number": "0x12",
"gasUsed": "0x11ddc",
"gasLimit": "0x1c9c380",
"extraData": "0x",
"timestamp": "0x6653e99b",
"difficulty": "0x0",
"parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"sha3Uncles":"0x0000000000000000000000000000000000000000000000000000000000000000",
"stateRoot":"0x0000000000000000000000000000000000000000000000000000000000000000",
"transactionsRoot":"0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot":"0x0000000000000000000000000000000000000000000000000000000000000000",
"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
14 changes: 14 additions & 0 deletions internal/inputreader/test_data/header_2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"number": "0x13",
"gasUsed": "0x11ddc",
"gasLimit": "0x1c9c380",
"extraData": "0x",
"timestamp": "0x6653e99c",
"difficulty": "0x0",
"parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"sha3Uncles":"0x0000000000000000000000000000000000000000000000000000000000000000",
"stateRoot":"0x0000000000000000000000000000000000000000000000000000000000000000",
"transactionsRoot":"0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot":"0x0000000000000000000000000000000000000000000000000000000000000000",
"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
20 changes: 20 additions & 0 deletions internal/inputreader/test_data/input_added_event_0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"AppContract": "0xb72c832ddea10326143831f1e5f1646920c9c990",
"Index": 0,
"Input": "zH3uHwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHppAAAAAAAAAAAAAAAAtyyDLd6hAyYUODHx5fFkaSDJyZAAAAAAAAAAAAAAAADzn9blGq2I9vTOariCcnnP/7kiZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGZM7voAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATerb7vAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Raw": {
"address": "0xa1b8eb1f13d8d5db976a653bbdf8972cfd14691c",
"topics": [
"0xc05d337121a6e8605c6ec0b72aa29c4210ffe6e5b9cefdd6a7058188a8f66f98",
"0x000000000000000000000000b72c832ddea10326143831f1e5f1646920c9c990",
"0x0000000000000000000000000000000000000000000000000000000000000000"
],
"data": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000124cc7dee1f0000000000000000000000000000000000000000000000000000000000007a69000000000000000000000000b72c832ddea10326143831f1e5f1646920c9c990000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000664ceefa000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000004deadbeef0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockNumber": "0x11",
"transactionHash": "0xc405b17d1216fa348ac399df99703ec97cd77b03c9790cca8acddffe7ce4e901",
"transactionIndex": "0x0",
"blockHash": "0x03f50ead05dc4700559e7da32724e6bef31acbfd9b96d823203a8737432b6ad4",
"logIndex": "0x0",
"removed": false
}
}
20 changes: 20 additions & 0 deletions internal/inputreader/test_data/input_added_event_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"AppContract": "0xb72c832ddea10326143831f1e5f1646920c9c990",
"Index": 1,
"Input": "zH3uHwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHppAAAAAAAAAAAAAAAAtyyDLd6hAyYUODHx5fFkaSDJyZAAAAAAAAAAAAAAAABwmXlwxRgS3DoBDH0BtQ4NF9x5yAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGZM71kAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAS+rb7vAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Raw": {
"address": "0xa1b8eb1f13d8d5db976a653bbdf8972cfd14691c",
"topics": [
"0xc05d337121a6e8605c6ec0b72aa29c4210ffe6e5b9cefdd6a7058188a8f66f98",
"0x000000000000000000000000b72c832ddea10326143831f1e5f1646920c9c990",
"0x0000000000000000000000000000000000000000000000000000000000000001"
],
"data": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000124cc7dee1f0000000000000000000000000000000000000000000000000000000000007a69000000000000000000000000b72c832ddea10326143831f1e5f1646920c9c99000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c8000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000664cef59000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000004beadbeef0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockNumber": "0x12",
"transactionHash": "0x2ae7f7e308ecd1c75c43f073cf15692ac460d7578cc618be242b2b89354a3eb4",
"transactionIndex": "0x0",
"blockHash": "0xcf47fc77c83197f02fb95ea2dd4ac9a681f8cc270151d72765074b876041b584",
"logIndex": "0x0",
"removed": false
}
}
20 changes: 20 additions & 0 deletions internal/inputreader/test_data/input_added_event_2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"AppContract": "0x2e663fe9ae92275242406a185aa4fc8174339d3e",
"Index": 2,
"Input": "zH3uHwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHppAAAAAAAAAAAAAAAALmY/6a6SJ1JCQGoYWqT8gXQznT4AAAAAAAAAAAAAAADzn9blGq2I9vTOariCcnnP/7kiZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGZx6R8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATOrb7vAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Raw": {
"address": "0xa1b8eb1f13d8d5db976a653bbdf8972cfd14691c",
"topics": [
"0xc05d337121a6e8605c6ec0b72aa29c4210ffe6e5b9cefdd6a7058188a8f66f98",
"0x0000000000000000000000002e663fe9ae92275242406a185aa4fc8174339d3e",
"0x0000000000000000000000000000000000000000000000000000000000000002"
],
"data": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000124cc7dee1f0000000000000000000000000000000000000000000000000000000000007a690000000000000000000000002e663fe9ae92275242406a185aa4fc8174339d3e000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000000000000000013000000000000000000000000000000000000000000000000000000006671e91f000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000004ceadbeef0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockNumber": "0x13",
"transactionHash": "0xf936021c09a73cbd35ee4bc648e48a3524f2665d93b97c56510348098f32c48c",
"transactionIndex": "0x0",
"blockHash": "0x1bd76f02c7c57256a2025410ab902ad56942faed08df0cf812216e37f7cc9f97",
"logIndex": "0x0",
"removed": false
}
}
20 changes: 20 additions & 0 deletions internal/inputreader/test_data/input_added_event_3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"AppContract": "0x2e663fe9ae92275242406a185aa4fc8174339d3e",
"Index": 3,
"Input": "zH3uHwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHppAAAAAAAAAAAAAAAALmY/6a6SJ1JCQGoYWqT8gXQznT4AAAAAAAAAAAAAAADzn9blGq2I9vTOariCcnnP/7kiZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGZx6R8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT+rb7vAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Raw": {
"address": "0xa1b8eb1f13d8d5db976a653bbdf8972cfd14691c",
"topics": [
"0xc05d337121a6e8605c6ec0b72aa29c4210ffe6e5b9cefdd6a7058188a8f66f98",
"0x0000000000000000000000002e663fe9ae92275242406a185aa4fc8174339d3e",
"0x0000000000000000000000000000000000000000000000000000000000000003"
],
"data": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000124cc7dee1f0000000000000000000000000000000000000000000000000000000000007a690000000000000000000000002e663fe9ae92275242406a185aa4fc8174339d3e000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000000000000000013000000000000000000000000000000000000000000000000000000006671e91f000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000004feadbeef0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockNumber": "0x13",
"transactionHash": "0x9c100b1acf602f19798f699cb7c06e16949f39a6b0c99b8ea462f1f916ff0102",
"transactionIndex": "0x1",
"blockHash": "0x1bd76f02c7c57256a2025410ab902ad56942faed08df0cf812216e37f7cc9f97",
"logIndex": "0x1",
"removed": false
}
}

0 comments on commit 08a5484

Please sign in to comment.