From 5ada6e20b1b8c01c4bca9705348cf9cef9b9f565 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Mon, 8 Apr 2024 13:44:19 +0200 Subject: [PATCH] Added tests --- test/example-abis/mpc_token.abi | Bin 0 -> 3187 bytes .../transaction_and_event_deserialization.abi | Bin 0 -> 2998 bytes test/test_parse_abi.py | 18 ++++++++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 test/example-abis/mpc_token.abi create mode 100644 test/example-abis/transaction_and_event_deserialization.abi create mode 100644 test/test_parse_abi.py diff --git a/test/example-abis/mpc_token.abi b/test/example-abis/mpc_token.abi new file mode 100644 index 0000000000000000000000000000000000000000..f36ad325fbd5f2a8bda02ea30fabb1a052742f5a GIT binary patch literal 3187 zcmb7GVNVl55G_h86>8yXfr3&{6r+gIC`P}vrJ6=a39b5(9D7@OX?xq;ZAtj`If=FRM#S8J7OBb!R47gF%|2>%z)hNR7U)T=R%`!?Y%ZgUETMfk0_ zggUU$bG_@p%3B31g_umAksftc;BhqoD?OoodTn!;dD80vn6g0U1s&?kwG2WZHwcx4 z@P>P2>;W5j9HL4s5gCJ(gSV{fx!kom^Tlf>pq@kF8ENv!VQdRaY4{mjPn;;G_U({b zsfUx4S)USj=u(f5?|{)i(Pu(DtibBxLYTUpapV3;{j~nG(ym{&+Ld4R7C4JM9mL!& z>g|h4t$nH7Ph$Rsw#-<=>o9*H5(-qt$*fIyk0oZ>DZn!m+zzf--&%&}BT+fxQz-90 z_{+nZSxh|ivZ$tzLjbR#UDgNfxshjhAX+dO9{Y|P*g?Pu6pn^OKbU_(2keGAN@7Tb zz^L9iTv<|j!AjwRJ{ZbD)fO#j`-=G-)q^xS0R-uS{u)jJ9iEadCB1V{3@G<^7<7Pn z6vS)7`iBObI$?|%Wh$y5{<^%|8rc2*8N`nJ3;jfbF(U%w;sCs|xbqmnsqJ4=B-ogV zU>OONa7CNY01J-G)0468QwW-HDYmd-X;8WsSQ1%`byEEX+F=W@Q!-n$38BOIX4`Tz z*`#K6L{fa}jEL%272z`#p%b<$^W(U@sz&vek!Ig{4v0JJAO$ZHxnhEM?m}XY$B>bN zVOo`Clv=FlZAdhcQ z^}hoU8!yf9Er-%OG>2S?pF-%MabMgpHsfH$(3R1m z=({JfCNE?7BAH~x?9I!%>*~>)NQ#8_lIk3w>+vjU)X7i>K}{oEe}>|PrK#aX58VI2 CjZ}63 literal 0 HcmV?d00001 diff --git a/test/example-abis/transaction_and_event_deserialization.abi b/test/example-abis/transaction_and_event_deserialization.abi new file mode 100644 index 0000000000000000000000000000000000000000..d274b16a27c784dbbc78e457a38c3940de295943 GIT binary patch literal 2998 zcmb7GS#KLR5T-22x^Ev%oYYBr-|6|Ds7_%Z4@Tr5j|*y-mRPTL1uo@U{qya7Jk~48 zMo|GamUGYWo8er%9>02h-e9b{$LRN4iT({Ha+ZkbQt>3?p_XYvM6eqfF}PkSaY(18 zOcJ4jC0Cl2pw~DD;R0tXUkOtsjAlz0jFllg8WXSJ!l{*sRZY?)6ciKd-0)aNfldQ0 z7luM6Gu?oJ)AK|NMe%)*dOl7Q@(}8RK@vgCt_B@~CS1LutjPE0d`PKqlzf{Ms3q=jp&s*&*mfgXxS9HSI7@GYN;nlEppT3$0Ob9-kh8gl*Paq|3rQf78xf~VF=Q{1 zYtvkSPozT0mRNm{HOj0Bt=49kAPsDE#k5+W*T+1Lr#!r-Z=4T8cg9`#in2CX`;&F1 z#li^=t-;LD0-JRQVwK4{37t?gqi@Ij7RCp>n0t1#Zn=JAG^b=||`eeW;hI zM*&f*^jG6iq(qj%z$i~ZMs$(#N(zPR+4a!QCDk(QmQYt4p3T!&x6N3$#Cm(IUuJ^} z8&=t9pB>cLVVxZ{*m0A6)MAeiUuUcY*Wy(erYi$55D!8_47jDbT091;JD!X1`s`Lx zRS5w^0rfBhH4vWcG)};4PK16#KBzC9^dJ*DxUwWC`2>> zv`$xs8^mA-OT!N`2sj&0VdL1^_#;lI_ZfNSjLZ!GJ}aNVO50koK{)>-r|LXg@O%d8 zZ8&!GJF-HbL#Sm7JweYpi$hmt+j3U+3nTkZEU3vgWR)S=o_7g<3E3w$RDes|>NiS= z-O~B2(HbNaT#?j9?(8d=I()yJDIN(6r2<^Re7dsCz%>tSVWzoQzJ^TK#=WIU;{e&* zHRd;v9c}>6;})C-n%Dr)wB~3NaYf0KJcv}~VD)VUQ@uOvc|CMY`C6^cDG^-{1?va)Z1!9Iq^qiqA$EOFqthJfh?(DUWIfqP@vwbynD ztHfmNS&2R0V=rK|cGsS!-5ONkOeEPVBc`F$-qFC8$;_V}Dt6l7f28v%JRk2^$nyc) z=76t(rQ0OD7YxYDrnxsmPsPrg!d?>bklvD;k{IMb=(GvT%uhg$P+UI|5FrU!g1bauNGD$pOhfl?5M4KYdVI_^o6V^Z0o4U-%bD9+NZdfeXWD^*ttEv>Kb6?e zkn8>~mT|iFSvc(zH{!jKB2L*aCU3teZfU-dZh;K`q75=1o*M?ts`|)c*{hrK<$E!Z qQ> 0 + +@pytest.mark.parametrize('abi_file_path', EXAMPLE_ABIS) +def test_parse_abi(abi_file_path): + with open(abi_file_path, 'rb') as f: + contract_abi = pbcabi.model.FileAbi.read_from(BinaryReader(f.read())) + assert contract_abi is not None