File tree Expand file tree Collapse file tree 2 files changed +39
-2
lines changed
Expand file tree Collapse file tree 2 files changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ def test_abi_parse(contract_name):
3535 assert isinstance (parsed_abi , Abi )
3636
3737
38- def test_bounded_int_parse ():
38+ def test_bounded_int_parse_pre_2_8_0 ():
3939 abi_list = [
4040 {
4141 "type" : "struct" ,
@@ -70,3 +70,40 @@ def test_bounded_int_parse():
7070 UintType , parsed_abi .defined_structures ["core::circuit::u384" ].types ["limb0" ]
7171 )
7272 assert uint .bits == 96
73+
74+
75+ def test_bounded_int_parse_post_2_8_0 ():
76+ abi_list = [
77+ {
78+ "type" : "struct" ,
79+ "name" : "core::circuit::u384" ,
80+ "members" : [
81+ {
82+ "name" : "limb0" ,
83+ "type" : "core::internal::bounded_int::BoundedInt::<0, 79228162514264337593543950335>" ,
84+ },
85+ {
86+ "name" : "limb1" ,
87+ "type" : "core::internal::bounded_int::BoundedInt::<0, 79228162514264337593543950335>" ,
88+ },
89+ {
90+ "name" : "limb2" ,
91+ "type" : "core::internal::bounded_int::BoundedInt::<0, 79228162514264337593543950335>" ,
92+ },
93+ {
94+ "name" : "limb3" ,
95+ "type" : "core::internal::bounded_int::BoundedInt::<0, 79228162514264337593543950335>" ,
96+ },
97+ ],
98+ }
99+ ]
100+
101+ parser = AbiParser (abi_list )
102+ parsed_abi = parser .parse ()
103+
104+ assert isinstance (parsed_abi , Abi )
105+
106+ uint = cast (
107+ UintType , parsed_abi .defined_structures ["core::circuit::u384" ].types ["limb0" ]
108+ )
109+ assert uint .bits == 96
Original file line number Diff line number Diff line change 4242 type_bytes: "core::bytes_31::bytes31"
4343 type_bool: "core::bool"
4444 type_uint: "core::integer::u" INT
45- type_bounded_int: "core::internal::BoundedInt::<" INT "," WS? INT ">"
45+ type_bounded_int: "core::internal::BoundedInt::<" INT "," WS? INT ">" | "core::internal::bounded_int::BoundedInt::<" INT "," WS? INT ">"
4646 type_contract_address: "core::starknet::contract_address::ContractAddress"
4747 type_class_hash: "core::starknet::class_hash::ClassHash"
4848 type_storage_address: "core::starknet::storage_access::StorageAddress"
You can’t perform that action at this time.
0 commit comments