Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
rv-jenkins committed Sep 9, 2024
2 parents cf2eb6d + 58819e1 commit 341f562
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/kontrol/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ def foundry_toml_extra_contents() -> str:
"""


def foundry_toml_cancun_schedule() -> str:
return """
evm_version = "cancun"
"""


def _rv_yellow() -> str:
return '#ffcc07'

Expand Down
1 change: 1 addition & 0 deletions src/tests/integration/test-data/end-to-end-prove-all
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CounterTest.test_Increment()
TransientStorageTest.testTransientStoreLoad(uint256,uint256)
UnitTest.test_assertEq_address_err()
UnitTest.test_assertEq_bool_err()
UnitTest.test_assertEq_bytes32_err()
Expand Down
22 changes: 22 additions & 0 deletions src/tests/integration/test-data/src/TransientStorage.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

import "forge-std/Test.sol";

contract TransientStorageTest is Test {
function testTransientStoreLoad(uint256 key, uint256 value) public {
// Store `value` at `key` in transient storage
assembly {
tstore(key, value)
}

uint256 loadedValue;

// Load `value` from `key` in transient storage
assembly {
loadedValue := tload(key)
}

assertEq(loadedValue, value, "TLOAD did not return the correct value");
}
}
3 changes: 3 additions & 0 deletions src/tests/integration/test_kontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from kontrol.kompile import foundry_kompile
from kontrol.options import BuildOptions, ProveOptions
from kontrol.prove import foundry_prove
from kontrol.utils import append_to_file, foundry_toml_cancun_schedule

from .utils import TEST_DATA_DIR, assert_pass

Expand Down Expand Up @@ -59,6 +60,7 @@ def foundry_end_to_end(foundry_root_dir: Path | None, tmp_path_factory: TempPath
if not foundry_root.is_dir():
init_project(project_root=foundry_root, skip_forge=False)
copy_tree(str(TEST_DATA_DIR / 'src'), str(foundry_root / 'test'))
append_to_file(foundry_root / 'foundry.toml', foundry_toml_cancun_schedule())

foundry_kompile(
BuildOptions(
Expand Down Expand Up @@ -112,6 +114,7 @@ def test_kontrol_end_to_end(
'usegas': False,
'port': server_end_to_end.port,
'force_sequential': force_sequential,
'schedule': 'CANCUN',
}
),
)
Expand Down

0 comments on commit 341f562

Please sign in to comment.