Skip to content

Commit

Permalink
Update: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
replikeit committed Oct 22, 2024
1 parent 88f8255 commit 83ca64c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyrevm"
version = "0.3.3"
version = "0.3.4"
edition = "2021"

[lib]
Expand Down
14 changes: 11 additions & 3 deletions tests/test_evm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

# use your own key during development to avoid rate limiting the CI job
fork_url = (
os.getenv("FORK_URL")
or "https://mainnet.infura.io/v3/c60b0bb42f8a4c6481ecd229eddaca27"
os.getenv("FORK_URL")
or "https://mainnet.infura.io/v3/c60b0bb42f8a4c6481ecd229eddaca27"
)

KWARG_CASES = [
Expand Down Expand Up @@ -60,6 +60,14 @@ def test_fork_storage():
assert value > 0


def test_set_into_storage():
weth = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
evm = EVM(fork_url=fork_url, fork_block="latest")
evm.insert_account_storage(weth, 0, 10)
value = evm.storage(weth, 0)
assert value == 10


def test_deploy():
evm = EVM()

Expand Down Expand Up @@ -265,7 +273,7 @@ def test_tx_setters():

@pytest.mark.parametrize(
"excess_blob_gas,expected_fee",
[(0, 1), (10**3, 1), (2**24, 152), (2**26, 537070730)],
[(0, 1), (10 ** 3, 1), (2 ** 24, 152), (2 ** 26, 537070730)],
)
def test_get_blobbasefee(excess_blob_gas, expected_fee):
evm = EVM()
Expand Down

0 comments on commit 83ca64c

Please sign in to comment.