You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,7 @@ Test fixtures for use by clients are available for each release on the [Github r
60
60
- ✨ Add the `eest clean` command that helps delete generated files and directories from the repository ([#980](https://github.com/ethereum/execution-spec-tests/pull/980)).
61
61
- ✨ Add framework changes for EIP-7742, required for Prague devnet-5 ([#931](https://github.com/ethereum/execution-spec-tests/pull/931)).
62
62
- ✨ Add the `eest make env` command that generates a default env file (`env.yaml`)([#996](https://github.com/ethereum/execution-spec-tests/pull/996)).
63
+
- ✨ Generate Transaction Test type ([#933](https://github.com/ethereum/execution-spec-tests/pull/933)).
Copy file name to clipboardExpand all lines: docs/consuming_tests/index.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@
7
7
|[State Tests](./state_test.md)| directly via a `statetest`-like command<br/> (e.g., [go-ethereum/cmd/evm/staterunner.go](https://github.com/ethereum/go-ethereum/blob/509a64ffb9405942396276ae111d06f9bded9221/cmd/evm/staterunner.go#L35)) |`./fixtures/state_tests/`|
8
8
|[Blockchain Tests](./blockchain_test.md)| directly via a `blocktest`-like command<br/> (e.g., [go-ethereum/cmd/evm/blockrunner.go](https://github.com/ethereum/go-ethereum/blob/509a64ffb9405942396276ae111d06f9bded9221/cmd/evm/blockrunner.go#L39)) |`./fixtures/blockchain_tests/`|
9
9
|[Blockchain Engine Tests](./blockchain_test_engine.md)| in the [Hive `pyspec` simulator](https://github.com/ethereum/hive/tree/master/simulators/ethereum/pyspec#readme) via the Engine API and other RPC endpoints |`./fixtures/blockchain_tests_engine/`|
10
+
|[Transaction Tests](./transaction_test.md)| directly via a `t9`-like command<br/> (e.g., [go-ethereum's `evm t9`](https://github.com/ethereum/go-ethereum/tree/67a3b087951a3f3a8e341ae32b6ec18f3553e5cc/cmd/evm#transaction-tool)) |`./fixtures/transaction_tests/`|
10
11
11
12
Here's a top-level comparison of the different methods of consuming tests:
# Transaction Tests <!-- markdownlint-disable MD051 (MD051=link-fragments "Link fragments should be valid") -->
2
+
3
+
The Transaction Test fixture format tests are included in the fixtures subdirectory `transaction_tests`.
4
+
5
+
These are produced by the `TransactionTest` test spec.
6
+
7
+
## Description
8
+
9
+
The transaction test fixture format is used to test client's transaction RLP parsing without executing the transaction on the EVM.
10
+
11
+
It does so by defining a transaction binary RLP representation, and whether the transaction should be accepted or rejected by the client in each fork.
12
+
13
+
A single JSON fixture file is composed of a JSON object where each key-value pair is a different [`Fixture`](#fixture) test object, with the key string representing the test name.
14
+
15
+
The JSON file path plus the test name are used as the unique test identifier.
16
+
17
+
The transaction test fixture format could contain multiple test vectors per test object, each represented by an element in the mapping of lists of the `result` field.
18
+
19
+
However tests generated by the `execution-spec-tests` repository do **not** use this feature, as every single test object contains only a single test vector.
20
+
21
+
## Consumption
22
+
23
+
For each [`Fixture`](#fixture) test object in the JSON fixture file, perform the following steps:
24
+
25
+
1. Obtain the [`txbytes`](#-txbytes-bytes) serialized bytes of the transaction to be parsed.
26
+
2. For each [`Fork`](./common_types.md#fork) key of [`result`](#-result-mappingforkfixtureresult) in the test:
27
+
28
+
1. Assume the fork schedule according to the current [`Fork`](./common_types.md#fork) key.
29
+
2. Using the [`txbytes`](#-txbytes-bytes), attempt to decode the transaction.
30
+
3. If the transaction could not be decoded:
31
+
- If the [`hash`](#-hash-hash-none) field is present, fail the test.
32
+
- Compare the exception thrown with the expected exception contained in the [`exception`](#-exception-transactionexception) field, and fail the test if they do not match.
33
+
- Proceed to the next fork.
34
+
4. If the transaction could be decoded:
35
+
- Compare the calculated hash with the expected hash contained in the [`hash`](#-hash-hash-none) field, and fail the test if they do not match.
36
+
- Compare the calculated intrinsic gas with the expected intrinsic gas contained in the [`intrinsicGas`](#-intrinsicgas-zeropaddedhexnumber) field, and fail the test if they do not match.
37
+
- Compare the calculated sender with the expected sender contained in the [`sender`](#-sender-address) field, and fail the test if they do not match.
0 commit comments