diff --git a/src/bin_client/test/contracts/macro_annotations.tz b/src/bin_client/test/contracts_macros/macro_annotations.tz similarity index 100% rename from src/bin_client/test/contracts/macro_annotations.tz rename to src/bin_client/test/contracts_macros/macro_annotations.tz diff --git a/src/bin_client/test/contracts/map_caddaadr.tz b/src/bin_client/test/contracts_macros/map_caddaadr.tz similarity index 100% rename from src/bin_client/test/contracts/map_caddaadr.tz rename to src/bin_client/test/contracts_macros/map_caddaadr.tz diff --git a/src/bin_client/test/contracts/max_in_list.tz b/src/bin_client/test/contracts_macros/max_in_list.tz similarity index 100% rename from src/bin_client/test/contracts/max_in_list.tz rename to src/bin_client/test/contracts_macros/max_in_list.tz diff --git a/src/bin_client/test/contracts/min.tz b/src/bin_client/test/contracts_macros/min.tz similarity index 100% rename from src/bin_client/test/contracts/min.tz rename to src/bin_client/test/contracts_macros/min.tz diff --git a/src/bin_client/test/contracts/pair_macro.tz b/src/bin_client/test/contracts_macros/pair_macro.tz similarity index 100% rename from src/bin_client/test/contracts/pair_macro.tz rename to src/bin_client/test/contracts_macros/pair_macro.tz diff --git a/src/bin_client/test/contracts/set_caddaadr.tz b/src/bin_client/test/contracts_macros/set_caddaadr.tz similarity index 100% rename from src/bin_client/test/contracts/set_caddaadr.tz rename to src/bin_client/test/contracts_macros/set_caddaadr.tz diff --git a/src/bin_client/test/contracts/take_my_money.tz b/src/bin_client/test/contracts_macros/take_my_money.tz similarity index 100% rename from src/bin_client/test/contracts/take_my_money.tz rename to src/bin_client/test/contracts_macros/take_my_money.tz diff --git a/src/bin_client/test/contracts/unpair_macro.tz b/src/bin_client/test/contracts_macros/unpair_macro.tz similarity index 100% rename from src/bin_client/test/contracts/unpair_macro.tz rename to src/bin_client/test/contracts_macros/unpair_macro.tz diff --git a/src/bin_client/test/test_contracts.sh b/src/bin_client/test/test_contracts.sh index 5840483a3..c48bfbb95 100755 --- a/src/bin_client/test/test_contracts.sh +++ b/src/bin_client/test/test_contracts.sh @@ -31,29 +31,12 @@ if [ ! $NO_TYPECHECK ] ; then fi -# Build list -#assert_storage $contract_dir/build_list.tz '{}' 0 "{ 0 }" -#assert_storage $contract_dir/build_list.tz '{}' 3 "{ 0 ; 1 ; 2 ; 3 }" -#assert_storage $contract_dir/build_list.tz '{}' 10 \ -# "{ 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 ; 10 }" - # Concatenate all strings of a list into one string #assert_storage $contract_dir/concat_list.tz '""' '{ "a" ; "b" ; "c" }' '"abc"' #assert_storage $contract_dir/concat_list.tz '""' '{}' '""' #assert_storage $contract_dir/concat_list.tz \ # '""' '{ "Hello" ; " " ; "World" ; "!" }' '"Hello World!"' -# Find maximum int in list -- returns None if not found -assert_storage $contract_dir/max_in_list.tz None '{}' 'None' -assert_storage $contract_dir/max_in_list.tz None '{ 1 }' '(Some 1)' -assert_storage $contract_dir/max_in_list.tz None '{ -1 }' '(Some -1)' -assert_storage $contract_dir/max_in_list.tz None \ - '{ 10 ; -1 ; -20 ; 100 ; 0 }' '(Some 100)' -assert_storage $contract_dir/max_in_list.tz None \ - '{ 10 ; -1 ; -20 ; 100 ; 0 }' '(Some 100)' -assert_storage $contract_dir/max_in_list.tz None \ - '{ -10 ; -1 ; -20 ; -100 }' '(Some -1)' - # Typing gas bounds checks assert_fails $client originate contract first_explosion for bootstrap1 \ @@ -68,77 +51,6 @@ assert_fails $client run script '{parameter (list int);storage (list (list (lis on storage '{}' \ and input '{1;2;3;4;5;6;7;8;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1}' -# Test comparisons on tez { EQ ; GT ; LT ; GE ; LE } -#assert_storage $contract_dir/compare.tz '{}' '(Pair 1000000 2000000)' '{ False ; False ; True ; False ; True }' -#assert_storage $contract_dir/compare.tz '{}' '(Pair 2000000 1000000)' '{ False ; True ; False ; True ; False }' -#assert_storage $contract_dir/compare.tz '{}' '(Pair 2370000 2370000)' '{ True ; False ; False ; True ; True }' - -# Test ASSERT -#assert_storage $contract_dir/assert.tz Unit True Unit -#assert_fails $client run script $contract_dir/assert.tz on storage Unit and input False - -# COMPARE; ASSERT_ -#assert_storage $contract_dir/assert_eq.tz Unit '(Pair -1 -1)' Unit -#assert_fails $client run script $contract_dir/assert_eq.tz on storage Unit and input '(Pair 0 -1)' - -#assert_storage $contract_dir/assert_eq.tz Unit '(Pair -1 -1)' Unit -#assert_fails $client run script $contract_dir/assert_eq.tz on storage Unit and input '(Pair 0 -1)' - -#assert_storage $contract_dir/assert_neq.tz Unit '(Pair 0 -1)' Unit -#assert_fails $client run script $contract_dir/assert_neq.tz on storage Unit and input '(Pair -1 -1)' - -#assert_storage $contract_dir/assert_lt.tz Unit '(Pair -1 0)' Unit -#assert_fails $client run script $contract_dir/assert_lt.tz on storage Unit and input '(Pair 0 -1)' -#assert_fails $client run script $contract_dir/assert_lt.tz on storage Unit and input '(Pair 0 0)' - -#assert_storage $contract_dir/assert_le.tz Unit '(Pair 0 0)' Unit -#assert_storage $contract_dir/assert_le.tz Unit '(Pair -1 0)' Unit -#assert_fails $client run script $contract_dir/assert_le.tz on storage Unit and input '(Pair 0 -1)' - -#assert_storage $contract_dir/assert_gt.tz Unit '(Pair 0 -1)' Unit -#assert_fails $client run script $contract_dir/assert_gt.tz on storage Unit and input '(Pair -1 0)' -#assert_fails $client run script $contract_dir/assert_gt.tz on storage Unit and input '(Pair 0 0)' - -#assert_storage $contract_dir/assert_ge.tz Unit '(Pair 0 0)' Unit -#assert_storage $contract_dir/assert_ge.tz Unit '(Pair 0 -1)' Unit -#assert_fails $client run script $contract_dir/assert_ge.tz on storage Unit and input '(Pair -1 0)' - -# ASSERT_CMP -#assert_storage $contract_dir/assert_cmpeq.tz Unit '(Pair -1 -1)' Unit -#assert_fails $client run script $contract_dir/assert_cmpeq.tz on storage Unit and input '(Pair 0 -1)' - -#assert_storage $contract_dir/assert_cmpeq.tz Unit '(Pair -1 -1)' Unit -#assert_fails $client run script $contract_dir/assert_cmpeq.tz on storage Unit and input '(Pair 0 -1)' - -#assert_storage $contract_dir/assert_cmpneq.tz Unit '(Pair 0 -1)' Unit -#assert_fails $client run script $contract_dir/assert_cmpneq.tz on storage Unit and input '(Pair -1 -1)' - -#assert_storage $contract_dir/assert_cmplt.tz Unit '(Pair -1 0)' Unit -#assert_fails $client run script $contract_dir/assert_cmplt.tz on storage Unit and input '(Pair 0 -1)' -#assert_fails $client run script $contract_dir/assert_cmplt.tz on storage Unit and input '(Pair 0 0)' - -#assert_storage $contract_dir/assert_cmple.tz Unit '(Pair 0 0)' Unit -#assert_storage $contract_dir/assert_cmple.tz Unit '(Pair -1 0)' Unit -#assert_fails $client run script $contract_dir/assert_cmple.tz on storage Unit and input '(Pair 0 -1)' - -#assert_storage $contract_dir/assert_cmpgt.tz Unit '(Pair 0 -1)' Unit -#assert_fails $client run script $contract_dir/assert_cmpgt.tz on storage Unit and input '(Pair -1 0)' -#assert_fails $client run script $contract_dir/assert_cmpgt.tz on storage Unit and input '(Pair 0 0)' - -#assert_storage $contract_dir/assert_cmpge.tz Unit '(Pair 0 0)' Unit -#assert_storage $contract_dir/assert_cmpge.tz Unit '(Pair 0 -1)' Unit -#assert_fails $client run script $contract_dir/assert_cmpge.tz on storage Unit and input '(Pair -1 0)' - -# Tests the SET_CAR and SET_CDR instructions (macros) -assert_storage $contract_dir/set_caddaadr.tz \ -'(Pair (Pair 1 (Pair 2 (Pair (Pair (Pair 3 0) 4) 5))) 6)' \ -'3000000' \ -'(Pair (Pair 1 (Pair 2 (Pair (Pair (Pair 3 3000000) 4) 5))) 6)' - -assert_storage $contract_dir/map_caddaadr.tz \ -'(Pair (Pair 1 (Pair 2 (Pair (Pair (Pair 3 0) 4) 5))) 6)' \ -'Unit' \ -'(Pair (Pair 1 (Pair 2 (Pair (Pair (Pair 3 1000000) 4) 5))) 6)' # Test replay prevention init_with_transfer $contract_dir/replay.tz $key2 Unit 0 bootstrap1 @@ -189,12 +101,6 @@ assert_success $client transfer 0 from bootstrap1 to reveal_signed_preimage -arg '(Pair 0x050100000027566f756c657a2d766f757320636f75636865722061766563206d6f692c20636520736f6972203f "p2sigsceCzcDw2AeYDzUonj4JT341WC9Px4wdhHBxbZcG1FhfqFVuG7f2fGCzrEHSAZgrsrQWpxduDPk9qZRgrpzwJnSHC3gZJ")' bake -# Test comparisons on bytes { EQ ; GT ; LT ; GE ; LE } -#assert_storage $contract_dir/compare_bytes.tz '{}' '(Pair 0x33 0x34)' '{ False ; False ; True ; False ; True }' -#assert_storage $contract_dir/compare_bytes.tz '{}' '(Pair 0x33 0x33aa)' '{ False ; False ; True ; False ; True }' -#assert_storage $contract_dir/compare_bytes.tz '{}' '(Pair 0x33 0x33)' '{ True ; False ; False ; True ; True }' -#assert_storage $contract_dir/compare_bytes.tz '{}' '(Pair 0x34 0x33)' '{ False ; True ; False ; True ; False }' - # Test SET_DELEGATE #b2='tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN' @@ -243,36 +149,6 @@ assert_fails $client typecheck data '{ "A" ; "B" ; "B" }' against type '(set str #assert_fails $client transfer 0 from bootstrap3 to guestbook -arg '"Pas moi non plus"' #assert_fails $client transfer 0 from bootstrap1 to guestbook -arg '"Recoucou ?"' -# Test for big maps -#init_with_transfer $contract_dir/big_map_mem.tz $key1\ -# '(Pair { Elt 1 Unit ; Elt 2 Unit ; Elt 3 Unit } Unit)' \ -# 100 bootstrap1 -#bake_after $client transfer 1 from bootstrap1 to big_map_mem -arg '(Pair 0 False)' -#assert_fails $client transfer 1 from bootstrap1 to big_map_mem -arg '(Pair 0 True)' -#bake_after $client transfer 1 from bootstrap1 to big_map_mem -arg '(Pair 1 True)' -#assert_fails $client transfer 1 from bootstrap1 to big_map_mem -arg '(Pair 1 False)' -#bake_after $client transfer 1 from bootstrap1 to big_map_mem -arg '(Pair 2 True)' -#assert_fails $client transfer 1 from bootstrap1 to big_map_mem -arg '(Pair 2 False)' -#bake_after $client transfer 1 from bootstrap1 to big_map_mem -arg '(Pair 3 True)' -#assert_fails $client transfer 1 from bootstrap1 to big_map_mem -arg '(Pair 3 False)' -#bake_after $client transfer 1 from bootstrap1 to big_map_mem -arg '(Pair 4 False)' -#assert_fails $client transfer 1 from bootstrap1 to big_map_mem -arg '(Pair 4 True)' -#assert_fails $client typecheck data '3' against type \ -# '(int @aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)' -#$client typecheck data '3' against type \ -# '(int @aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)' - -#init_with_transfer $contract_dir/big_map_get_add.tz $key1\ -# '(Pair { Elt 0 1 ; Elt 1 2 ; Elt 2 3 } Unit)' \ -# 100 bootstrap1 - -#bake_after $client transfer 1 from bootstrap1 to big_map_get_add -arg '(Pair (Pair 200 (Some 2)) (Pair 200 (Some 2)))' -#bake_after $client transfer 1 from bootstrap1 to big_map_get_add -arg '(Pair (Pair 200 None) (Pair 200 None))' -#bake_after $client transfer 1 from bootstrap1 to big_map_get_add -arg '(Pair (Pair 200 None) (Pair 300 None))' -#bake_after $client transfer 1 from bootstrap1 to big_map_get_add -arg '(Pair (Pair 1 None) (Pair 200 None))' -#bake_after $client transfer 1 from bootstrap1 to big_map_get_add -arg '(Pair (Pair 1 (Some 2)) (Pair 0 (Some 1)))' -#bake_after $client transfer 1 from bootstrap1 to big_map_get_add -arg '(Pair (Pair 400 (Some 1232)) (Pair 400 (Some 1232)))' -#bake_after $client transfer 1 from bootstrap1 to big_map_get_add -arg '(Pair (Pair 401 (Some 0)) (Pair 400 (Some 1232)))' # Test for issue #262 tee /tmp/bug_262.tz <