test_precompiles()
¶
Documentation for tests/frontier/precompiles/test_precompiles.py::test_precompiles@14a7429a
.
Generate fixtures for these test cases for Prague with:
fill -v tests/frontier/precompiles/test_precompiles.py::test_precompiles --fork Prague
Tests the behavior of precompiled contracts in the Ethereum state test.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state_test |
StateTestFiller
|
The state test filler object used to run the test. |
required |
address |
str
|
The address of the precompiled contract to test. |
required |
precompile_exists |
bool
|
A flag indicating whether the precompiled contract exists at the given address. |
required |
pre |
Alloc
|
The allocation object used to deploy the contract and set up the initial state. |
required |
This test deploys a contract that performs two CALL operations to the specified address and a fixed address (0x10000), measuring the gas used for each call. It then stores the difference in gas usage in storage slot 0. The test verifies the expected storage value based on whether the precompiled contract exists at the given address.
Source code in tests/frontier/precompiles/test_precompiles.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|
Parametrized Test Cases¶
The interactive table below is also available as a standalone page.
Test ID (Abbreviated) | address | precompile_exists |
---|---|---|
...fork_Berlin-address_0x1-precompile_exists_True-state_test | 0x1 | True |
...fork_Berlin-address_0x1-precompile_exists_True-blockchain_test_from_state_test | 0x1 | True |
...fork_Berlin-address_0x2-precompile_exists_True-state_test | 0x2 | True |
...fork_Berlin-address_0x2-precompile_exists_True-blockchain_test_from_state_test | 0x2 | True |
...fork_Berlin-address_0x3-precompile_exists_True-state_test | 0x3 | True |
...fork_Berlin-address_0x3-precompile_exists_True-blockchain_test_from_state_test | 0x3 | True |
...fork_Berlin-address_0x4-precompile_exists_True-state_test | 0x4 | True |
...fork_Berlin-address_0x4-precompile_exists_True-blockchain_test_from_state_test | 0x4 | True |
...fork_Berlin-address_0x5-precompile_exists_True-state_test | 0x5 | True |
...fork_Berlin-address_0x5-precompile_exists_True-blockchain_test_from_state_test | 0x5 | True |
...fork_Berlin-address_0x6-precompile_exists_True-state_test | 0x6 | True |
...fork_Berlin-address_0x6-precompile_exists_True-blockchain_test_from_state_test | 0x6 | True |
...fork_Berlin-address_0x7-precompile_exists_True-state_test | 0x7 | True |
...fork_Berlin-address_0x7-precompile_exists_True-blockchain_test_from_state_test | 0x7 | True |
...fork_Berlin-address_0x8-precompile_exists_True-state_test | 0x8 | True |
...fork_Berlin-address_0x8-precompile_exists_True-blockchain_test_from_state_test | 0x8 | True |
...fork_Berlin-address_0x9-precompile_exists_True-state_test | 0x9 | True |
...fork_Berlin-address_0x9-precompile_exists_True-blockchain_test_from_state_test | 0x9 | True |
...fork_Berlin-address_0xa-precompile_exists_False-state_test | 0xa | False |
...fork_Berlin-address_0xa-precompile_exists_False-blockchain_test_from_state_test | 0xa | False |
...fork_London-address_0x1-precompile_exists_True-state_test | 0x1 | True |
...fork_London-address_0x1-precompile_exists_True-blockchain_test_from_state_test | 0x1 | True |
...fork_London-address_0x2-precompile_exists_True-state_test | 0x2 | True |
...fork_London-address_0x2-precompile_exists_True-blockchain_test_from_state_test | 0x2 | True |
...fork_London-address_0x3-precompile_exists_True-state_test | 0x3 | True |
...fork_London-address_0x3-precompile_exists_True-blockchain_test_from_state_test | 0x3 | True |
...fork_London-address_0x4-precompile_exists_True-state_test | 0x4 | True |
...fork_London-address_0x4-precompile_exists_True-blockchain_test_from_state_test | 0x4 | True |
...fork_London-address_0x5-precompile_exists_True-state_test | 0x5 | True |
...fork_London-address_0x5-precompile_exists_True-blockchain_test_from_state_test | 0x5 | True |
...fork_London-address_0x6-precompile_exists_True-state_test | 0x6 | True |
...fork_London-address_0x6-precompile_exists_True-blockchain_test_from_state_test | 0x6 | True |
...fork_London-address_0x7-precompile_exists_True-state_test | 0x7 | True |
...fork_London-address_0x7-precompile_exists_True-blockchain_test_from_state_test | 0x7 | True |
...fork_London-address_0x8-precompile_exists_True-state_test | 0x8 | True |
...fork_London-address_0x8-precompile_exists_True-blockchain_test_from_state_test | 0x8 | True |
...fork_London-address_0x9-precompile_exists_True-state_test | 0x9 | True |
...fork_London-address_0x9-precompile_exists_True-blockchain_test_from_state_test | 0x9 | True |
...fork_London-address_0xa-precompile_exists_False-state_test | 0xa | False |
...fork_London-address_0xa-precompile_exists_False-blockchain_test_from_state_test | 0xa | False |
...fork_Paris-address_0x1-precompile_exists_True-state_test | 0x1 | True |
...fork_Paris-address_0x1-precompile_exists_True-blockchain_test_from_state_test | 0x1 | True |
...fork_Paris-address_0x2-precompile_exists_True-state_test | 0x2 | True |
...fork_Paris-address_0x2-precompile_exists_True-blockchain_test_from_state_test | 0x2 | True |
...fork_Paris-address_0x3-precompile_exists_True-state_test | 0x3 | True |
...fork_Paris-address_0x3-precompile_exists_True-blockchain_test_from_state_test | 0x3 | True |
...fork_Paris-address_0x4-precompile_exists_True-state_test | 0x4 | True |
...fork_Paris-address_0x4-precompile_exists_True-blockchain_test_from_state_test | 0x4 | True |
...fork_Paris-address_0x5-precompile_exists_True-state_test | 0x5 | True |
...fork_Paris-address_0x5-precompile_exists_True-blockchain_test_from_state_test | 0x5 | True |
...fork_Paris-address_0x6-precompile_exists_True-state_test | 0x6 | True |
...fork_Paris-address_0x6-precompile_exists_True-blockchain_test_from_state_test | 0x6 | True |
...fork_Paris-address_0x7-precompile_exists_True-state_test | 0x7 | True |
...fork_Paris-address_0x7-precompile_exists_True-blockchain_test_from_state_test | 0x7 | True |
...fork_Paris-address_0x8-precompile_exists_True-state_test | 0x8 | True |
...fork_Paris-address_0x8-precompile_exists_True-blockchain_test_from_state_test | 0x8 | True |
...fork_Paris-address_0x9-precompile_exists_True-state_test | 0x9 | True |
...fork_Paris-address_0x9-precompile_exists_True-blockchain_test_from_state_test | 0x9 | True |
...fork_Paris-address_0xa-precompile_exists_False-state_test | 0xa | False |
...fork_Paris-address_0xa-precompile_exists_False-blockchain_test_from_state_test | 0xa | False |
...fork_Shanghai-address_0x1-precompile_exists_True-state_test | 0x1 | True |
...fork_Shanghai-address_0x1-precompile_exists_True-blockchain_test_from_state_test | 0x1 | True |
...fork_Shanghai-address_0x2-precompile_exists_True-state_test | 0x2 | True |
...fork_Shanghai-address_0x2-precompile_exists_True-blockchain_test_from_state_test | 0x2 | True |
...fork_Shanghai-address_0x3-precompile_exists_True-state_test | 0x3 | True |
...fork_Shanghai-address_0x3-precompile_exists_True-blockchain_test_from_state_test | 0x3 | True |
...fork_Shanghai-address_0x4-precompile_exists_True-state_test | 0x4 | True |
...fork_Shanghai-address_0x4-precompile_exists_True-blockchain_test_from_state_test | 0x4 | True |
...fork_Shanghai-address_0x5-precompile_exists_True-state_test | 0x5 | True |
...fork_Shanghai-address_0x5-precompile_exists_True-blockchain_test_from_state_test | 0x5 | True |
...fork_Shanghai-address_0x6-precompile_exists_True-state_test | 0x6 | True |
...fork_Shanghai-address_0x6-precompile_exists_True-blockchain_test_from_state_test | 0x6 | True |
...fork_Shanghai-address_0x7-precompile_exists_True-state_test | 0x7 | True |
...fork_Shanghai-address_0x7-precompile_exists_True-blockchain_test_from_state_test | 0x7 | True |
...fork_Shanghai-address_0x8-precompile_exists_True-state_test | 0x8 | True |
...fork_Shanghai-address_0x8-precompile_exists_True-blockchain_test_from_state_test | 0x8 | True |
...fork_Shanghai-address_0x9-precompile_exists_True-state_test | 0x9 | True |
...fork_Shanghai-address_0x9-precompile_exists_True-blockchain_test_from_state_test | 0x9 | True |
...fork_Shanghai-address_0xa-precompile_exists_False-state_test | 0xa | False |
...fork_Shanghai-address_0xa-precompile_exists_False-blockchain_test_from_state_test | 0xa | False |
...fork_Cancun-address_0x1-precompile_exists_True-state_test | 0x1 | True |
...fork_Cancun-address_0x1-precompile_exists_True-blockchain_test_from_state_test | 0x1 | True |
...fork_Cancun-address_0x2-precompile_exists_True-state_test | 0x2 | True |
...fork_Cancun-address_0x2-precompile_exists_True-blockchain_test_from_state_test | 0x2 | True |
...fork_Cancun-address_0x3-precompile_exists_True-state_test | 0x3 | True |
...fork_Cancun-address_0x3-precompile_exists_True-blockchain_test_from_state_test | 0x3 | True |
...fork_Cancun-address_0x4-precompile_exists_True-state_test | 0x4 | True |
...fork_Cancun-address_0x4-precompile_exists_True-blockchain_test_from_state_test | 0x4 | True |
...fork_Cancun-address_0x5-precompile_exists_True-state_test | 0x5 | True |
...fork_Cancun-address_0x5-precompile_exists_True-blockchain_test_from_state_test | 0x5 | True |
...fork_Cancun-address_0x6-precompile_exists_True-state_test | 0x6 | True |
...fork_Cancun-address_0x6-precompile_exists_True-blockchain_test_from_state_test | 0x6 | True |
...fork_Cancun-address_0x7-precompile_exists_True-state_test | 0x7 | True |
...fork_Cancun-address_0x7-precompile_exists_True-blockchain_test_from_state_test | 0x7 | True |
...fork_Cancun-address_0x8-precompile_exists_True-state_test | 0x8 | True |
...fork_Cancun-address_0x8-precompile_exists_True-blockchain_test_from_state_test | 0x8 | True |
...fork_Cancun-address_0x9-precompile_exists_True-state_test | 0x9 | True |
...fork_Cancun-address_0x9-precompile_exists_True-blockchain_test_from_state_test | 0x9 | True |
...fork_Cancun-address_0xa-precompile_exists_True-state_test | 0xa | True |
...fork_Cancun-address_0xa-precompile_exists_True-blockchain_test_from_state_test | 0xa | True |
...fork_Cancun-address_0xb-precompile_exists_False-state_test | 0xb | False |
...fork_Cancun-address_0xb-precompile_exists_False-blockchain_test_from_state_test | 0xb | False |
...fork_Prague-address_0x1-precompile_exists_True-state_test | 0x1 | True |
...fork_Prague-address_0x1-precompile_exists_True-blockchain_test_from_state_test | 0x1 | True |
...fork_Prague-address_0x2-precompile_exists_True-state_test | 0x2 | True |
...fork_Prague-address_0x2-precompile_exists_True-blockchain_test_from_state_test | 0x2 | True |
...fork_Prague-address_0x3-precompile_exists_True-state_test | 0x3 | True |
...fork_Prague-address_0x3-precompile_exists_True-blockchain_test_from_state_test | 0x3 | True |
...fork_Prague-address_0x4-precompile_exists_True-state_test | 0x4 | True |
...fork_Prague-address_0x4-precompile_exists_True-blockchain_test_from_state_test | 0x4 | True |
...fork_Prague-address_0x5-precompile_exists_True-state_test | 0x5 | True |
...fork_Prague-address_0x5-precompile_exists_True-blockchain_test_from_state_test | 0x5 | True |
...fork_Prague-address_0x6-precompile_exists_True-state_test | 0x6 | True |
...fork_Prague-address_0x6-precompile_exists_True-blockchain_test_from_state_test | 0x6 | True |
...fork_Prague-address_0x7-precompile_exists_True-state_test | 0x7 | True |
...fork_Prague-address_0x7-precompile_exists_True-blockchain_test_from_state_test | 0x7 | True |
...fork_Prague-address_0x8-precompile_exists_True-state_test | 0x8 | True |
...fork_Prague-address_0x8-precompile_exists_True-blockchain_test_from_state_test | 0x8 | True |
...fork_Prague-address_0x9-precompile_exists_True-state_test | 0x9 | True |
...fork_Prague-address_0x9-precompile_exists_True-blockchain_test_from_state_test | 0x9 | True |
...fork_Prague-address_0xa-precompile_exists_True-state_test | 0xa | True |
...fork_Prague-address_0xa-precompile_exists_True-blockchain_test_from_state_test | 0xa | True |
...fork_Prague-address_0xb-precompile_exists_True-state_test | 0xb | True |
...fork_Prague-address_0xb-precompile_exists_True-blockchain_test_from_state_test | 0xb | True |
...fork_Prague-address_0xc-precompile_exists_True-state_test | 0xc | True |
...fork_Prague-address_0xc-precompile_exists_True-blockchain_test_from_state_test | 0xc | True |
...fork_Prague-address_0xd-precompile_exists_True-state_test | 0xd | True |
...fork_Prague-address_0xd-precompile_exists_True-blockchain_test_from_state_test | 0xd | True |
...fork_Prague-address_0xe-precompile_exists_True-state_test | 0xe | True |
...fork_Prague-address_0xe-precompile_exists_True-blockchain_test_from_state_test | 0xe | True |
...fork_Prague-address_0xf-precompile_exists_True-state_test | 0xf | True |
...fork_Prague-address_0xf-precompile_exists_True-blockchain_test_from_state_test | 0xf | True |
...fork_Prague-address_0x10-precompile_exists_True-state_test | 0x10 | True |
...fork_Prague-address_0x10-precompile_exists_True-blockchain_test_from_state_test | 0x10 | True |
...fork_Prague-address_0x11-precompile_exists_True-state_test | 0x11 | True |
...fork_Prague-address_0x11-precompile_exists_True-blockchain_test_from_state_test | 0x11 | True |
...fork_Prague-address_0x12-precompile_exists_False-state_test | 0x12 | False |
...fork_Prague-address_0x12-precompile_exists_False-blockchain_test_from_state_test | 0x12 | False |
...fork_Osaka-address_0x1-precompile_exists_True-state_test | 0x1 | True |
...fork_Osaka-address_0x1-precompile_exists_True-blockchain_test_from_state_test | 0x1 | True |
...fork_Osaka-address_0x2-precompile_exists_True-state_test | 0x2 | True |
...fork_Osaka-address_0x2-precompile_exists_True-blockchain_test_from_state_test | 0x2 | True |
...fork_Osaka-address_0x3-precompile_exists_True-state_test | 0x3 | True |
...fork_Osaka-address_0x3-precompile_exists_True-blockchain_test_from_state_test | 0x3 | True |
...fork_Osaka-address_0x4-precompile_exists_True-state_test | 0x4 | True |
...fork_Osaka-address_0x4-precompile_exists_True-blockchain_test_from_state_test | 0x4 | True |
...fork_Osaka-address_0x5-precompile_exists_True-state_test | 0x5 | True |
...fork_Osaka-address_0x5-precompile_exists_True-blockchain_test_from_state_test | 0x5 | True |
...fork_Osaka-address_0x6-precompile_exists_True-state_test | 0x6 | True |
...fork_Osaka-address_0x6-precompile_exists_True-blockchain_test_from_state_test | 0x6 | True |
...fork_Osaka-address_0x7-precompile_exists_True-state_test | 0x7 | True |
...fork_Osaka-address_0x7-precompile_exists_True-blockchain_test_from_state_test | 0x7 | True |
...fork_Osaka-address_0x8-precompile_exists_True-state_test | 0x8 | True |
...fork_Osaka-address_0x8-precompile_exists_True-blockchain_test_from_state_test | 0x8 | True |
...fork_Osaka-address_0x9-precompile_exists_True-state_test | 0x9 | True |
...fork_Osaka-address_0x9-precompile_exists_True-blockchain_test_from_state_test | 0x9 | True |
...fork_Osaka-address_0xa-precompile_exists_True-state_test | 0xa | True |
...fork_Osaka-address_0xa-precompile_exists_True-blockchain_test_from_state_test | 0xa | True |
...fork_Osaka-address_0xb-precompile_exists_True-state_test | 0xb | True |
...fork_Osaka-address_0xb-precompile_exists_True-blockchain_test_from_state_test | 0xb | True |
...fork_Osaka-address_0xc-precompile_exists_True-state_test | 0xc | True |
...fork_Osaka-address_0xc-precompile_exists_True-blockchain_test_from_state_test | 0xc | True |
...fork_Osaka-address_0xd-precompile_exists_True-state_test | 0xd | True |
...fork_Osaka-address_0xd-precompile_exists_True-blockchain_test_from_state_test | 0xd | True |
...fork_Osaka-address_0xe-precompile_exists_True-state_test | 0xe | True |
...fork_Osaka-address_0xe-precompile_exists_True-blockchain_test_from_state_test | 0xe | True |
...fork_Osaka-address_0xf-precompile_exists_True-state_test | 0xf | True |
...fork_Osaka-address_0xf-precompile_exists_True-blockchain_test_from_state_test | 0xf | True |
...fork_Osaka-address_0x10-precompile_exists_True-state_test | 0x10 | True |
...fork_Osaka-address_0x10-precompile_exists_True-blockchain_test_from_state_test | 0x10 | True |
...fork_Osaka-address_0x11-precompile_exists_True-state_test | 0x11 | True |
...fork_Osaka-address_0x11-precompile_exists_True-blockchain_test_from_state_test | 0x11 | True |
...fork_Osaka-address_0x12-precompile_exists_False-state_test | 0x12 | False |
...fork_Osaka-address_0x12-precompile_exists_False-blockchain_test_from_state_test | 0x12 | False |