-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e574dce
commit e42232a
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
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,39 @@ | ||
import pytest | ||
|
||
from boa_zksync.compiler_utils import get_compiler_output | ||
|
||
|
||
def test_get_compiler_output(): | ||
|
||
output_dict = { | ||
"blabla": 123, | ||
"zk_version": 456, | ||
"version": 789, | ||
} | ||
|
||
get_compiler_output(output_dict) == 123 | ||
|
||
|
||
def test_get_compiler_output_revert_too_many_keys(): | ||
|
||
output_dict = { | ||
"blabla": 123, | ||
"zk_version": 456, | ||
"version": 789, | ||
"new_compiler_output_key": 101112, | ||
} | ||
|
||
with pytest.raises(ValueError, match="Expected exactly one contract key, found 2"): | ||
get_compiler_output(output_dict) | ||
|
||
|
||
def test_get_compiler_output_revert_unexpected_key(): | ||
|
||
output_dict = { | ||
"blabla": 123, | ||
"zk_versions": 456, | ||
"version": 789, | ||
} | ||
|
||
with pytest.raises(ValueError, match="Expected exactly one contract key, found 2"): | ||
get_compiler_output(output_dict) |