Skip to content

Commit

Permalink
Added invalid transactions to the generated tests reference
Browse files Browse the repository at this point in the history
  • Loading branch information
qbzzt authored and winsvega committed Jul 27, 2021
1 parent 505c414 commit 5d534e3
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 8 deletions.
47 changes: 43 additions & 4 deletions docs/test_types/TestStructures/BlockchainTests/block.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Valid Block Section
===================


::

{
Expand Down Expand Up @@ -40,19 +40,58 @@ Valid Block Section
],
"uncleHeaders" : [
],
"rlp" : "0xf902c5f901fca0d1b5003dbed66eb89c9b0062798a4fddf737157ef6550187d098d91ae2c3b853a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347942adc25665018aa1fe0e6bc666dac8fc2697ff9baa06a117466ec6b8dbea3a613366a1b468bdeb6282e0156772c81cc2139caa7c88ea076660905a74ef4a24b19295d8740a349b1170d3298118106201d43cd7886afbfa05fa98a3ba1e25059bf41376c6f9a57b500a02c14c6a87afd1665a3906c4afd51b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000001887fffffffffffffff82556d8203e842a00000000000000000000000000000000000000000000000000000000000000000880000000000000000f8c3f8c1800183030d40941baf27b88c48dd02b744999cf3522766929d2b2a80b86000000000000000000000000000000000000000000000000000000000000bc03712fac13c68425054e372b0861af05648614d69d32800fba9ad4522238d4b937a00000000000000000000000000000000000000000000000000000000000000001ca03d55a2ac293c7ad82632b18705e67ad2a0e6177d44f601dca043934c8cd8c07aa01c069ed47162b350a1f496e9a55f53685189e9c3076a4931334a43719b9a158ec0"
"rlp" : "0xf902c5f901fca0d1b5003dbed66eb89c9b0062798a4fddf737157ef6550187d098d91ae2c3b853a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347942adc25665018aa1fe0e6bc666dac8fc2697ff9baa06a117466ec6b8dbea3a613366a1b468bdeb6282e0156772c81cc2139caa7c88ea076660905a74ef4a24b19295d8740a349b1170d3298118106201d43cd7886afbfa05fa98a3ba1e25059bf41376c6f9a57b500a02c14c6a87afd1665a3906c4afd51b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000001887fffffffffffffff82556d8203e842a00000000000000000000000000000000000000000000000000000000000000000880000000000000000f8c3f8c1800183030d40941baf27b88c48dd02b744999cf3522766929d2b2a80b86000000000000000000000000000000000000000000000000000000000000bc03712fac13c68425054e372b0861af05648614d69d32800fba9ad4522238d4b937a00000000000000000000000000000000000000000000000000000000000000001ca03d55a2ac293c7ad82632b18705e67ad2a0e6177d44f601dca043934c8cd8c07aa01c069ed47162b350a1f496e9a55f53685189e9c3076a4931334a43719b9a158ec0",
}

Contains the block information that is going to be imported into test chain. The key field here is **rlp**. All testers take `rlp` field data and import it on top of genesis that was described in test by **genesisRLP**
Contains the block information that is going to be imported into test chain.
The key field here is **rlp**. All testers take `rlp` field data and import it on
top of genesis that was described in test by **genesisRLP**

Fields "blockHeader`, `transactions`, `uncleHeaders` describe the content of `rlp` for humans to read. it's content **MUST** be equal to `rlp` field binary. All testers use **rlp** field data to import it into the test chain.
Fields `blockHeader`, `transactions`, `uncleHeaders` describe the content of
`rlp` for humans to read. Its content **MUST** be equal to `rlp` field binary.
All testers use **rlp** field data to import it into the test chain.

Fields `chainname`, `blocknumber` are irrelevant for the test client.


* all fields are 0x prefixed HEX
* 0 values are 0x00 rounded
* empty extraData 0x
* transaction creation `to` is ""
* the `transaction`




Valid Blocks with Invalid Transactions
--------------------------------------

::

"transactionSequence" : [
{
"valid" : "false",
"rawBytes" : "0x02f87001018502540be4008502540be40086246139ca800094cc...
"exception" : "TR_NoFunds"
},
{
"valid" : "true",
"rawBytes" : "0x02f87001018502540be4008502540be40086246139ca800094cc...
}
]

Blocks that include invalid transactions have an additional field,
`transactionSequence`. This field is an array of transaction information.
Each entry in the array has two fields:

- `valid`, true for valid transactions (which also appear in the `transactions` field),
false for invalid ones.
- `rawBytes`, the rlp-encoded raw bytes of the transaction

Entries for invalid transactions have this additional field:

- `exception`, for invalid transactions, the name of the exception they create.



Invalid Block Section
Expand Down
10 changes: 6 additions & 4 deletions docs/test_types/TestStructures/GeneralStateTests/post.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ Post Section
::

"post" : {
"Istanbul" : [
"London" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0xe4c855f0d0e96d48d73778772ee570c45acb7c57f87092e08fed6b2205d390f4",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"expectException" : "TR_IntrinsicGas"
}
]
},
Expand All @@ -29,11 +30,12 @@ See transaction section which define transactions by `data`, `gasLimit`, `value`
**Fields**

======================= ===============================================================================
``Istanbul`` fork name as defined by client config (test standard names)
``London`` fork name as defined by client config (test standard names)
``indexes`` define an index of the transaction in txs vector that has been used for this result
``data`` index in transaction data vector
``gas`` index in transaction gas vector
``value`` index in transaction value vector
``hash`` hash of the post state after transaction execution
``logs`` log hash of the transaction logs
======================= ===============================================================================
``expectException`` for a transaction that is supposed to fail, the exception
======================= ===============================================================================

0 comments on commit 5d534e3

Please sign in to comment.