@@ -86,6 +86,7 @@ class ABISubroutineTC:
8686 arg_instances : list [pt .Expr | pt .abi .BaseType ]
8787 name : str
8888 ret_type : str | pt .abi .TypeSpec
89+ signature : str
8990
9091
9192def test_abi_subroutine_definition ():
@@ -130,13 +131,27 @@ def fn_2arg_1ret_with_expr(
130131 return output .set (b [a % pt .Int (10 )])
131132
132133 cases = (
133- ABISubroutineTC (fn_0arg_0ret , [], "fn_0arg_0ret" , "void" ),
134+ ABISubroutineTC (fn_0arg_0ret , [], "fn_0arg_0ret" , "void" , "fn_0arg_0ret()void" ),
134135 ABISubroutineTC (
135- fn_0arg_uint64_ret , [], "fn_0arg_uint64_ret" , pt .abi .Uint64TypeSpec ()
136+ fn_0arg_uint64_ret ,
137+ [],
138+ "fn_0arg_uint64_ret" ,
139+ pt .abi .Uint64TypeSpec (),
140+ "fn_0arg_uint64_ret()uint64" ,
136141 ),
137- ABISubroutineTC (fn_1arg_0ret , [pt .abi .Uint64 ()], "fn_1arg_0ret" , "void" ),
138142 ABISubroutineTC (
139- fn_1arg_1ret , [pt .abi .Uint64 ()], "fn_1arg_1ret" , pt .abi .Uint64TypeSpec ()
143+ fn_1arg_0ret ,
144+ [pt .abi .Uint64 ()],
145+ "fn_1arg_0ret" ,
146+ "void" ,
147+ "fn_1arg_0ret(uint64)void" ,
148+ ),
149+ ABISubroutineTC (
150+ fn_1arg_1ret ,
151+ [pt .abi .Uint64 ()],
152+ "fn_1arg_1ret" ,
153+ pt .abi .Uint64TypeSpec (),
154+ "fn_1arg_1ret(uint64)uint64" ,
140155 ),
141156 ABISubroutineTC (
142157 fn_2arg_0ret ,
@@ -148,6 +163,7 @@ def fn_2arg_1ret_with_expr(
148163 ],
149164 "fn_2arg_0ret" ,
150165 "void" ,
166+ "fn_2arg_0ret(uint64,byte[10])void" ,
151167 ),
152168 ABISubroutineTC (
153169 fn_2arg_1ret ,
@@ -159,6 +175,7 @@ def fn_2arg_1ret_with_expr(
159175 ],
160176 "fn_2arg_1ret" ,
161177 pt .abi .ByteTypeSpec (),
178+ "fn_2arg_1ret(uint64,byte[10])byte" ,
162179 ),
163180 ABISubroutineTC (
164181 fn_2arg_1ret_with_expr ,
@@ -170,6 +187,7 @@ def fn_2arg_1ret_with_expr(
170187 ],
171188 "fn_2arg_1ret_with_expr" ,
172189 pt .abi .ByteTypeSpec (),
190+ None ,
173191 ),
174192 )
175193
@@ -193,6 +211,12 @@ def fn_2arg_1ret_with_expr(
193211 map (lambda x : isinstance (x , pt .abi .BaseType ), case .arg_instances )
194212 )
195213
214+ if case .definition .is_registrable ():
215+ assert case .definition .method_signature () == case .signature
216+ else :
217+ with pytest .raises (pt .TealInputError ):
218+ case .definition .method_signature ()
219+
196220
197221def test_subroutine_definition_validate ():
198222 """
0 commit comments