-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Yul generation from solc with new format + simple test
- Loading branch information
Showing
4 changed files
with
89 additions
and
9 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.26; | ||
|
||
contract Curta { | ||
function curtaPlayer() external pure returns (address) { | ||
return 0xA6eb7AcC612ac0De34c7AE4d46523ACD807CF5dB; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import logging | ||
from execution.sol_compilation import SolidityCompilation | ||
|
||
|
||
class TestSolCompilation: | ||
|
||
def test_simple_sol_yul(self): | ||
sol_compilation = SolidityCompilation.from_single_solidity_code("tests/files/simple_sol.sol", None, | ||
solc_executable="./solc-latest") | ||
assert len(sol_compilation) == 1, "It should return just one contract" | ||
contract_name = list(sol_compilation.keys())[0] | ||
contract_info = list(sol_compilation.values())[0] | ||
print(contract_name) | ||
assert contract_name == "tests/files/simple_sol.sol:Curta", \ | ||
f"Expected name: tests/files/simple_sol.sol:Curta. Current name: {contract_name}" | ||
assert isinstance(contract_info, dict), "Expected type of value: dict" |