From b26795da423bbe8dbb130f74c0ee8e95be829e56 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Thu, 10 Nov 2022 15:27:08 +0100 Subject: [PATCH 01/33] Add is_mutable entry to RemoteLoad and RemoteMapGet --- src/base/Cashflow.ml | 16 ++++++++------- src/base/DeadCodeDetector.ml | 8 ++++---- src/base/Disambiguate.ml | 8 ++++---- src/base/Gas.ml | 4 ++-- src/base/ParserUtil.ml | 2 ++ src/base/PatternChecker.ml | 8 ++++---- src/base/Recursion.ml | 8 ++++---- src/base/SanityChecker.ml | 6 +++--- src/base/ScillaParser.mly | 8 ++++---- src/base/Syntax.ml | 27 ++++++++++++++++++------- src/base/SyntaxAnnotMapper.ml | 7 ++++--- src/base/TypeChecker.ml | 16 +++++++-------- src/base/TypeInfo.ml | 4 ++-- src/base/TypeUtil.ml | 2 +- src/base/TypeUtil.mli | 2 +- src/eval/Eval.ml | 8 ++++---- src/eval/EvalUtil.ml | 28 ++++++++++++------------- src/eval/StateService.ml | 4 ++-- src/formatter/ExtendedSyntax.ml | 11 +++++----- src/formatter/Formatter.ml | 36 ++++++++++++++++++--------------- src/merge/Merge.ml | 36 +++++++++++++++++++++++++-------- 21 files changed, 146 insertions(+), 103 deletions(-) diff --git a/src/base/Cashflow.ml b/src/base/Cashflow.ml index ff82a1368..006bf461d 100644 --- a/src/base/Cashflow.ml +++ b/src/base/Cashflow.ml @@ -187,11 +187,12 @@ struct match s with | Load (x, y) -> CFSyntax.Load (add_noinfo_to_ident x, add_noinfo_to_ident y) - | RemoteLoad (x, adr, y) -> + | RemoteLoad (x, adr, y, is_mutable) -> CFSyntax.RemoteLoad ( add_noinfo_to_ident x, add_noinfo_to_ident adr, - add_noinfo_to_ident y ) + add_noinfo_to_ident y, + is_mutable) | Store (x, y) -> CFSyntax.Store (add_noinfo_to_ident x, add_noinfo_to_ident y) | Bind (x, e) -> CFSyntax.Bind (add_noinfo_to_ident x, cf_init_tag_expr e) @@ -208,11 +209,12 @@ struct add_noinfo_to_ident m, List.map ~f:add_noinfo_to_ident ks, retrieve ) - | RemoteMapGet (x, adr, m, ks, retrieve) -> + | RemoteMapGet (x, adr, m, is_mutable, ks, retrieve) -> CFSyntax.RemoteMapGet ( add_noinfo_to_ident x, add_noinfo_to_ident adr, add_noinfo_to_ident m, + is_mutable, List.map ~f:add_noinfo_to_ident ks, retrieve ) | MatchStmt (x, pss) -> @@ -1624,13 +1626,13 @@ struct (not @@ [%equal: ECFR.money_tag] (get_id_tag new_x) (get_id_tag x)) || not @@ [%equal: ECFR.money_tag] (get_id_tag new_f) (get_id_tag f) ) - | RemoteLoad (x, adr, f) -> + | RemoteLoad (x, adr, f, is_mutable) -> (* TODO - see Load case for inspiration *) (* x is no longer in scope, so remove from local_env *) let new_local_env = AssocDictionary.remove (CFIdentifier.as_string x) local_env in - ( RemoteLoad (x, adr, f), + ( RemoteLoad (x, adr, f, is_mutable), param_env, field_env, new_local_env, @@ -1762,13 +1764,13 @@ struct (not @@ [%equal: ECFR.money_tag] (get_id_tag x) new_x_tag) || (not @@ [%equal: ECFR.money_tag] (get_id_tag m) m_tag) || (not @@ [%equal: _] new_ks ks) ) - | RemoteMapGet (x, adr, m, ks, fetch) -> + | RemoteMapGet (x, adr, m, is_mutable, ks, fetch) -> (* TODO - see MapGet case for inspiration *) (* x is no longer in scope, so remove from local_env *) let new_local_env = AssocDictionary.remove (CFIdentifier.as_string x) local_env in - ( RemoteMapGet (x, adr, m, ks, fetch), + ( RemoteMapGet (x, adr, m, is_mutable, ks, fetch), param_env, field_env, new_local_env, diff --git a/src/base/DeadCodeDetector.ml b/src/base/DeadCodeDetector.ml index 62b0947df..e14092dd2 100644 --- a/src/base/DeadCodeDetector.ml +++ b/src/base/DeadCodeDetector.ml @@ -370,7 +370,7 @@ module DeadCodeDetector (SR : Rep) (ER : Rep) = struct else ( warn "Unused load statement to: " x ER.get_loc; (lv, adts, ctrs)) - | RemoteLoad (x, addr, m) -> + | RemoteLoad (x, addr, m, _is_mutable) -> FieldsState.mark_field_read fs m; (* m is a field, thus we don't track its liveness *) if ERSet.mem lv x then @@ -401,7 +401,7 @@ module DeadCodeDetector (SR : Rep) (ER : Rep) = struct else ( warn "Unused map get statement to: " x ER.get_loc; (lv, adts, ctrs)) - | RemoteMapGet (x, addr, i, il, _) -> + | RemoteMapGet (x, addr, i, _is_mutable, il, _) -> (* i is a field, thus we don't track its liveness *) FieldsState.mark_field_read fs i; if ERSet.mem lv x then @@ -539,7 +539,7 @@ module DeadCodeDetector (SR : Rep) (ER : Rep) = struct [address_params] that are used in [s]. *) let rec get_used_address_fields address_params (s, _annot) = match s with - | RemoteLoad (_, addr, field) | RemoteMapGet (_, addr, field, _, _) -> + | RemoteLoad (_, addr, field, _) | RemoteMapGet (_, addr, field, _, _, _) -> Map.set emp_idsmap ~key:(get_id addr) ~data:(SCIdentifierSet.singleton (get_id field)) | MatchStmt (_id, arms) -> @@ -774,7 +774,7 @@ module DeadCodeDetector (SR : Rep) (ER : Rep) = struct in ignore @@ Stack.pop env_stack; res)) - | RemoteLoad (_, addr, field) | RemoteMapGet (_, addr, field, _, _) -> ( + | RemoteLoad (_, addr, field, _) | RemoteMapGet (_, addr, field, _, _, _) -> ( match env_find_bind (SCIdentifier.get_id addr) with | Some (ctr_name, ctr_arg_pos) when Map.mem adt_ctrs ctr_name -> let ctr_arg_pos_to_fields = diff --git a/src/base/Disambiguate.ml b/src/base/Disambiguate.ml index e27306a36..ca38fd61e 100644 --- a/src/base/Disambiguate.ml +++ b/src/base/Disambiguate.ml @@ -537,7 +537,7 @@ module ScillaDisambiguation (SR : Rep) (ER : Rep) = struct remove_local_id_from_dict var_dict_acc (as_string x) in pure @@ (PostDisSyntax.Load (dis_x, dis_f), new_var_dict) - | RemoteLoad (x, adr, f) -> + | RemoteLoad (x, adr, f, is_mutable) -> let%bind dis_x = name_def_as_simple_global x in (* adr may be defined anywhere, so must be disambiguated *) let%bind dis_adr = @@ -550,7 +550,7 @@ module ScillaDisambiguation (SR : Rep) (ER : Rep) = struct remove_local_id_from_dict var_dict_acc (as_string x) in pure - @@ (PostDisSyntax.RemoteLoad (dis_x, dis_adr, dis_f), new_var_dict) + @@ (PostDisSyntax.RemoteLoad (dis_x, dis_adr, dis_f, is_mutable), new_var_dict) | Store (f, x) -> (* f must be a locally defined field *) let%bind dis_f = name_def_as_simple_global f in @@ -598,7 +598,7 @@ module ScillaDisambiguation (SR : Rep) (ER : Rep) = struct in pure @@ (PostDisSyntax.MapGet (dis_x, dis_m, dis_ks, fetch), new_var_dict) - | RemoteMapGet (x, adr, m, ks, fetch) -> + | RemoteMapGet (x, adr, m, is_mutable, ks, fetch) -> let%bind dis_x = name_def_as_simple_global x in (* adr may be defined anywhere, so must be disambiguated *) let%bind dis_adr = @@ -617,7 +617,7 @@ module ScillaDisambiguation (SR : Rep) (ER : Rep) = struct in pure @@ ( PostDisSyntax.RemoteMapGet - (dis_x, dis_adr, dis_m, dis_ks, fetch), + (dis_x, dis_adr, dis_m, is_mutable, dis_ks, fetch), new_var_dict ) | MatchStmt (x, pss) -> let%bind dis_x = diff --git a/src/base/Gas.ml b/src/base/Gas.ml index 0926b361e..cbb6cb83f 100644 --- a/src/base/Gas.ml +++ b/src/base/Gas.ml @@ -187,7 +187,7 @@ module ScillaGas (SR : Rep) (ER : Rep) = struct | (s, srep) :: rem_stmts -> let%bind s' = match s with - | Load (x, _) | RemoteLoad (x, _, _) -> + | Load (x, _) | RemoteLoad (x, _, _, _) -> let g = GasStmt (GasGasCharge.SumOf @@ -219,7 +219,7 @@ module ScillaGas (SR : Rep) (ER : Rep) = struct | None -> n in pure @@ [ (GasStmt g, srep); (s, srep) ] - | MapGet (x, _, klist, _) | RemoteMapGet (x, _, _, klist, _) -> + | MapGet (x, _, klist, _) | RemoteMapGet (x, _, _, _, klist, _) -> let n = GasGasCharge.StaticCost (List.length klist) in let g = GasGasCharge.SumOf diff --git a/src/base/ParserUtil.ml b/src/base/ParserUtil.ml index 2b6646f91..0ce5385b8 100644 --- a/src/base/ParserUtil.ml +++ b/src/base/ParserUtil.ml @@ -107,6 +107,7 @@ module type Syn = sig ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t + * bool | Store of ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t | Bind of ParserRep.rep SIdentifier.t * expr_annot (* m[k1][k2][..] := v OR delete m[k1][k2][...] *) @@ -126,6 +127,7 @@ module type Syn = sig ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t + * bool * ParserRep.rep SIdentifier.t list * bool | MatchStmt of diff --git a/src/base/PatternChecker.ml b/src/base/PatternChecker.ml index aee1d7b48..098ba39ce 100644 --- a/src/base/PatternChecker.ml +++ b/src/base/PatternChecker.ml @@ -249,16 +249,16 @@ struct let%bind checked_s = match s with | Load (i, x) -> pure @@ (CheckedPatternSyntax.Load (i, x), rep) - | RemoteLoad (i, adr, x) -> - pure @@ (CheckedPatternSyntax.RemoteLoad (i, adr, x), rep) + | RemoteLoad (i, adr, x, is_mutable) -> + pure @@ (CheckedPatternSyntax.RemoteLoad (i, adr, x, is_mutable), rep) | Store (i, x) -> pure @@ (CheckedPatternSyntax.Store (i, x), rep) | MapUpdate (m, klist, v) -> pure @@ (CheckedPatternSyntax.MapUpdate (m, klist, v), rep) | MapGet (v, m, klist, valfetch) -> pure @@ (CheckedPatternSyntax.MapGet (v, m, klist, valfetch), rep) - | RemoteMapGet (v, adr, m, klist, valfetch) -> + | RemoteMapGet (v, adr, m, is_mutable, klist, valfetch) -> pure - @@ ( CheckedPatternSyntax.RemoteMapGet (v, adr, m, klist, valfetch), + @@ ( CheckedPatternSyntax.RemoteMapGet (v, adr, m, is_mutable, klist, valfetch), rep ) | Bind (i, e) -> wrap_pmcheck_serr srep diff --git a/src/base/Recursion.ml b/src/base/Recursion.ml index 1dc2a3221..71ce9d997 100644 --- a/src/base/Recursion.ml +++ b/src/base/Recursion.ml @@ -188,8 +188,8 @@ module ScillaRecursion (SR : Rep) (ER : Rep) = struct let%bind new_s = match s with | Load (x, f) -> pure @@ RecursionSyntax.Load (x, f) - | RemoteLoad (x, adr, f) -> - pure @@ RecursionSyntax.RemoteLoad (x, adr, f) + | RemoteLoad (x, adr, f, is_mutable) -> + pure @@ RecursionSyntax.RemoteLoad (x, adr, f, is_mutable) | Store (f, x) -> pure @@ RecursionSyntax.Store (f, x) | Bind (x, e) -> let%bind new_e = rec_exp e in @@ -198,8 +198,8 @@ module ScillaRecursion (SR : Rep) (ER : Rep) = struct pure @@ RecursionSyntax.MapUpdate (m, is, vopt) | MapGet (x, m, is, del) -> pure @@ RecursionSyntax.MapGet (x, m, is, del) - | RemoteMapGet (x, adr, m, is, del) -> - pure @@ RecursionSyntax.RemoteMapGet (x, adr, m, is, del) + | RemoteMapGet (x, adr, m, is_mutable, is, del) -> + pure @@ RecursionSyntax.RemoteMapGet (x, adr, m, is_mutable, is, del) | MatchStmt (x, pss) -> let%bind new_pss = mapM diff --git a/src/base/SanityChecker.ml b/src/base/SanityChecker.ml index aa7065830..c3b6ae80c 100644 --- a/src/base/SanityChecker.ml +++ b/src/base/SanityChecker.ml @@ -375,9 +375,9 @@ struct foldM stmts ~init:stmt_defs ~f:(fun acc_stmt_defs (s, _) -> match s with | Load (x, _) - | RemoteLoad (x, _, _) + | RemoteLoad (x, _, _, _) | MapGet (x, _, _, _) - | RemoteMapGet (x, _, _, _, _) + | RemoteMapGet (x, _, _, _, _, _) | ReadFromBC (x, _) | TypeCast (x, _, _) -> check_warn_redef cparams cfields pnames stmt_defs x; @@ -803,7 +803,7 @@ struct let collect_variables_from_map_get (s, _annot) = match s with - | MapGet (v, _, _, true) | RemoteMapGet (v, _, _, _, true) -> [ v ] + | MapGet (v, _, _, true) | RemoteMapGet (v, _, _, _, _, true) -> [ v ] | MapGet _ | RemoteMapGet _ | Load _ | RemoteLoad _ | Store _ | Bind _ | MapUpdate _ | MatchStmt _ | ReadFromBC _ | TypeCast _ | AcceptPayment | Iterate _ | SendMsgs _ | CreateEvnt _ | CallProc _ | Throw _ | GasStmt _ diff --git a/src/base/ScillaParser.mly b/src/base/ScillaParser.mly index 475c3164f..727178cc6 100644 --- a/src/base/ScillaParser.mly +++ b/src/base/ScillaParser.mly @@ -437,17 +437,17 @@ stmt: remote_fetch_stmt: | l = ID; FETCH; AND; adr = ID; PERIOD; r = sident - { RemoteLoad (to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), r), toLoc $startpos } + { RemoteLoad (to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), r, true), toLoc $startpos } | (* Reading _sender._balance or _origin._balance *) l = ID; FETCH; AND; adr = SPID; PERIOD; r = SPID - { RemoteLoad (to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r))), toLoc $startpos } + { RemoteLoad (to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), true), toLoc $startpos } | (* Adding this production in preparation for remote reads of contract parameters *) _l = ID; FETCH; AND; _adr = ID; PERIOD; LPAREN; _r = sident; RPAREN; { raise (SyntaxError ("Remote fetch of contract parameters not yet supported", toLoc $startpos(_adr))) } | l = ID; FETCH; AND; adr = ID; PERIOD; r = ID; keys = nonempty_list(map_access) - { RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), keys, true), toLoc $startpos } + { RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), true, keys, true), toLoc $startpos } | l = ID; FETCH; AND; EXISTS; adr = ID; PERIOD; r = ID; keys = nonempty_list(map_access) - { RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), keys, false), toLoc $startpos } + { RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), true, keys, false), toLoc $startpos } | (* Adding this production in preparation for address type casts *) l = ID; FETCH; AND; adr = sident; AS; t = address_typ { TypeCast(to_loc_id l (toLoc $startpos(l)), adr, t), toLoc $startpos } diff --git a/src/base/Syntax.ml b/src/base/Syntax.ml index 82223a05e..4ae42fb44 100644 --- a/src/base/Syntax.ml +++ b/src/base/Syntax.ml @@ -317,8 +317,9 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct | Load of ER.rep SIdentifier.t * ER.rep SIdentifier.t (** [Load(I1, I2)] represents: [I1 <- I2] *) | RemoteLoad of - ER.rep SIdentifier.t * ER.rep SIdentifier.t * ER.rep SIdentifier.t - (** [RemoteLoad(I1, I2, I3)] represents: [I1 <- & I2.I3] *) + ER.rep SIdentifier.t * ER.rep SIdentifier.t * ER.rep SIdentifier.t * bool + (** [RemoteLoad(I1, I2, I3, true)] represents: [I1 <- & I2.I3] (reading a mutable field) + * [RemoteLoad(I1, I2, I3, false)] represents: [I1 <- & I2.(I3)] (reading a contract parameter) *) | Store of ER.rep SIdentifier.t * ER.rep SIdentifier.t (** [Store(I1, I2)] represents: [I1 := I2] *) | Bind of ER.rep SIdentifier.t * expr_annot @@ -342,11 +343,14 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct ER.rep SIdentifier.t * ER.rep SIdentifier.t * ER.rep SIdentifier.t + * bool * ER.rep SIdentifier.t list * bool - (** [RemoteMapGet(V, Adr, M, [K1; ...; Kn], Retrieve)] represents: - * [V <- & Adr.M[K1]...[Kn]] if [Retrieve] is [true] - * [V <- & exists Adr.M[K1]...[Kn]] if [Retrieve] is [false] *) + (** [RemoteMapGet(V, Adr, M, IsMutable, [K1; ...; Kn], Retrieve)] represents: + * [V <- & Adr.(M)[K1]...[Kn]] if [IsMutable] is [false] and [Retrieve] is [true] + * [V <- & exists Adr.(M)[K1]...[Kn]] if [IsMutable] is [false] and [Retrieve] is [true] + * [V <- & Adr.M[K1]...[Kn]] if [IsMutable] is [true] and [Retrieve] is [true] + * [V <- & exists Adr.M[K1]...[Kn]] if [IsMutable] is [true] and [Retrieve] is [false] *) | MatchStmt of ER.rep SIdentifier.t * (pattern * stmt_annot list) list (** [MatchStmt(I, [(P1; S1); ...; (Pn; Sn)])] represents: [match I with @@ -602,9 +606,12 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct | Load (x, f) -> sprintf "Type error in reading value of `%s` into `%s`:\n %s" (as_error_string f) (as_error_string x) phase - | RemoteLoad (x, adr, f) -> + | RemoteLoad (x, adr, f, true) -> sprintf "Type error in reading value of `%s.%s` into `%s`:\n %s" (as_error_string adr) (as_error_string f) (as_error_string x) phase + | RemoteLoad (x, adr, f, false) -> + sprintf "Type error in reading value of `%s.(%s)` into `%s`:\n %s" + (as_error_string adr) (as_error_string f) (as_error_string x) phase | Store (f, r) -> sprintf "Type error in storing value of `%s` into the field `%s`:\n" (as_error_string r) (as_error_string f) @@ -616,12 +623,18 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct ^ List.fold keys ~init:"" ~f:(fun acc k -> acc ^ "[" ^ as_error_string k ^ "]") ^ "\n" - | RemoteMapGet (_, adr, m, keys, _) -> + | RemoteMapGet (_, adr, m, true, keys, _) -> sprintf "Type error in getting map value %s.%s" (as_error_string adr) (as_error_string m) ^ List.fold keys ~init:"" ~f:(fun acc k -> acc ^ "[" ^ as_error_string k ^ "]") ^ "\n" + | RemoteMapGet (_, adr, m, false, keys, _) -> + sprintf "Type error in getting map value %s.(%s)" (as_error_string adr) + (as_error_string m) + ^ List.fold keys ~init:"" ~f:(fun acc k -> + acc ^ "[" ^ as_error_string k ^ "]") + ^ "\n" | MapUpdate (m, keys, _) -> sprintf "Type error in updating map %s" (as_error_string m) ^ List.fold keys ~init:"" ~f:(fun acc k -> diff --git a/src/base/SyntaxAnnotMapper.ml b/src/base/SyntaxAnnotMapper.ml index 70bb53c74..a0edf2202 100644 --- a/src/base/SyntaxAnnotMapper.ml +++ b/src/base/SyntaxAnnotMapper.ml @@ -180,8 +180,8 @@ struct let rec statement stmt ~fe ~fl ~fs = match stmt with | Load (id, field) -> OutputSyntax.Load (map_id fe id, map_id fe field) - | RemoteLoad (id, addr, field) -> - OutputSyntax.RemoteLoad (map_id fe id, map_id fe addr, map_id fe field) + | RemoteLoad (id, addr, field, is_mutable) -> + OutputSyntax.RemoteLoad (map_id fe id, map_id fe addr, map_id fe field, is_mutable) | Store (field, value) -> OutputSyntax.Store (map_id fe field, map_id fe value) | Bind (id, e) -> OutputSyntax.Bind (map_id fe id, expr_annot e ~fe ~fl ~fs) @@ -196,11 +196,12 @@ struct map_id fe map, List.map keys ~f:(fun k -> map_id fe k), mode ) - | RemoteMapGet (value, addr, map, keys, mode) -> + | RemoteMapGet (value, addr, map, is_mutable, keys, mode) -> OutputSyntax.RemoteMapGet ( map_id fe value, map_id fe addr, map_id fe map, + is_mutable, List.map keys ~f:(fun k -> map_id fe k), mode ) | MatchStmt (matchee, branches) -> diff --git a/src/base/TypeChecker.ml b/src/base/TypeChecker.ml index 3f631228c..2b9389a33 100644 --- a/src/base/TypeChecker.ml +++ b/src/base/TypeChecker.ml @@ -600,13 +600,13 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct let typed_m = add_type_to_ident m (rr_typ m_type) in pure (typed_m, typed_keys, res) - let type_remote_map_access env adr m keys = + let type_remote_map_access env adr m is_mutable keys = let lc = get_rep adr in let%bind adr_type = fromR_TE @@ TEnv.resolveT env.pure (get_id adr) ~lopt:(Some lc) in let%bind m_type = - fromR_TE @@ address_field_type (ER.get_loc lc) m (rr_typ adr_type).tp + fromR_TE @@ address_field_type (ER.get_loc lc) m (rr_typ adr_type).tp is_mutable in let%bind typed_keys, res = type_map_access_helper env m_type keys in let typed_m = add_type_to_ident m (mk_qual_tp m_type) in @@ -643,7 +643,7 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct @@ add_stmt_to_stmts_env_gas (TypedSyntax.Load (typed_x, typed_f), rep) checked_stmts - | RemoteLoad (x, adr, f) -> + | RemoteLoad (x, adr, f, is_mutable) -> let lc = get_rep adr in let%bind pure', adr_type, ident_type = let%bind adr_typ = @@ -651,7 +651,7 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct in let%bind fr = fromR_TE - @@ address_field_type (ER.get_loc lc) f (rr_typ adr_typ).tp + @@ address_field_type (ER.get_loc lc) f (rr_typ adr_typ).tp is_mutable in pure @@ ((x, fr), rr_typ adr_typ, mk_qual_tp fr) in @@ -664,7 +664,7 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct let typed_f = add_type_to_ident f ident_type in pure @@ add_stmt_to_stmts_env_gas - (TypedSyntax.RemoteLoad (typed_x, typed_adr, typed_f), rep) + (TypedSyntax.RemoteLoad (typed_x, typed_adr, typed_f, is_mutable), rep) checked_stmts | Store (f, r) -> if List.mem ~equal:[%equal: TCName.t] no_store_fields (get_id f) @@ -769,10 +769,10 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct ( TypedSyntax.MapGet (typed_v, typed_m, typed_klist, valfetch), rep ) checked_stmts - | RemoteMapGet (v, adr, m, klist, valfetch) -> + | RemoteMapGet (v, adr, m, is_mutable, klist, valfetch) -> let%bind typed_adr, typed_m, typed_klist, v_type = let%bind typed_adr, typed_m, typed_klist, v_type = - type_remote_map_access env adr m klist + type_remote_map_access env adr m is_mutable klist in pure @@ (typed_adr, typed_m, typed_klist, v_type) in @@ -789,7 +789,7 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct pure @@ add_stmt_to_stmts_env_gas ( TypedSyntax.RemoteMapGet - (typed_v, typed_adr, typed_m, typed_klist, valfetch), + (typed_v, typed_adr, typed_m, is_mutable, typed_klist, valfetch), rep ) checked_stmts | ReadFromBC (x, bf) -> diff --git a/src/base/TypeInfo.ml b/src/base/TypeInfo.ml index 5ee45cf03..b2810d747 100644 --- a/src/base/TypeInfo.ml +++ b/src/base/TypeInfo.ml @@ -100,7 +100,7 @@ struct List.fold_right stmts ~init:[] ~f:(fun (stmt, _srep) acc -> (match stmt with | Load (x, f) | Store (f, x) -> [ calc_ident_locs x; calc_ident_locs f ] - | RemoteLoad (x, adr, f) -> + | RemoteLoad (x, adr, f, _is_mutable) -> [ calc_ident_locs x; calc_ident_locs adr; calc_ident_locs f ] | Bind (x, e) -> calc_ident_locs x :: type_info_expr e (* m[k1][k2][..] := v OR delete m[k1][k2][...] *) @@ -112,7 +112,7 @@ struct | MapGet (x, m, il, _) -> [ calc_ident_locs x; calc_ident_locs m ] @ List.map il ~f:calc_ident_locs - | RemoteMapGet (x, adr, m, il, _) -> + | RemoteMapGet (x, adr, m, is_mutable, il, _) -> [ calc_ident_locs x; calc_ident_locs adr; calc_ident_locs m ] @ List.map il ~f:calc_ident_locs | MatchStmt (o, clauses) -> diff --git a/src/base/TypeUtil.ml b/src/base/TypeUtil.ml index 455527a0e..7f8bc083d 100644 --- a/src/base/TypeUtil.ml +++ b/src/base/TypeUtil.ml @@ -469,7 +469,7 @@ module TypeUtilities = struct let rec map_depth mt = match mt with MapType (_, vt) -> 1 + map_depth vt | _ -> 0 - let address_field_type loc f t = + let address_field_type loc f t _is_mutable = let preknown_field_type = if [%equal: TUName.t] (get_id f) ContractUtil.balance_label then Some ContractUtil.balance_type diff --git a/src/base/TypeUtil.mli b/src/base/TypeUtil.mli index 0093c1097..dc9936dd2 100644 --- a/src/base/TypeUtil.mli +++ b/src/base/TypeUtil.mli @@ -148,7 +148,7 @@ module TypeUtilities : sig val map_depth : TUType.t -> int val address_field_type : - loc -> 'a TUIdentifier.t -> TUType.t -> (TUType.t, scilla_error list) result + loc -> 'a TUIdentifier.t -> TUType.t -> bool -> (TUType.t, scilla_error list) result (****************************************************************) (* Utility function for matching types *) diff --git a/src/eval/Eval.ml b/src/eval/Eval.ml index 42cf68bc8..ec3a2b92c 100644 --- a/src/eval/Eval.ml +++ b/src/eval/Eval.ml @@ -372,11 +372,11 @@ let rec stmt_eval conf stmts = let%bind l = Configuration.load conf r in let conf' = Configuration.bind conf (get_id x) l in stmt_eval conf' sts - | RemoteLoad (x, adr, r) -> ( + | RemoteLoad (x, adr, r, is_mutable) -> ( let%bind a = fromR @@ Configuration.lookup conf adr in match a with | ByStrX s' when Bystrx.width s' = Type.address_length -> - let%bind l = Configuration.remote_load conf s' r in + let%bind l = Configuration.remote_load conf s' r is_mutable in let conf' = Configuration.bind conf (get_id x) l in stmt_eval conf' sts | _ -> @@ -410,7 +410,7 @@ let rec stmt_eval conf stmts = let%bind l = Configuration.map_get conf m klist' fetchval in let conf' = Configuration.bind conf (get_id x) l in stmt_eval conf' sts - | RemoteMapGet (x, adr, m, klist, fetchval) -> ( + | RemoteMapGet (x, adr, m, is_mutable, klist, fetchval) -> ( let%bind a = fromR @@ Configuration.lookup conf adr in match a with | ByStrX abystr when Bystrx.width abystr = Type.address_length -> @@ -418,7 +418,7 @@ let rec stmt_eval conf stmts = mapM ~f:(fun k -> fromR @@ Configuration.lookup conf k) klist in let%bind l = - Configuration.remote_map_get abystr m klist' fetchval + Configuration.remote_map_get abystr m is_mutable klist' fetchval in let conf' = Configuration.bind conf (get_id x) l in stmt_eval conf' sts diff --git a/src/eval/EvalUtil.ml b/src/eval/EvalUtil.ml index a5d82be50..aa9806c17 100644 --- a/src/eval/EvalUtil.ml +++ b/src/eval/EvalUtil.ml @@ -191,10 +191,10 @@ module Configuration = struct ~inst:(EvalName.as_error_string i) (ER.get_loc (get_rep k)) - let remote_load st caddr k = + let remote_load st caddr k mutable_field = let%bind fval = fromR - @@ StateService.external_fetch ~caddr ~fname:k ~keys:[] ~ignoreval:false + @@ StateService.external_fetch ~caddr ~fname:k ~mutable_field ~keys:[] ~ignoreval:false in match fval with | Some v, _ -> @@ -227,10 +227,10 @@ module Configuration = struct ~inst:(EvalName.as_error_string (get_id k)) (ER.get_loc (get_rep k)) - let remote_field_type caddr k = + let remote_field_type caddr k mutable_field = let%bind fval = fromR - @@ StateService.external_fetch ~caddr ~fname:k ~keys:[] ~ignoreval:true + @@ StateService.external_fetch ~caddr ~fname:k ~mutable_field ~keys:[] ~ignoreval:true in match fval with | _, Some ty -> pure ty @@ -274,19 +274,19 @@ module Configuration = struct in pure @@ EvalLiteral.build_bool_lit is_member - let remote_map_get caddr m keys fetchval = + let remote_map_get caddr m mutable_field keys fetchval = let open EvalLiteral in if fetchval then (* We need to fetch the type in advance because the type-option returned * by the actual call may be None if the key(s) wasn't found, * (but the map map field itself still exists). *) - let%bind mt = remote_field_type caddr m in + let%bind mt = remote_field_type caddr m mutable_field in let%bind vt = fromR @@ EvalTypeUtilities.map_access_type mt (List.length keys) in let%bind vopt, _ = fromR - @@ StateService.external_fetch ~caddr ~fname:m ~keys ~ignoreval:false + @@ StateService.external_fetch ~caddr ~fname:m ~mutable_field ~keys ~ignoreval:false in (* Need to wrap the result in a Scilla Option. *) match vopt with @@ -295,7 +295,7 @@ module Configuration = struct else let%bind _, topt = fromR - @@ StateService.external_fetch ~caddr ~fname:m ~keys ~ignoreval:true + @@ StateService.external_fetch ~caddr ~fname:m ~mutable_field ~keys ~ignoreval:true in pure @@ EvalLiteral.build_bool_lit (Option.is_some topt) @@ -397,7 +397,7 @@ module Configuration = struct (* Check that sender balance is sufficient *) let%bind sender_addr = lookup_sender_addr st in let%bind sender_balance_l = - remote_load st sender_addr (mk_loc_id balance_label) + remote_load st sender_addr (mk_loc_id balance_label) false in let incoming' = st.incoming_funds in match sender_balance_l with @@ -555,7 +555,7 @@ module EvalTypecheck = struct let is_contract_addr ~caddr = let this_id = EvalIdentifier.mk_loc_id this_address_label in let%bind _, this_typ_opt = - StateService.external_fetch ~caddr ~fname:this_id ~keys:[] ~ignoreval:true + StateService.external_fetch ~caddr ~fname:this_id ~mutable_field:false ~keys:[] ~ignoreval:true in pure @@ Option.is_some this_typ_opt @@ -563,7 +563,7 @@ module EvalTypecheck = struct let is_library_or_contract_addr ~caddr = let this_id = EvalIdentifier.mk_loc_id codehash_label in let%bind _, this_typ_opt = - StateService.external_fetch ~caddr ~fname:this_id ~keys:[] ~ignoreval:true + StateService.external_fetch ~caddr ~fname:this_id ~mutable_field:false ~keys:[] ~ignoreval:true in pure @@ Option.is_some this_typ_opt @@ -578,11 +578,11 @@ module EvalTypecheck = struct let balance_id = EvalIdentifier.mk_loc_id balance_label in let nonce_id = EvalIdentifier.mk_loc_id nonce_label in let%bind balance_lit, _ = - StateService.external_fetch ~caddr ~fname:balance_id ~keys:[] + StateService.external_fetch ~caddr ~fname:balance_id ~mutable_field:false ~keys:[] ~ignoreval:false in let%bind nonce_lit, _ = - StateService.external_fetch ~caddr ~fname:nonce_id ~keys:[] + StateService.external_fetch ~caddr ~fname:nonce_id ~mutable_field:false ~keys:[] ~ignoreval:false in match (balance_lit, nonce_lit) with @@ -604,7 +604,7 @@ module EvalTypecheck = struct (* Check that all fields are defined at caddr, and that their types are assignable to what is expected *) allM fts ~f:(fun (f, t) -> let%bind res = - StateService.external_fetch ~caddr ~fname:f ~keys:[] ~ignoreval:true + StateService.external_fetch ~caddr ~fname:f ~mutable_field:true ~keys:[] ~ignoreval:true in match res with | _, Some ext_typ -> diff --git a/src/eval/StateService.ml b/src/eval/StateService.ml index b1bd3814f..d83095ae7 100644 --- a/src/eval/StateService.ml +++ b/src/eval/StateService.ml @@ -189,12 +189,12 @@ module MakeStateService () = struct ?inst:None) (* Common function for external state lookup. - * If the caddr+fname+keys combination exists: + * If the caddr+fname+mutable_field+keys combination exists: * If ~ignoreval is true: (None, Some type) is returned * if ~ignoreval is false: (Some val, Some type) is returned * Else: (None, None) is returned *) - let external_fetch ~caddr ~fname ~keys ~ignoreval = + let external_fetch ~caddr ~fname ~(mutable_field:bool) ~keys ~ignoreval = let%bind sm, _fields, estates, _bcinfo = assert_init () in let caddr_hex = SSLiteral.Bystrx.hex_encoding caddr in match sm with diff --git a/src/formatter/ExtendedSyntax.ml b/src/formatter/ExtendedSyntax.ml index b1171579f..203d5b042 100644 --- a/src/formatter/ExtendedSyntax.ml +++ b/src/formatter/ExtendedSyntax.ml @@ -88,7 +88,7 @@ struct and stmt = | Load of ER.rep id_ann * ER.rep id_ann - | RemoteLoad of ER.rep id_ann * ER.rep id_ann * ER.rep id_ann + | RemoteLoad of ER.rep id_ann * ER.rep id_ann * ER.rep id_ann * bool | Store of ER.rep id_ann * ER.rep id_ann | Bind of ER.rep id_ann * expr_annot | MapUpdate of ER.rep id_ann * ER.rep id_ann list * ER.rep id_ann option @@ -97,6 +97,7 @@ struct ER.rep id_ann * ER.rep id_ann * ER.rep id_ann + * bool * ER.rep id_ann list * bool | MatchStmt of @@ -567,7 +568,7 @@ struct let lhs' = extend_er_id tr lhs in let rhs' = extend_er_id tr rhs in (ExtSyn.Load (lhs', rhs'), ann, c) - | Syn.RemoteLoad (lhs, addr, rhs) -> + | Syn.RemoteLoad (lhs, addr, rhs, is_mutable) -> let c = comment (loc_end_er lhs) in let lhs' = extend_er_id tr lhs ~rep_end:(Some (SIdentifier.get_rep addr)) @@ -576,7 +577,7 @@ struct extend_er_id tr addr ~rep_end:(Some (SIdentifier.get_rep rhs)) in let rhs' = extend_er_id tr rhs in - (ExtSyn.RemoteLoad (lhs', addr', rhs'), ann, c) + (ExtSyn.RemoteLoad (lhs', addr', rhs', is_mutable), ann, c) | Syn.Store (lhs, rhs) -> let c = comment (loc_end_er lhs) in let lhs' = extend_er_id tr lhs in @@ -602,13 +603,13 @@ struct let m' = extend_er_id tr m in let keys' = List.map keys ~f:(fun k -> extend_er_id tr k) in (ExtSyn.MapGet (v', m', keys', retrieve), ann, c) - | Syn.RemoteMapGet (v, addr, m, keys, retrieve) -> + | Syn.RemoteMapGet (v, addr, m, is_mutable, keys, retrieve) -> let c = comment (loc_end_er v) in let v' = extend_er_id tr v in let addr' = extend_er_id tr addr in let m' = extend_er_id tr m in let keys' = List.map keys ~f:(fun k -> extend_er_id tr k) in - (ExtSyn.RemoteMapGet (v', addr', m', keys', retrieve), ann, c) + (ExtSyn.RemoteMapGet (v', addr', m', is_mutable, keys', retrieve), ann, c) | Syn.MatchStmt (id, arms) -> let c = comment (loc_end_er id) in let id' = extend_er_id tr id in diff --git a/src/formatter/Formatter.ml b/src/formatter/Formatter.ml index 12865e1ba..bf8692099 100644 --- a/src/formatter/Formatter.ml +++ b/src/formatter/Formatter.ml @@ -360,8 +360,8 @@ struct | GasExpr _ -> failwith "Gas annotations cannot appear in user contracts's expressions" ) |> wrap_comments comments - let of_map_access map keys = - let map = of_ann_id map + let of_map_access map immutable_remote_field keys = + let map = if immutable_remote_field then lparen ^^ of_ann_id map ^^ rparen else of_ann_id map and keys = concat_map (fun k -> brackets @@ of_ann_id k) keys in map ^^ keys @@ -369,8 +369,11 @@ struct (match stmt with | Ast.Load (id, field) -> of_ann_id id ^^^ rev_arrow ^//^ of_ann_id field - | Ast.RemoteLoad (id, addr, field) -> - of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ of_ann_id field + | Ast.RemoteLoad (id, addr, field, is_mutable) -> + if is_mutable then + of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ of_ann_id field + else + of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ lparen ^^ of_ann_id field ^^ rparen | Ast.Store (field, id) -> of_ann_id field ^^^ assign ^//^ of_ann_id id | Ast.Bind (id, expr) -> @@ -378,24 +381,25 @@ struct | Ast.MapUpdate (map, keys, mode) -> (* m[k1][k2][..] := v OR delete m[k1][k2][...] *) (match mode with - | Some value -> of_map_access map keys ^^^ assign ^//^ of_ann_id value - | None -> delete_kwd ^^^ of_map_access map keys) + | Some value -> of_map_access map false keys ^^^ assign ^//^ of_ann_id value + | None -> delete_kwd ^^^ of_map_access map false keys) | Ast.MapGet (id, map, keys, mode) -> (* v <- m[k1][k2][...] OR b <- exists m[k1][k2][...] *) (* If the bool is set, then we interpret this as value retrieve, otherwise as an "exists" query. *) if mode then - of_ann_id id ^^^ rev_arrow ^//^ of_map_access map keys + of_ann_id id ^^^ rev_arrow ^//^ of_map_access map false keys else - of_ann_id id ^^^ rev_arrow ^//^ exists_kwd ^^^ of_map_access map keys - | Ast.RemoteMapGet (id, addr, map, keys, mode) -> - (* v <-& adr.m[k1][k2][...] OR b <-& exists adr.m[k1][k2][...] *) - (* If the bool is set, then we interpret this as value retrieve, - otherwise as an "exists" query. *) - if mode then - of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ of_map_access map keys - else - of_ann_id id ^^^ blockchain_arrow ^//^ exists_kwd ^^^ of_ann_id addr ^^ dot ^^ of_map_access map keys + of_ann_id id ^^^ rev_arrow ^//^ exists_kwd ^^^ of_map_access map false keys + | Ast.RemoteMapGet (id, addr, map, is_mutable, keys, mode) -> + (* v <-& adr.(m)[k1][k2][...] OR b <-& exists adr.(m)[k1][k2][...] OR + v <-& adr.m[k1][k2][...] OR b <-& exists adr.m[k1][k2][...] *) + (* If mode is set, then we interpret this as value retrieve, + otherwise as an "exists" query. *) + if mode then + of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ of_map_access map (not is_mutable) keys + else + of_ann_id id ^^^ blockchain_arrow ^//^ exists_kwd ^^^ of_ann_id addr ^^ dot ^^ of_map_access map (not is_mutable) keys | Ast.MatchStmt (id, branches) -> match_kwd ^^^ of_ann_id id ^^^ with_kwd ^/^ separate_map hardline diff --git a/src/merge/Merge.ml b/src/merge/Merge.ml index 85bcdadad..358f28616 100644 --- a/src/merge/Merge.ml +++ b/src/merge/Merge.ml @@ -449,20 +449,20 @@ module ScillaMerger (SR : Rep) (ER : Rep) = struct let m' = rename_local_er renames_map m in let keys' = List.map keys ~f:(fun k -> rename_local_er renames_map k) in (MapGet (v', m', keys', exists), annot) - | RemoteMapGet (v, adr, m, keys, exists) -> + | RemoteMapGet (v, adr, m, is_mutable, keys, exists) -> (* Map will be replaced to the local one in the Remote pass. *) let v' = rename_local_er renames_map v in let keys' = List.map keys ~f:(fun k -> rename_local_er renames_map k) in - (RemoteMapGet (v', adr, m, keys', exists), annot) + (RemoteMapGet (v', adr, m, is_mutable, keys', exists), annot) | Load (lhs, rhs) -> let lhs' = rename_local_er renames_map lhs in let rhs' = rename_local_er renames_map rhs in (Load (lhs', rhs'), annot) - | RemoteLoad (lhs, adr, rhs) -> + | RemoteLoad (lhs, adr, rhs, is_mutable) -> (* Address will be replaced in the Remote pass. *) let lhs' = rename_local_er renames_map lhs in let rhs' = rename_local_er renames_map rhs in - (RemoteLoad (lhs', adr, rhs'), annot) + (RemoteLoad (lhs', adr, rhs', is_mutable), annot) | Store (lhs, rhs) -> let lhs' = rename_local_er renames_map lhs in let rhs' = rename_local_er renames_map rhs in @@ -716,12 +716,32 @@ module ScillaMerger (SR : Rep) (ER : Rep) = struct let rec localize_stmt renames_map (stmt, annot) = match stmt with - | RemoteLoad (l, _, v) -> + | RemoteLoad (l, _, v, is_mutable) -> let v' = remote_rename_er renames_map v in - (Load (l, v'), annot) - | RemoteMapGet (l, _, m, keys, exists) -> + if is_mutable then + (Load (l, v'), annot) + else + (* Immutable fields exist in the same namespace as local variables *) + (Bind (l, (Var v', PIdentifier.get_rep v')), annot) + | RemoteMapGet (l, _, m, is_mutable, keys, exists) -> let m' = remote_rename_er renames_map m in - (MapGet (l, m', keys, exists), annot) + if is_mutable then + (MapGet (l, m', keys, exists), annot) + else + (* Immutable fields exist in the same namespace as local variables. + Build a series of get operations. Wrap in let expressions to avoid name clashes. *) + let access_exp_opt = + List.fold_right keys ~init:None ~f:(fun key acc -> + let get_exp = (Builtin ((Builtin_get, PIdentifier.get_rep key), [], [m ; key]), PIdentifier.get_rep key) in + match acc with + | None -> Some get_exp + | Some exp -> Some (Let (m, None, get_exp, exp), PIdentifier.get_rep key)) + in + let access_exp = + Option.value_or_thunk access_exp_opt + ~default:(fun () -> raise (ErrorUtils.mk_internal_error ~kind:"Missing keys in remote map get" ?inst:None)) + in + (Bind (l, access_exp), annot) | MatchStmt (id, arms) -> let arms' = List.map arms ~f:(fun (pat, stmts) -> From 3dd25bb37b14c4e82739515d9a9cb5ed1a0b8a2d Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Wed, 16 Nov 2022 07:54:09 +0100 Subject: [PATCH 02/33] Added concrete syntax --- src/base/ScillaParser.mly | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/base/ScillaParser.mly b/src/base/ScillaParser.mly index 727178cc6..b82067f46 100644 --- a/src/base/ScillaParser.mly +++ b/src/base/ScillaParser.mly @@ -441,13 +441,19 @@ remote_fetch_stmt: | (* Reading _sender._balance or _origin._balance *) l = ID; FETCH; AND; adr = SPID; PERIOD; r = SPID { RemoteLoad (to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), true), toLoc $startpos } -| (* Adding this production in preparation for remote reads of contract parameters *) - _l = ID; FETCH; AND; _adr = ID; PERIOD; LPAREN; _r = sident; RPAREN; - { raise (SyntaxError ("Remote fetch of contract parameters not yet supported", toLoc $startpos(_adr))) } +| (* Reading immutable fields *) + l = ID; FETCH; AND; adr = ID; PERIOD; LPAREN; r = sident; RPAREN; keys = list(map_access) + { + match keys with + | [] -> RemoteLoad (to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), r, false), toLoc $startpos + | _ -> RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), r, false, keys, true), toLoc $startpos + } | l = ID; FETCH; AND; adr = ID; PERIOD; r = ID; keys = nonempty_list(map_access) { RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), true, keys, true), toLoc $startpos } | l = ID; FETCH; AND; EXISTS; adr = ID; PERIOD; r = ID; keys = nonempty_list(map_access) { RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), true, keys, false), toLoc $startpos } +| l = ID; FETCH; AND; EXISTS; adr = ID; PERIOD; LPAREN; r = ID; RPAREN; keys = nonempty_list(map_access) + { RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), false, keys, false), toLoc $startpos } | (* Adding this production in preparation for address type casts *) l = ID; FETCH; AND; adr = sident; AS; t = address_typ { TypeCast(to_loc_id l (toLoc $startpos(l)), adr, t), toLoc $startpos } From b10894db7a7543b355358cc9ccc9e4cdb40bb271 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Wed, 16 Nov 2022 14:24:14 +0100 Subject: [PATCH 03/33] Change mutability from bool to new field_mutability type --- src/base/Cashflow.ml | 16 +++++------ src/base/DeadCodeDetector.ml | 4 +-- src/base/Disambiguate.ml | 8 +++--- src/base/ParserUtil.ml | 4 +-- src/base/PatternChecker.ml | 8 +++--- src/base/Recursion.ml | 8 +++--- src/base/ScillaParser.mly | 14 +++++----- src/base/Syntax.ml | 47 ++++++++++++++++++--------------- src/base/SyntaxAnnotMapper.ml | 8 +++--- src/base/TypeChecker.ml | 12 ++++----- src/base/TypeInfo.ml | 4 +-- src/eval/Eval.ml | 8 +++--- src/formatter/ExtendedSyntax.ml | 12 ++++----- src/formatter/Formatter.ml | 22 +++++++-------- src/merge/Merge.ml | 16 +++++------ 15 files changed, 97 insertions(+), 94 deletions(-) diff --git a/src/base/Cashflow.ml b/src/base/Cashflow.ml index 006bf461d..a4231b978 100644 --- a/src/base/Cashflow.ml +++ b/src/base/Cashflow.ml @@ -187,12 +187,12 @@ struct match s with | Load (x, y) -> CFSyntax.Load (add_noinfo_to_ident x, add_noinfo_to_ident y) - | RemoteLoad (x, adr, y, is_mutable) -> + | RemoteLoad (x, adr, y, mutability) -> CFSyntax.RemoteLoad ( add_noinfo_to_ident x, add_noinfo_to_ident adr, add_noinfo_to_ident y, - is_mutable) + mutability) | Store (x, y) -> CFSyntax.Store (add_noinfo_to_ident x, add_noinfo_to_ident y) | Bind (x, e) -> CFSyntax.Bind (add_noinfo_to_ident x, cf_init_tag_expr e) @@ -209,12 +209,12 @@ struct add_noinfo_to_ident m, List.map ~f:add_noinfo_to_ident ks, retrieve ) - | RemoteMapGet (x, adr, m, is_mutable, ks, retrieve) -> + | RemoteMapGet (x, adr, m, mutability, ks, retrieve) -> CFSyntax.RemoteMapGet ( add_noinfo_to_ident x, add_noinfo_to_ident adr, add_noinfo_to_ident m, - is_mutable, + mutability, List.map ~f:add_noinfo_to_ident ks, retrieve ) | MatchStmt (x, pss) -> @@ -1626,13 +1626,13 @@ struct (not @@ [%equal: ECFR.money_tag] (get_id_tag new_x) (get_id_tag x)) || not @@ [%equal: ECFR.money_tag] (get_id_tag new_f) (get_id_tag f) ) - | RemoteLoad (x, adr, f, is_mutable) -> + | RemoteLoad (x, adr, f, mutability) -> (* TODO - see Load case for inspiration *) (* x is no longer in scope, so remove from local_env *) let new_local_env = AssocDictionary.remove (CFIdentifier.as_string x) local_env in - ( RemoteLoad (x, adr, f, is_mutable), + ( RemoteLoad (x, adr, f, mutability), param_env, field_env, new_local_env, @@ -1764,13 +1764,13 @@ struct (not @@ [%equal: ECFR.money_tag] (get_id_tag x) new_x_tag) || (not @@ [%equal: ECFR.money_tag] (get_id_tag m) m_tag) || (not @@ [%equal: _] new_ks ks) ) - | RemoteMapGet (x, adr, m, is_mutable, ks, fetch) -> + | RemoteMapGet (x, adr, m, mutability, ks, fetch) -> (* TODO - see MapGet case for inspiration *) (* x is no longer in scope, so remove from local_env *) let new_local_env = AssocDictionary.remove (CFIdentifier.as_string x) local_env in - ( RemoteMapGet (x, adr, m, is_mutable, ks, fetch), + ( RemoteMapGet (x, adr, m, mutability, ks, fetch), param_env, field_env, new_local_env, diff --git a/src/base/DeadCodeDetector.ml b/src/base/DeadCodeDetector.ml index e14092dd2..a77578f9d 100644 --- a/src/base/DeadCodeDetector.ml +++ b/src/base/DeadCodeDetector.ml @@ -370,7 +370,7 @@ module DeadCodeDetector (SR : Rep) (ER : Rep) = struct else ( warn "Unused load statement to: " x ER.get_loc; (lv, adts, ctrs)) - | RemoteLoad (x, addr, m, _is_mutable) -> + | RemoteLoad (x, addr, m, _mutability) -> FieldsState.mark_field_read fs m; (* m is a field, thus we don't track its liveness *) if ERSet.mem lv x then @@ -401,7 +401,7 @@ module DeadCodeDetector (SR : Rep) (ER : Rep) = struct else ( warn "Unused map get statement to: " x ER.get_loc; (lv, adts, ctrs)) - | RemoteMapGet (x, addr, i, _is_mutable, il, _) -> + | RemoteMapGet (x, addr, i, _mutability, il, _) -> (* i is a field, thus we don't track its liveness *) FieldsState.mark_field_read fs i; if ERSet.mem lv x then diff --git a/src/base/Disambiguate.ml b/src/base/Disambiguate.ml index ca38fd61e..cd3c8836c 100644 --- a/src/base/Disambiguate.ml +++ b/src/base/Disambiguate.ml @@ -537,7 +537,7 @@ module ScillaDisambiguation (SR : Rep) (ER : Rep) = struct remove_local_id_from_dict var_dict_acc (as_string x) in pure @@ (PostDisSyntax.Load (dis_x, dis_f), new_var_dict) - | RemoteLoad (x, adr, f, is_mutable) -> + | RemoteLoad (x, adr, f, mutability) -> let%bind dis_x = name_def_as_simple_global x in (* adr may be defined anywhere, so must be disambiguated *) let%bind dis_adr = @@ -550,7 +550,7 @@ module ScillaDisambiguation (SR : Rep) (ER : Rep) = struct remove_local_id_from_dict var_dict_acc (as_string x) in pure - @@ (PostDisSyntax.RemoteLoad (dis_x, dis_adr, dis_f, is_mutable), new_var_dict) + @@ (PostDisSyntax.RemoteLoad (dis_x, dis_adr, dis_f, mutability), new_var_dict) | Store (f, x) -> (* f must be a locally defined field *) let%bind dis_f = name_def_as_simple_global f in @@ -598,7 +598,7 @@ module ScillaDisambiguation (SR : Rep) (ER : Rep) = struct in pure @@ (PostDisSyntax.MapGet (dis_x, dis_m, dis_ks, fetch), new_var_dict) - | RemoteMapGet (x, adr, m, is_mutable, ks, fetch) -> + | RemoteMapGet (x, adr, m, mutability, ks, fetch) -> let%bind dis_x = name_def_as_simple_global x in (* adr may be defined anywhere, so must be disambiguated *) let%bind dis_adr = @@ -617,7 +617,7 @@ module ScillaDisambiguation (SR : Rep) (ER : Rep) = struct in pure @@ ( PostDisSyntax.RemoteMapGet - (dis_x, dis_adr, dis_m, is_mutable, dis_ks, fetch), + (dis_x, dis_adr, dis_m, mutability, dis_ks, fetch), new_var_dict ) | MatchStmt (x, pss) -> let%bind dis_x = diff --git a/src/base/ParserUtil.ml b/src/base/ParserUtil.ml index 0ce5385b8..a1d371d8a 100644 --- a/src/base/ParserUtil.ml +++ b/src/base/ParserUtil.ml @@ -107,7 +107,7 @@ module type Syn = sig ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t - * bool + * field_mutability | Store of ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t | Bind of ParserRep.rep SIdentifier.t * expr_annot (* m[k1][k2][..] := v OR delete m[k1][k2][...] *) @@ -127,7 +127,7 @@ module type Syn = sig ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t - * bool + * field_mutability * ParserRep.rep SIdentifier.t list * bool | MatchStmt of diff --git a/src/base/PatternChecker.ml b/src/base/PatternChecker.ml index 098ba39ce..3feb1efc9 100644 --- a/src/base/PatternChecker.ml +++ b/src/base/PatternChecker.ml @@ -249,16 +249,16 @@ struct let%bind checked_s = match s with | Load (i, x) -> pure @@ (CheckedPatternSyntax.Load (i, x), rep) - | RemoteLoad (i, adr, x, is_mutable) -> - pure @@ (CheckedPatternSyntax.RemoteLoad (i, adr, x, is_mutable), rep) + | RemoteLoad (i, adr, x, mutability) -> + pure @@ (CheckedPatternSyntax.RemoteLoad (i, adr, x, mutability), rep) | Store (i, x) -> pure @@ (CheckedPatternSyntax.Store (i, x), rep) | MapUpdate (m, klist, v) -> pure @@ (CheckedPatternSyntax.MapUpdate (m, klist, v), rep) | MapGet (v, m, klist, valfetch) -> pure @@ (CheckedPatternSyntax.MapGet (v, m, klist, valfetch), rep) - | RemoteMapGet (v, adr, m, is_mutable, klist, valfetch) -> + | RemoteMapGet (v, adr, m, mutability, klist, valfetch) -> pure - @@ ( CheckedPatternSyntax.RemoteMapGet (v, adr, m, is_mutable, klist, valfetch), + @@ ( CheckedPatternSyntax.RemoteMapGet (v, adr, m, mutability, klist, valfetch), rep ) | Bind (i, e) -> wrap_pmcheck_serr srep diff --git a/src/base/Recursion.ml b/src/base/Recursion.ml index 71ce9d997..fac56ed4f 100644 --- a/src/base/Recursion.ml +++ b/src/base/Recursion.ml @@ -188,8 +188,8 @@ module ScillaRecursion (SR : Rep) (ER : Rep) = struct let%bind new_s = match s with | Load (x, f) -> pure @@ RecursionSyntax.Load (x, f) - | RemoteLoad (x, adr, f, is_mutable) -> - pure @@ RecursionSyntax.RemoteLoad (x, adr, f, is_mutable) + | RemoteLoad (x, adr, f, mutability) -> + pure @@ RecursionSyntax.RemoteLoad (x, adr, f, mutability) | Store (f, x) -> pure @@ RecursionSyntax.Store (f, x) | Bind (x, e) -> let%bind new_e = rec_exp e in @@ -198,8 +198,8 @@ module ScillaRecursion (SR : Rep) (ER : Rep) = struct pure @@ RecursionSyntax.MapUpdate (m, is, vopt) | MapGet (x, m, is, del) -> pure @@ RecursionSyntax.MapGet (x, m, is, del) - | RemoteMapGet (x, adr, m, is_mutable, is, del) -> - pure @@ RecursionSyntax.RemoteMapGet (x, adr, m, is_mutable, is, del) + | RemoteMapGet (x, adr, m, mutability, is, del) -> + pure @@ RecursionSyntax.RemoteMapGet (x, adr, m, mutability, is, del) | MatchStmt (x, pss) -> let%bind new_pss = mapM diff --git a/src/base/ScillaParser.mly b/src/base/ScillaParser.mly index b82067f46..5257d19ff 100644 --- a/src/base/ScillaParser.mly +++ b/src/base/ScillaParser.mly @@ -437,23 +437,23 @@ stmt: remote_fetch_stmt: | l = ID; FETCH; AND; adr = ID; PERIOD; r = sident - { RemoteLoad (to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), r, true), toLoc $startpos } + { RemoteLoad (to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), r, Mutable), toLoc $startpos } | (* Reading _sender._balance or _origin._balance *) l = ID; FETCH; AND; adr = SPID; PERIOD; r = SPID - { RemoteLoad (to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), true), toLoc $startpos } + { RemoteLoad (to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), Mutable), toLoc $startpos } | (* Reading immutable fields *) l = ID; FETCH; AND; adr = ID; PERIOD; LPAREN; r = sident; RPAREN; keys = list(map_access) { match keys with - | [] -> RemoteLoad (to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), r, false), toLoc $startpos - | _ -> RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), r, false, keys, true), toLoc $startpos + | [] -> RemoteLoad (to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), r, Immutable), toLoc $startpos + | _ -> RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), r, Immutable, keys, true), toLoc $startpos } | l = ID; FETCH; AND; adr = ID; PERIOD; r = ID; keys = nonempty_list(map_access) - { RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), true, keys, true), toLoc $startpos } + { RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), Mutable, keys, true), toLoc $startpos } | l = ID; FETCH; AND; EXISTS; adr = ID; PERIOD; r = ID; keys = nonempty_list(map_access) - { RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), true, keys, false), toLoc $startpos } + { RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), Mutable, keys, false), toLoc $startpos } | l = ID; FETCH; AND; EXISTS; adr = ID; PERIOD; LPAREN; r = ID; RPAREN; keys = nonempty_list(map_access) - { RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), false, keys, false), toLoc $startpos } + { RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), Immutable, keys, false), toLoc $startpos } | (* Adding this production in preparation for address type casts *) l = ID; FETCH; AND; adr = sident; AS; t = address_typ { TypeCast(to_loc_id l (toLoc $startpos(l)), adr, t), toLoc $startpos } diff --git a/src/base/Syntax.ml b/src/base/Syntax.ml index 4ae42fb44..526177764 100644 --- a/src/base/Syntax.ml +++ b/src/base/Syntax.ml @@ -205,6 +205,16 @@ type component_type = CompTrans | CompProc [@@deriving sexp] let component_type_to_string ctp = match ctp with CompTrans -> "transition" | CompProc -> "procedure" +(*******************************************************) +(* Field mutability (for remote reads) *) +(*******************************************************) + +type field_mutability = Mutable | Immutable [@@deriving sexp] + +let is_mutable = function + | Mutable -> true + | Immutable -> false + (*******************************************************) (* Annotations *) (*******************************************************) @@ -317,9 +327,9 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct | Load of ER.rep SIdentifier.t * ER.rep SIdentifier.t (** [Load(I1, I2)] represents: [I1 <- I2] *) | RemoteLoad of - ER.rep SIdentifier.t * ER.rep SIdentifier.t * ER.rep SIdentifier.t * bool - (** [RemoteLoad(I1, I2, I3, true)] represents: [I1 <- & I2.I3] (reading a mutable field) - * [RemoteLoad(I1, I2, I3, false)] represents: [I1 <- & I2.(I3)] (reading a contract parameter) *) + ER.rep SIdentifier.t * ER.rep SIdentifier.t * ER.rep SIdentifier.t * field_mutability + (** [RemoteLoad(I1, I2, I3, Mutable)] represents: [I1 <- & I2.I3] (reading a contract state field) + * [RemoteLoad(I1, I2, I3, Immutable)] represents: [I1 <- & I2.(I3)] (reading a contract parameter) *) | Store of ER.rep SIdentifier.t * ER.rep SIdentifier.t (** [Store(I1, I2)] represents: [I1 := I2] *) | Bind of ER.rep SIdentifier.t * expr_annot @@ -343,14 +353,14 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct ER.rep SIdentifier.t * ER.rep SIdentifier.t * ER.rep SIdentifier.t - * bool + * field_mutability * ER.rep SIdentifier.t list * bool (** [RemoteMapGet(V, Adr, M, IsMutable, [K1; ...; Kn], Retrieve)] represents: - * [V <- & Adr.(M)[K1]...[Kn]] if [IsMutable] is [false] and [Retrieve] is [true] - * [V <- & exists Adr.(M)[K1]...[Kn]] if [IsMutable] is [false] and [Retrieve] is [true] - * [V <- & Adr.M[K1]...[Kn]] if [IsMutable] is [true] and [Retrieve] is [true] - * [V <- & exists Adr.M[K1]...[Kn]] if [IsMutable] is [true] and [Retrieve] is [false] *) + * [V <- & Adr.(M)[K1]...[Kn]] if [IsMutable] is [Immutable] and [Retrieve] is [true] + * [V <- & exists Adr.(M)[K1]...[Kn]] if [IsMutable] is [Immutable] and [Retrieve] is [false] + * [V <- & Adr.M[K1]...[Kn]] if [IsMutable] is [Mutable] and [Retrieve] is [true] + * [V <- & exists Adr.M[K1]...[Kn]] if [IsMutable] is [Mutable] and [Retrieve] is [false] *) | MatchStmt of ER.rep SIdentifier.t * (pattern * stmt_annot list) list (** [MatchStmt(I, [(P1; S1); ...; (Pn; Sn)])] represents: [match I with @@ -606,12 +616,9 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct | Load (x, f) -> sprintf "Type error in reading value of `%s` into `%s`:\n %s" (as_error_string f) (as_error_string x) phase - | RemoteLoad (x, adr, f, true) -> - sprintf "Type error in reading value of `%s.%s` into `%s`:\n %s" - (as_error_string adr) (as_error_string f) (as_error_string x) phase - | RemoteLoad (x, adr, f, false) -> - sprintf "Type error in reading value of `%s.(%s)` into `%s`:\n %s" - (as_error_string adr) (as_error_string f) (as_error_string x) phase + | RemoteLoad (x, adr, f, mutability) -> + sprintf "Type error in reading value of `%s.%s%s%s` into `%s`:\n %s" + (as_error_string adr) (if is_mutable mutability then "" else "(") (as_error_string f) (if is_mutable mutability then "" else ")") (as_error_string x) phase | Store (f, r) -> sprintf "Type error in storing value of `%s` into the field `%s`:\n" (as_error_string r) (as_error_string f) @@ -623,15 +630,11 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct ^ List.fold keys ~init:"" ~f:(fun acc k -> acc ^ "[" ^ as_error_string k ^ "]") ^ "\n" - | RemoteMapGet (_, adr, m, true, keys, _) -> - sprintf "Type error in getting map value %s.%s" (as_error_string adr) - (as_error_string m) - ^ List.fold keys ~init:"" ~f:(fun acc k -> - acc ^ "[" ^ as_error_string k ^ "]") - ^ "\n" - | RemoteMapGet (_, adr, m, false, keys, _) -> - sprintf "Type error in getting map value %s.(%s)" (as_error_string adr) + | RemoteMapGet (_, adr, m, mutability, keys, _) -> + sprintf "Type error in getting map value %s.%s%s%s" (as_error_string adr) + (if is_mutable mutability then "" else "(") (as_error_string m) + (if is_mutable mutability then "" else ")") ^ List.fold keys ~init:"" ~f:(fun acc k -> acc ^ "[" ^ as_error_string k ^ "]") ^ "\n" diff --git a/src/base/SyntaxAnnotMapper.ml b/src/base/SyntaxAnnotMapper.ml index a0edf2202..9453a7e6b 100644 --- a/src/base/SyntaxAnnotMapper.ml +++ b/src/base/SyntaxAnnotMapper.ml @@ -180,8 +180,8 @@ struct let rec statement stmt ~fe ~fl ~fs = match stmt with | Load (id, field) -> OutputSyntax.Load (map_id fe id, map_id fe field) - | RemoteLoad (id, addr, field, is_mutable) -> - OutputSyntax.RemoteLoad (map_id fe id, map_id fe addr, map_id fe field, is_mutable) + | RemoteLoad (id, addr, field, mutability) -> + OutputSyntax.RemoteLoad (map_id fe id, map_id fe addr, map_id fe field, mutability) | Store (field, value) -> OutputSyntax.Store (map_id fe field, map_id fe value) | Bind (id, e) -> OutputSyntax.Bind (map_id fe id, expr_annot e ~fe ~fl ~fs) @@ -196,12 +196,12 @@ struct map_id fe map, List.map keys ~f:(fun k -> map_id fe k), mode ) - | RemoteMapGet (value, addr, map, is_mutable, keys, mode) -> + | RemoteMapGet (value, addr, map, mutability, keys, mode) -> OutputSyntax.RemoteMapGet ( map_id fe value, map_id fe addr, map_id fe map, - is_mutable, + mutability, List.map keys ~f:(fun k -> map_id fe k), mode ) | MatchStmt (matchee, branches) -> diff --git a/src/base/TypeChecker.ml b/src/base/TypeChecker.ml index 2b9389a33..8ae2367d1 100644 --- a/src/base/TypeChecker.ml +++ b/src/base/TypeChecker.ml @@ -643,7 +643,7 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct @@ add_stmt_to_stmts_env_gas (TypedSyntax.Load (typed_x, typed_f), rep) checked_stmts - | RemoteLoad (x, adr, f, is_mutable) -> + | RemoteLoad (x, adr, f, mutability) -> let lc = get_rep adr in let%bind pure', adr_type, ident_type = let%bind adr_typ = @@ -651,7 +651,7 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct in let%bind fr = fromR_TE - @@ address_field_type (ER.get_loc lc) f (rr_typ adr_typ).tp is_mutable + @@ address_field_type (ER.get_loc lc) f (rr_typ adr_typ).tp (is_mutable mutability) in pure @@ ((x, fr), rr_typ adr_typ, mk_qual_tp fr) in @@ -664,7 +664,7 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct let typed_f = add_type_to_ident f ident_type in pure @@ add_stmt_to_stmts_env_gas - (TypedSyntax.RemoteLoad (typed_x, typed_adr, typed_f, is_mutable), rep) + (TypedSyntax.RemoteLoad (typed_x, typed_adr, typed_f, mutability), rep) checked_stmts | Store (f, r) -> if List.mem ~equal:[%equal: TCName.t] no_store_fields (get_id f) @@ -769,10 +769,10 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct ( TypedSyntax.MapGet (typed_v, typed_m, typed_klist, valfetch), rep ) checked_stmts - | RemoteMapGet (v, adr, m, is_mutable, klist, valfetch) -> + | RemoteMapGet (v, adr, m, mutability, klist, valfetch) -> let%bind typed_adr, typed_m, typed_klist, v_type = let%bind typed_adr, typed_m, typed_klist, v_type = - type_remote_map_access env adr m is_mutable klist + type_remote_map_access env adr m (is_mutable mutability) klist in pure @@ (typed_adr, typed_m, typed_klist, v_type) in @@ -789,7 +789,7 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct pure @@ add_stmt_to_stmts_env_gas ( TypedSyntax.RemoteMapGet - (typed_v, typed_adr, typed_m, is_mutable, typed_klist, valfetch), + (typed_v, typed_adr, typed_m, mutability, typed_klist, valfetch), rep ) checked_stmts | ReadFromBC (x, bf) -> diff --git a/src/base/TypeInfo.ml b/src/base/TypeInfo.ml index 427b03998..b59b5a332 100644 --- a/src/base/TypeInfo.ml +++ b/src/base/TypeInfo.ml @@ -100,7 +100,7 @@ struct List.fold_right stmts ~init:[] ~f:(fun (stmt, _srep) acc -> (match stmt with | Load (x, f) | Store (f, x) -> [ calc_ident_locs x; calc_ident_locs f ] - | RemoteLoad (x, adr, f, _is_mutable) -> + | RemoteLoad (x, adr, f, _mutability) -> [ calc_ident_locs x; calc_ident_locs adr; calc_ident_locs f ] | Bind (x, e) -> calc_ident_locs x :: type_info_expr e (* m[k1][k2][..] := v OR delete m[k1][k2][...] *) @@ -112,7 +112,7 @@ struct | MapGet (x, m, il, _) -> [ calc_ident_locs x; calc_ident_locs m ] @ List.map il ~f:calc_ident_locs - | RemoteMapGet (x, adr, m, _is_mutable, il, _) -> + | RemoteMapGet (x, adr, m, _mutability, il, _) -> [ calc_ident_locs x; calc_ident_locs adr; calc_ident_locs m ] @ List.map il ~f:calc_ident_locs | MatchStmt (o, clauses) -> diff --git a/src/eval/Eval.ml b/src/eval/Eval.ml index ec3a2b92c..87df40efb 100644 --- a/src/eval/Eval.ml +++ b/src/eval/Eval.ml @@ -372,11 +372,11 @@ let rec stmt_eval conf stmts = let%bind l = Configuration.load conf r in let conf' = Configuration.bind conf (get_id x) l in stmt_eval conf' sts - | RemoteLoad (x, adr, r, is_mutable) -> ( + | RemoteLoad (x, adr, r, mutability) -> ( let%bind a = fromR @@ Configuration.lookup conf adr in match a with | ByStrX s' when Bystrx.width s' = Type.address_length -> - let%bind l = Configuration.remote_load conf s' r is_mutable in + let%bind l = Configuration.remote_load conf s' r (is_mutable mutability) in let conf' = Configuration.bind conf (get_id x) l in stmt_eval conf' sts | _ -> @@ -410,7 +410,7 @@ let rec stmt_eval conf stmts = let%bind l = Configuration.map_get conf m klist' fetchval in let conf' = Configuration.bind conf (get_id x) l in stmt_eval conf' sts - | RemoteMapGet (x, adr, m, is_mutable, klist, fetchval) -> ( + | RemoteMapGet (x, adr, m, mutability, klist, fetchval) -> ( let%bind a = fromR @@ Configuration.lookup conf adr in match a with | ByStrX abystr when Bystrx.width abystr = Type.address_length -> @@ -418,7 +418,7 @@ let rec stmt_eval conf stmts = mapM ~f:(fun k -> fromR @@ Configuration.lookup conf k) klist in let%bind l = - Configuration.remote_map_get abystr m is_mutable klist' fetchval + Configuration.remote_map_get abystr m (is_mutable mutability) klist' fetchval in let conf' = Configuration.bind conf (get_id x) l in stmt_eval conf' sts diff --git a/src/formatter/ExtendedSyntax.ml b/src/formatter/ExtendedSyntax.ml index 203d5b042..c2395bf13 100644 --- a/src/formatter/ExtendedSyntax.ml +++ b/src/formatter/ExtendedSyntax.ml @@ -88,7 +88,7 @@ struct and stmt = | Load of ER.rep id_ann * ER.rep id_ann - | RemoteLoad of ER.rep id_ann * ER.rep id_ann * ER.rep id_ann * bool + | RemoteLoad of ER.rep id_ann * ER.rep id_ann * ER.rep id_ann * Syntax.field_mutability | Store of ER.rep id_ann * ER.rep id_ann | Bind of ER.rep id_ann * expr_annot | MapUpdate of ER.rep id_ann * ER.rep id_ann list * ER.rep id_ann option @@ -97,7 +97,7 @@ struct ER.rep id_ann * ER.rep id_ann * ER.rep id_ann - * bool + * Syntax.field_mutability * ER.rep id_ann list * bool | MatchStmt of @@ -568,7 +568,7 @@ struct let lhs' = extend_er_id tr lhs in let rhs' = extend_er_id tr rhs in (ExtSyn.Load (lhs', rhs'), ann, c) - | Syn.RemoteLoad (lhs, addr, rhs, is_mutable) -> + | Syn.RemoteLoad (lhs, addr, rhs, mutability) -> let c = comment (loc_end_er lhs) in let lhs' = extend_er_id tr lhs ~rep_end:(Some (SIdentifier.get_rep addr)) @@ -577,7 +577,7 @@ struct extend_er_id tr addr ~rep_end:(Some (SIdentifier.get_rep rhs)) in let rhs' = extend_er_id tr rhs in - (ExtSyn.RemoteLoad (lhs', addr', rhs', is_mutable), ann, c) + (ExtSyn.RemoteLoad (lhs', addr', rhs', mutability), ann, c) | Syn.Store (lhs, rhs) -> let c = comment (loc_end_er lhs) in let lhs' = extend_er_id tr lhs in @@ -603,13 +603,13 @@ struct let m' = extend_er_id tr m in let keys' = List.map keys ~f:(fun k -> extend_er_id tr k) in (ExtSyn.MapGet (v', m', keys', retrieve), ann, c) - | Syn.RemoteMapGet (v, addr, m, is_mutable, keys, retrieve) -> + | Syn.RemoteMapGet (v, addr, m, mutability, keys, retrieve) -> let c = comment (loc_end_er v) in let v' = extend_er_id tr v in let addr' = extend_er_id tr addr in let m' = extend_er_id tr m in let keys' = List.map keys ~f:(fun k -> extend_er_id tr k) in - (ExtSyn.RemoteMapGet (v', addr', m', is_mutable, keys', retrieve), ann, c) + (ExtSyn.RemoteMapGet (v', addr', m', mutability, keys', retrieve), ann, c) | Syn.MatchStmt (id, arms) -> let c = comment (loc_end_er id) in let id' = extend_er_id tr id in diff --git a/src/formatter/Formatter.ml b/src/formatter/Formatter.ml index bf8692099..663dcef6b 100644 --- a/src/formatter/Formatter.ml +++ b/src/formatter/Formatter.ml @@ -360,8 +360,8 @@ struct | GasExpr _ -> failwith "Gas annotations cannot appear in user contracts's expressions" ) |> wrap_comments comments - let of_map_access map immutable_remote_field keys = - let map = if immutable_remote_field then lparen ^^ of_ann_id map ^^ rparen else of_ann_id map + let of_map_access map mutable_remote_field keys = + let map = if mutable_remote_field then of_ann_id map else lparen ^^ of_ann_id map ^^ rparen and keys = concat_map (fun k -> brackets @@ of_ann_id k) keys in map ^^ keys @@ -369,8 +369,8 @@ struct (match stmt with | Ast.Load (id, field) -> of_ann_id id ^^^ rev_arrow ^//^ of_ann_id field - | Ast.RemoteLoad (id, addr, field, is_mutable) -> - if is_mutable then + | Ast.RemoteLoad (id, addr, field, mutability) -> + if Syntax.is_mutable mutability then of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ of_ann_id field else of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ lparen ^^ of_ann_id field ^^ rparen @@ -381,25 +381,25 @@ struct | Ast.MapUpdate (map, keys, mode) -> (* m[k1][k2][..] := v OR delete m[k1][k2][...] *) (match mode with - | Some value -> of_map_access map false keys ^^^ assign ^//^ of_ann_id value - | None -> delete_kwd ^^^ of_map_access map false keys) + | Some value -> of_map_access map true keys ^^^ assign ^//^ of_ann_id value + | None -> delete_kwd ^^^ of_map_access map true keys) | Ast.MapGet (id, map, keys, mode) -> (* v <- m[k1][k2][...] OR b <- exists m[k1][k2][...] *) (* If the bool is set, then we interpret this as value retrieve, otherwise as an "exists" query. *) if mode then - of_ann_id id ^^^ rev_arrow ^//^ of_map_access map false keys + of_ann_id id ^^^ rev_arrow ^//^ of_map_access map true keys else - of_ann_id id ^^^ rev_arrow ^//^ exists_kwd ^^^ of_map_access map false keys - | Ast.RemoteMapGet (id, addr, map, is_mutable, keys, mode) -> + of_ann_id id ^^^ rev_arrow ^//^ exists_kwd ^^^ of_map_access map true keys + | Ast.RemoteMapGet (id, addr, map, mutability, keys, mode) -> (* v <-& adr.(m)[k1][k2][...] OR b <-& exists adr.(m)[k1][k2][...] OR v <-& adr.m[k1][k2][...] OR b <-& exists adr.m[k1][k2][...] *) (* If mode is set, then we interpret this as value retrieve, otherwise as an "exists" query. *) if mode then - of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ of_map_access map (not is_mutable) keys + of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ of_map_access map (Syntax.is_mutable mutability) keys else - of_ann_id id ^^^ blockchain_arrow ^//^ exists_kwd ^^^ of_ann_id addr ^^ dot ^^ of_map_access map (not is_mutable) keys + of_ann_id id ^^^ blockchain_arrow ^//^ exists_kwd ^^^ of_ann_id addr ^^ dot ^^ of_map_access map (Syntax.is_mutable mutability) keys | Ast.MatchStmt (id, branches) -> match_kwd ^^^ of_ann_id id ^^^ with_kwd ^/^ separate_map hardline diff --git a/src/merge/Merge.ml b/src/merge/Merge.ml index f32c9a9db..76858a204 100644 --- a/src/merge/Merge.ml +++ b/src/merge/Merge.ml @@ -449,19 +449,19 @@ module ScillaMerger (SR : Rep) (ER : Rep) = struct let m' = rename_local_er renames_map m in let keys' = List.map keys ~f:(fun k -> rename_local_er renames_map k) in (MapGet (v', m', keys', exists), annot) - | RemoteMapGet (v, adr, m, is_mutable, keys, exists) -> + | RemoteMapGet (v, adr, m, mutability, keys, exists) -> (* Map will be replaced to the local one in the Remote pass. *) let v' = rename_local_er renames_map v in let keys' = List.map keys ~f:(fun k -> rename_local_er renames_map k) in - (RemoteMapGet (v', adr, m, is_mutable, keys', exists), annot) + (RemoteMapGet (v', adr, m, mutability, keys', exists), annot) | Load (lhs, rhs) -> let lhs' = rename_local_er renames_map lhs in let rhs' = rename_local_er renames_map rhs in (Load (lhs', rhs'), annot) - | RemoteLoad (lhs, adr, rhs, is_mutable) -> + | RemoteLoad (lhs, adr, rhs, mutability) -> (* The Remote pass will remove address and rename [rhs]. *) let lhs' = rename_local_er renames_map lhs in - (RemoteLoad (lhs', adr, rhs, is_mutable), annot) + (RemoteLoad (lhs', adr, rhs, mutability), annot) | Store (lhs, rhs) -> let lhs' = rename_local_er renames_map lhs in let rhs' = rename_local_er renames_map rhs in @@ -715,16 +715,16 @@ module ScillaMerger (SR : Rep) (ER : Rep) = struct let rec localize_stmt renames_map (stmt, annot) = match stmt with - | RemoteLoad (l, _, v, is_mutable) -> + | RemoteLoad (l, _, v, mutability) -> let v' = remote_rename_er renames_map v in - if is_mutable then + if is_mutable mutability then (Load (l, v'), annot) else (* Immutable fields exist in the same namespace as local variables *) (Bind (l, (Var v', PIdentifier.get_rep v')), annot) - | RemoteMapGet (l, _, m, is_mutable, keys, exists) -> + | RemoteMapGet (l, _, m, mutability, keys, exists) -> let m' = remote_rename_er renames_map m in - if is_mutable then + if is_mutable mutability then (MapGet (l, m', keys, exists), annot) else (* Immutable fields exist in the same namespace as local variables. From 1cf0b70fdb515138159c607f85ba53aca56dbada Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Fri, 18 Nov 2022 11:33:42 +0100 Subject: [PATCH 04/33] Save game - adding immutable fields to address types --- TODO.txt | 18 ++++++++++++ src/base/Disambiguate.ml | 4 +-- src/base/ParserUtil.ml | 4 +-- src/base/ScillaParser.mly | 2 +- src/base/Syntax.ml | 20 ++++--------- src/base/SyntaxAnnotMapper.ml | 2 +- src/base/Type.ml | 53 ++++++++++++++++++++++++++--------- src/base/TypeChecker.ml | 4 +-- src/base/TypeUtil.ml | 2 +- 9 files changed, 71 insertions(+), 38 deletions(-) create mode 100644 TODO.txt diff --git a/TODO.txt b/TODO.txt new file mode 100644 index 000000000..91848d4b3 --- /dev/null +++ b/TODO.txt @@ -0,0 +1,18 @@ +Cashflow.ml: Distinguish between mutable and immutable fields +DeadCodeDetector: get_used_address_fields needs to distinguish between mutable and immutable fields +Gas.ml: Need to figure out how much gas to charge. Currently charging the same amount of gas as for remote reads of immutable fields, but this should either be changed to charge an amount corresponding to the size of init.json, or requires a database migration so that immutables can be read from LevelDB. +ScillaParser.mly: Need to add syntax for immutables to address types and remote reads +TypeChecker.ml: Need to handle is_mutable in address_field_type and type_remote_map_access. Maybe pass Mutable/Immutable instead of bool. +TypeUtil.ml: Need to handle is_mutable in address_field_type +StateService.ml: Nedd to handle mutable_field in external_fetch +EvalUtil.ml: + * accept_incoming treats _balance as immutable, which might not work. + * is_contract_addr treats _this_address as immutable, which might not work. + * is_library_or_contract_addr treats _this_address, _balance and _nonce as immutable, which might not work. + * typecheck_remote_fields must handle immutable fields as well + * Note that the parser treats remote reads of _balance as mutable +Formatter.ml: of_map_access and of_stmt assumes x <-& addr.(v) syntax, which may change. + +Remember to test merge and formatter tools, as well as dead code detector. + +SyntaxAnnotMapper.ml: addr_kind needs to be checked for correctness. My guess is that map_id needs to take mutability into account. diff --git a/src/base/Disambiguate.ml b/src/base/Disambiguate.ml index cd3c8836c..4ebfd8923 100644 --- a/src/base/Disambiguate.ml +++ b/src/base/Disambiguate.ml @@ -222,11 +222,11 @@ module ScillaDisambiguation (SR : Rep) (ER : Rep) = struct | Address (ContrAddr fts) -> let%bind dis_fts = foldM (IdLoc_Comp.Map.to_alist fts) - ~init:PostDisType.IdLoc_Comp.Map.empty ~f:(fun acc (id, t) -> + ~init:PostDisType.IdLoc_Comp.Map.empty ~f:(fun acc ((id, mutability), t) -> let%bind dis_id = name_def_as_simple_global id in let%bind dis_t = recurse t in pure - @@ PostDisType.IdLoc_Comp.Map.set acc ~key:dis_id ~data:dis_t) + @@ PostDisType.IdLoc_Comp.Map.set acc ~key:(dis_id, mutability) ~data:dis_t) in pure @@ PostDisType.Address (ContrAddr dis_fts) in diff --git a/src/base/ParserUtil.ml b/src/base/ParserUtil.ml index a1d371d8a..8cd497b4c 100644 --- a/src/base/ParserUtil.ml +++ b/src/base/ParserUtil.ml @@ -107,7 +107,7 @@ module type Syn = sig ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t - * field_mutability + * Type.field_mutability | Store of ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t | Bind of ParserRep.rep SIdentifier.t * expr_annot (* m[k1][k2][..] := v OR delete m[k1][k2][...] *) @@ -127,7 +127,7 @@ module type Syn = sig ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t - * field_mutability + * Type.field_mutability * ParserRep.rep SIdentifier.t list * bool | MatchStmt of diff --git a/src/base/ScillaParser.mly b/src/base/ScillaParser.mly index 5257d19ff..a63f52b53 100644 --- a/src/base/ScillaParser.mly +++ b/src/base/ScillaParser.mly @@ -253,7 +253,7 @@ address_typ : then (* Add _this_address : ByStr20 to field list. This ensures the type is treated as a contract address *) let fs' = List.fold_left (fun acc (id, t) -> - SType.IdLoc_Comp.Map.set acc ~key:id ~data:t) SType.IdLoc_Comp.Map.empty fs + SType.IdLoc_Comp.Map.set acc ~key:(id, Mutable) ~data:t) SType.IdLoc_Comp.Map.empty fs in Address (ContrAddr fs') else raise (SyntaxError ("Invalid type", toLoc $startpos(d))) } diff --git a/src/base/Syntax.ml b/src/base/Syntax.ml index 526177764..042f92abd 100644 --- a/src/base/Syntax.ml +++ b/src/base/Syntax.ml @@ -205,16 +205,6 @@ type component_type = CompTrans | CompProc [@@deriving sexp] let component_type_to_string ctp = match ctp with CompTrans -> "transition" | CompProc -> "procedure" -(*******************************************************) -(* Field mutability (for remote reads) *) -(*******************************************************) - -type field_mutability = Mutable | Immutable [@@deriving sexp] - -let is_mutable = function - | Mutable -> true - | Immutable -> false - (*******************************************************) (* Annotations *) (*******************************************************) @@ -327,7 +317,7 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct | Load of ER.rep SIdentifier.t * ER.rep SIdentifier.t (** [Load(I1, I2)] represents: [I1 <- I2] *) | RemoteLoad of - ER.rep SIdentifier.t * ER.rep SIdentifier.t * ER.rep SIdentifier.t * field_mutability + ER.rep SIdentifier.t * ER.rep SIdentifier.t * ER.rep SIdentifier.t * Type.field_mutability (** [RemoteLoad(I1, I2, I3, Mutable)] represents: [I1 <- & I2.I3] (reading a contract state field) * [RemoteLoad(I1, I2, I3, Immutable)] represents: [I1 <- & I2.(I3)] (reading a contract parameter) *) | Store of ER.rep SIdentifier.t * ER.rep SIdentifier.t @@ -353,7 +343,7 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct ER.rep SIdentifier.t * ER.rep SIdentifier.t * ER.rep SIdentifier.t - * field_mutability + * Type.field_mutability * ER.rep SIdentifier.t list * bool (** [RemoteMapGet(V, Adr, M, IsMutable, [K1; ...; Kn], Retrieve)] represents: @@ -618,7 +608,7 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct (as_error_string f) (as_error_string x) phase | RemoteLoad (x, adr, f, mutability) -> sprintf "Type error in reading value of `%s.%s%s%s` into `%s`:\n %s" - (as_error_string adr) (if is_mutable mutability then "" else "(") (as_error_string f) (if is_mutable mutability then "" else ")") (as_error_string x) phase + (as_error_string adr) (if Type.is_mutable mutability then "" else "(") (as_error_string f) (if Type.is_mutable mutability then "" else ")") (as_error_string x) phase | Store (f, r) -> sprintf "Type error in storing value of `%s` into the field `%s`:\n" (as_error_string r) (as_error_string f) @@ -632,9 +622,9 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct ^ "\n" | RemoteMapGet (_, adr, m, mutability, keys, _) -> sprintf "Type error in getting map value %s.%s%s%s" (as_error_string adr) - (if is_mutable mutability then "" else "(") + (if Type.is_mutable mutability then "" else "(") (as_error_string m) - (if is_mutable mutability then "" else ")") + (if Type.is_mutable mutability then "" else ")") ^ List.fold keys ~init:"" ~f:(fun acc k -> acc ^ "[" ^ as_error_string k ^ "]") ^ "\n" diff --git a/src/base/SyntaxAnnotMapper.ml b/src/base/SyntaxAnnotMapper.ml index 9453a7e6b..c0ab1e553 100644 --- a/src/base/SyntaxAnnotMapper.ml +++ b/src/base/SyntaxAnnotMapper.ml @@ -77,7 +77,7 @@ struct | AnyAddr | CodeAddr | LibAddr -> kind | ContrAddr fields_map -> let mapped_keys = - IdLoc_Comp.Map.map_keys_exn fields_map ~f:(fun f -> map_id fl f) + IdLoc_Comp.Map.map_keys_exn fields_map ~f:(fun (f, mutability) -> (map_id fl f, mutability)) in let mapped_values = IdLoc_Comp.Map.map mapped_keys ~f:(fun ty -> map_type ty ~fl) diff --git a/src/base/Type.ml b/src/base/Type.ml index c9202ed57..e301fb1b4 100644 --- a/src/base/Type.ml +++ b/src/base/Type.ml @@ -86,13 +86,32 @@ module PrimType = struct | Bystrx_typ b -> "ByStr" ^ Int.to_string b end +(*******************************************************) +(* Field mutability (for remote reads) *) +(*******************************************************) + +type field_mutability = Mutable | Immutable [@@deriving sexp] + +let is_mutable = function + | Mutable -> true + | Immutable -> false + module TIdentifier_Loc (TIdentifier : ScillaIdentifier) = struct - type t = loc TIdentifier.t + (* (x, true) = x is mutable * + * (x, false) = x is immutable *) + type t = loc TIdentifier.t * field_mutability [@@deriving sexp] + + let compare ((a, am) : t) ((b, bm) : t) = + match am, bm with + | Immutable, Mutable -> -1 + | Mutable, Immutable -> 1 + | _ -> TIdentifier.compare a b + let equal ((a, am) : t) ((b, bm) : t) = + match am, bm with + | Immutable, Mutable + | Mutable, Immutable -> false + | _ -> TIdentifier.equal a b - let compare (a : t) (b : t) = TIdentifier.compare a b - let equal (a : t) (b : t) = TIdentifier.equal a b - let sexp_of_t = TIdentifier.sexp_of_t (fun l -> sexp_of_loc l) - let t_of_sexp = TIdentifier.t_of_sexp (fun s -> loc_of_sexp s) end module IdLoc_Comp (TIdentifier : ScillaIdentifier) = struct @@ -245,16 +264,22 @@ module MkType (I : ScillaIdentifier) = struct | Address CodeAddr -> "ByStr20 with _codehash end" | Address LibAddr -> "ByStr20 with library end" | Address (ContrAddr fts) -> - let elems = - List.map (IdLoc_Comp.Map.to_alist fts) ~f:(fun (f, t) -> - sprintf "field %s : %s" - (if is_error then TIdentifier.as_error_string f - else TIdentifier.as_string f) - (recurser t)) - |> String.concat ~sep:", " + let mutables, immutables = + List.partition_map (IdLoc_Comp.Map.to_alist fts) ~f:(fun ((f, mutability), t) -> + let f_t_str = sprintf "%s : %s" + (if is_error then TIdentifier.as_error_string f + else TIdentifier.as_string f) + (recurser t) + in + if is_mutable mutability then + Second (sprintf "field %s" f_t_str) + else + First f_t_str) in - sprintf "ByStr20 with contract %s%send" elems - (if IdLoc_Comp.Map.is_empty fts then "" else " ") + let immutables_string = if List.is_empty immutables then "" else sprintf " (%s)" (String.concat ~sep:", " immutables) in + let mutables_string = if List.is_empty mutables then "" else sprintf " %s" (String.concat ~sep:", " mutables) in + sprintf "ByStr20 with contract%s%s end" immutables_string mutables_string + and with_paren t = match t with | FunType _ | PolyFun _ -> sprintf "(%s)" (recurser t) diff --git a/src/base/TypeChecker.ml b/src/base/TypeChecker.ml index 8ae2367d1..a5bd0963a 100644 --- a/src/base/TypeChecker.ml +++ b/src/base/TypeChecker.ml @@ -651,7 +651,7 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct in let%bind fr = fromR_TE - @@ address_field_type (ER.get_loc lc) f (rr_typ adr_typ).tp (is_mutable mutability) + @@ address_field_type (ER.get_loc lc) f (rr_typ adr_typ).tp (Type.is_mutable mutability) in pure @@ ((x, fr), rr_typ adr_typ, mk_qual_tp fr) in @@ -772,7 +772,7 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct | RemoteMapGet (v, adr, m, mutability, klist, valfetch) -> let%bind typed_adr, typed_m, typed_klist, v_type = let%bind typed_adr, typed_m, typed_klist, v_type = - type_remote_map_access env adr m (is_mutable mutability) klist + type_remote_map_access env adr m (Type.is_mutable mutability) klist in pure @@ (typed_adr, typed_m, typed_klist, v_type) in diff --git a/src/base/TypeUtil.ml b/src/base/TypeUtil.ml index 7f8bc083d..2f1b20e38 100644 --- a/src/base/TypeUtil.ml +++ b/src/base/TypeUtil.ml @@ -492,7 +492,7 @@ module TypeUtilities = struct pure @@ Option.value_exn preknown_field_type | Address (ContrAddr fts) -> ( let loc_removed = - List.map (IdLoc_Comp.Map.to_alist fts) ~f:(fun (f, t) -> + List.map (IdLoc_Comp.Map.to_alist fts) ~f:(fun ((f, _mut), t) -> (get_id f, t)) in match From f380a663b971e8ead595ced5bff39055bb5bfba9 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Fri, 18 Nov 2022 11:34:36 +0100 Subject: [PATCH 05/33] Add removal of TODO.txt to TODO.txt --- TODO.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TODO.txt b/TODO.txt index 91848d4b3..b46569e28 100644 --- a/TODO.txt +++ b/TODO.txt @@ -16,3 +16,5 @@ Formatter.ml: of_map_access and of_stmt assumes x <-& addr.(v) syntax, which may Remember to test merge and formatter tools, as well as dead code detector. SyntaxAnnotMapper.ml: addr_kind needs to be checked for correctness. My guess is that map_id needs to take mutability into account. + +TODO.txt: Remove file from repo once finished. From 8b953f6c9676ba0e0c82010ec536aed6149206d1 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Mon, 21 Nov 2022 16:12:21 +0100 Subject: [PATCH 06/33] Added immutable fields to address types --- TODO.txt | 20 -------------- src/base/DeadCodeDetector.ml | 4 +-- src/eval/Eval.ml | 4 +-- src/eval/EvalUtil.ml | 4 +-- src/formatter/ExtendedSyntax.ml | 4 +-- src/formatter/Formatter.ml | 49 ++++++++++++++++++++++----------- src/merge/Merge.ml | 4 +-- 7 files changed, 43 insertions(+), 46 deletions(-) delete mode 100644 TODO.txt diff --git a/TODO.txt b/TODO.txt deleted file mode 100644 index b46569e28..000000000 --- a/TODO.txt +++ /dev/null @@ -1,20 +0,0 @@ -Cashflow.ml: Distinguish between mutable and immutable fields -DeadCodeDetector: get_used_address_fields needs to distinguish between mutable and immutable fields -Gas.ml: Need to figure out how much gas to charge. Currently charging the same amount of gas as for remote reads of immutable fields, but this should either be changed to charge an amount corresponding to the size of init.json, or requires a database migration so that immutables can be read from LevelDB. -ScillaParser.mly: Need to add syntax for immutables to address types and remote reads -TypeChecker.ml: Need to handle is_mutable in address_field_type and type_remote_map_access. Maybe pass Mutable/Immutable instead of bool. -TypeUtil.ml: Need to handle is_mutable in address_field_type -StateService.ml: Nedd to handle mutable_field in external_fetch -EvalUtil.ml: - * accept_incoming treats _balance as immutable, which might not work. - * is_contract_addr treats _this_address as immutable, which might not work. - * is_library_or_contract_addr treats _this_address, _balance and _nonce as immutable, which might not work. - * typecheck_remote_fields must handle immutable fields as well - * Note that the parser treats remote reads of _balance as mutable -Formatter.ml: of_map_access and of_stmt assumes x <-& addr.(v) syntax, which may change. - -Remember to test merge and formatter tools, as well as dead code detector. - -SyntaxAnnotMapper.ml: addr_kind needs to be checked for correctness. My guess is that map_id needs to take mutability into account. - -TODO.txt: Remove file from repo once finished. diff --git a/src/base/DeadCodeDetector.ml b/src/base/DeadCodeDetector.ml index a77578f9d..7ac0051b5 100644 --- a/src/base/DeadCodeDetector.ml +++ b/src/base/DeadCodeDetector.ml @@ -555,7 +555,7 @@ module DeadCodeDetector (SR : Rep) (ER : Rep) = struct (** Returns a set of field names of the contract address type. *) let get_addr_fields addr = List.fold_left (SType.IdLoc_Comp.Map.keys addr) ~init:emp_idset - ~f:(fun s id -> SCIdentifierSet.add s (get_id id)) + ~f:(fun s (id, _mutability) -> SCIdentifierSet.add s (get_id id)) (** Updates a map of identifiers [m] iff [ty] has contract address type. [m] has the following structure: [id |-> F] where [F] is a set of field @@ -590,7 +590,7 @@ module DeadCodeDetector (SR : Rep) (ER : Rep) = struct -> ( match ty with | SType.Address (ContrAddr m) -> - List.iter (SType.IdLoc_Comp.Map.keys m) ~f:(fun id -> + List.iter (SType.IdLoc_Comp.Map.keys m) ~f:(fun (id, _mutability) -> let name = get_id id in if Set.mem fields name && (not @@ Set.mem used_fields name) then diff --git a/src/eval/Eval.ml b/src/eval/Eval.ml index 87df40efb..8d5e96c40 100644 --- a/src/eval/Eval.ml +++ b/src/eval/Eval.ml @@ -376,7 +376,7 @@ let rec stmt_eval conf stmts = let%bind a = fromR @@ Configuration.lookup conf adr in match a with | ByStrX s' when Bystrx.width s' = Type.address_length -> - let%bind l = Configuration.remote_load conf s' r (is_mutable mutability) in + let%bind l = Configuration.remote_load conf s' r (Type.is_mutable mutability) in let conf' = Configuration.bind conf (get_id x) l in stmt_eval conf' sts | _ -> @@ -418,7 +418,7 @@ let rec stmt_eval conf stmts = mapM ~f:(fun k -> fromR @@ Configuration.lookup conf k) klist in let%bind l = - Configuration.remote_map_get abystr m (is_mutable mutability) klist' fetchval + Configuration.remote_map_get abystr m (Type.is_mutable mutability) klist' fetchval in let conf' = Configuration.bind conf (get_id x) l in stmt_eval conf' sts diff --git a/src/eval/EvalUtil.ml b/src/eval/EvalUtil.ml index a2a178f3a..a295dc561 100644 --- a/src/eval/EvalUtil.ml +++ b/src/eval/EvalUtil.ml @@ -602,9 +602,9 @@ module EvalTypecheck = struct let typecheck_remote_fields ~caddr fts = (* Check that all fields are defined at caddr, and that their types are assignable to what is expected *) - allM fts ~f:(fun (f, t) -> + allM fts ~f:(fun ((f, mutability), t) -> let%bind res = - StateService.external_fetch ~caddr ~fname:f ~_mutable_field:true ~keys:[] ~ignoreval:true + StateService.external_fetch ~caddr ~fname:f ~_mutable_field:(Type.is_mutable mutability) ~keys:[] ~ignoreval:true in match res with | _, Some ext_typ -> diff --git a/src/formatter/ExtendedSyntax.ml b/src/formatter/ExtendedSyntax.ml index c2395bf13..6c7229ef5 100644 --- a/src/formatter/ExtendedSyntax.ml +++ b/src/formatter/ExtendedSyntax.ml @@ -88,7 +88,7 @@ struct and stmt = | Load of ER.rep id_ann * ER.rep id_ann - | RemoteLoad of ER.rep id_ann * ER.rep id_ann * ER.rep id_ann * Syntax.field_mutability + | RemoteLoad of ER.rep id_ann * ER.rep id_ann * ER.rep id_ann * Type.field_mutability | Store of ER.rep id_ann * ER.rep id_ann | Bind of ER.rep id_ann * expr_annot | MapUpdate of ER.rep id_ann * ER.rep id_ann list * ER.rep id_ann option @@ -97,7 +97,7 @@ struct ER.rep id_ann * ER.rep id_ann * ER.rep id_ann - * Syntax.field_mutability + * Type.field_mutability * ER.rep id_ann list * bool | MatchStmt of diff --git a/src/formatter/Formatter.ml b/src/formatter/Formatter.ml index 663dcef6b..6f873b8c2 100644 --- a/src/formatter/Formatter.ml +++ b/src/formatter/Formatter.ml @@ -171,19 +171,36 @@ struct | CodeAddr -> !^"ByStr20 with _codehash end" (* Address containing a contract *) | ContrAddr fields_map -> - let alist = Ast.SType.IdLoc_Comp.Map.to_alist fields_map in - let contract_fields = - separate_map - (comma ^^ break 1) - (fun (f, ty) -> group (field_kwd ^/^ of_id f ^/^ colon ^/^ of_type ty)) - alist - in - if List.is_empty alist then !^"ByStr20 with contract end" - else - surround indentation 1 - !^"ByStr20 with contract" - contract_fields - end_kwd + let alist = Ast.SType.IdLoc_Comp.Map.to_alist fields_map in + if List.is_empty alist then !^"ByStr20 with contract end" + else + let mutables, immutables = List.partition_map alist ~f:(fun ((f, mutability), t) -> + if Type.is_mutable mutability then + First (f, t) + else + Second (f, t)) + in + let immutable_fields = + if List.is_empty immutables then + !^"" + else + lparen ^/^ + separate_map + (comma ^^ break 1) + (fun (f, ty) -> group (of_id f ^/^ colon ^/^ of_type ty)) + immutables ^/^ + rparen + in + let mutable_fields = + separate_map + (comma ^^ break 1) + (fun (f, ty) -> group (field_kwd ^/^ of_id f ^/^ colon ^/^ of_type ty)) + mutables + in + surround indentation 1 + (!^"ByStr20 with contract" ^/^ immutable_fields) + mutable_fields + end_kwd (* whitespace-separated non-primitive types need to be parenthesized *) let of_types typs ~sep = @@ -370,7 +387,7 @@ struct | Ast.Load (id, field) -> of_ann_id id ^^^ rev_arrow ^//^ of_ann_id field | Ast.RemoteLoad (id, addr, field, mutability) -> - if Syntax.is_mutable mutability then + if Type.is_mutable mutability then of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ of_ann_id field else of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ lparen ^^ of_ann_id field ^^ rparen @@ -397,9 +414,9 @@ struct (* If mode is set, then we interpret this as value retrieve, otherwise as an "exists" query. *) if mode then - of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ of_map_access map (Syntax.is_mutable mutability) keys + of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ of_map_access map (Type.is_mutable mutability) keys else - of_ann_id id ^^^ blockchain_arrow ^//^ exists_kwd ^^^ of_ann_id addr ^^ dot ^^ of_map_access map (Syntax.is_mutable mutability) keys + of_ann_id id ^^^ blockchain_arrow ^//^ exists_kwd ^^^ of_ann_id addr ^^ dot ^^ of_map_access map (Type.is_mutable mutability) keys | Ast.MatchStmt (id, branches) -> match_kwd ^^^ of_ann_id id ^^^ with_kwd ^/^ separate_map hardline diff --git a/src/merge/Merge.ml b/src/merge/Merge.ml index 76858a204..9fd56218c 100644 --- a/src/merge/Merge.ml +++ b/src/merge/Merge.ml @@ -717,14 +717,14 @@ module ScillaMerger (SR : Rep) (ER : Rep) = struct match stmt with | RemoteLoad (l, _, v, mutability) -> let v' = remote_rename_er renames_map v in - if is_mutable mutability then + if Type.is_mutable mutability then (Load (l, v'), annot) else (* Immutable fields exist in the same namespace as local variables *) (Bind (l, (Var v', PIdentifier.get_rep v')), annot) | RemoteMapGet (l, _, m, mutability, keys, exists) -> let m' = remote_rename_er renames_map m in - if is_mutable mutability then + if Type.is_mutable mutability then (MapGet (l, m', keys, exists), annot) else (* Immutable fields exist in the same namespace as local variables. From 9c45131d6481cf30bf629d102daa2058d32c2eab Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Fri, 2 Dec 2022 16:39:05 +0100 Subject: [PATCH 07/33] pp_typ_helper should treat mutables as mutables and immutables as immutables --- src/base/Type.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/Type.ml b/src/base/Type.ml index e301fb1b4..1478268a0 100644 --- a/src/base/Type.ml +++ b/src/base/Type.ml @@ -272,9 +272,9 @@ module MkType (I : ScillaIdentifier) = struct (recurser t) in if is_mutable mutability then - Second (sprintf "field %s" f_t_str) + First (sprintf "field %s" f_t_str) else - First f_t_str) + Second f_t_str) in let immutables_string = if List.is_empty immutables then "" else sprintf " (%s)" (String.concat ~sep:", " immutables) in let mutables_string = if List.is_empty mutables then "" else sprintf " %s" (String.concat ~sep:", " mutables) in From 139d233b0a257cec9a2a73b235427bf733dcbde9 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Fri, 2 Dec 2022 17:12:42 +0100 Subject: [PATCH 08/33] Fix formatting of address types --- src/formatter/Formatter.ml | 57 +++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/src/formatter/Formatter.ml b/src/formatter/Formatter.ml index 6f873b8c2..0906f75ec 100644 --- a/src/formatter/Formatter.ml +++ b/src/formatter/Formatter.ml @@ -62,6 +62,8 @@ struct let send_kwd = !^"send" let event_kwd = !^"event" let throw_kwd = !^"throw" + let address_type_kwd = !^"ByStr20 with" + let codehash_kwd = !^"_codehash" let contract_kwd = !^"contract" let field_kwd = !^"field" let of_kwd = !^"of" @@ -164,43 +166,40 @@ struct parens_if (p > 0) @@ match kind with (* Any address in use *) - | AnyAddr -> !^"ByStr20 with end" + | AnyAddr -> address_type_kwd ^/^ end_kwd (* Address containing a library *) - | LibAddr -> !^"ByStr20 with library end" + | LibAddr -> address_type_kwd ^/^ library_kwd ^/^ end_kwd (* Address containing a library or contract *) - | CodeAddr -> !^"ByStr20 with _codehash end" + | CodeAddr -> address_type_kwd ^/^ codehash_kwd ^/^ end_kwd (* Address containing a contract *) | ContrAddr fields_map -> let alist = Ast.SType.IdLoc_Comp.Map.to_alist fields_map in - if List.is_empty alist then !^"ByStr20 with contract end" - else - let mutables, immutables = List.partition_map alist ~f:(fun ((f, mutability), t) -> - if Type.is_mutable mutability then - First (f, t) - else - Second (f, t)) - in - let immutable_fields = - if List.is_empty immutables then - !^"" + let mutables, immutables = List.partition_map alist ~f:(fun ((f, mutability), t) -> + if Type.is_mutable mutability then + First (f, t) else - lparen ^/^ - separate_map - (comma ^^ break 1) - (fun (f, ty) -> group (of_id f ^/^ colon ^/^ of_type ty)) - immutables ^/^ - rparen - in - let mutable_fields = - separate_map + Second (f, t)) + in + if List.is_empty immutables && List.is_empty mutables then + address_type_kwd ^^ !^" " ^^ contract_kwd ^^ !^" " ^^ end_kwd + else if List.is_empty mutables then + address_type_kwd ^^ !^" " ^^ contract_kwd ^/^ lparen ^/^ (separate_map comma (fun (f, ty) -> group (of_id f ^/^ colon ^/^ of_type ty)) immutables) ^/^ rparen ^^ !^" " ^^ end_kwd + else if List.is_empty immutables then + surround indentation 1 + (address_type_kwd ^^ !^" " ^^ contract_kwd) + (separate_map (comma ^^ break 1) (fun (f, ty) -> group (field_kwd ^/^ of_id f ^/^ colon ^/^ of_type ty)) - mutables - in - surround indentation 1 - (!^"ByStr20 with contract" ^/^ immutable_fields) - mutable_fields - end_kwd + mutables) + end_kwd + else (* Both mutables and immutables *) + surround indentation 1 + (address_type_kwd ^^ !^" " ^^ contract_kwd ^/^ lparen ^/^ (separate_map comma (fun (f, ty) -> group (of_id f ^/^ colon ^/^ of_type ty)) immutables) ^/^ rparen) + (separate_map + (comma ^^ break 1) + (fun (f, ty) -> group (field_kwd ^/^ of_id f ^/^ colon ^/^ of_type ty)) + mutables) + end_kwd (* whitespace-separated non-primitive types need to be parenthesized *) let of_types typs ~sep = From c9ea96989d143cbe62bf55482e6532c4f1683052 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Thu, 8 Dec 2022 00:48:37 +0100 Subject: [PATCH 09/33] Keep mutables and immutables separate in address types --- src/base/DeadCodeDetector.ml | 14 ++-- src/base/Disambiguate.ml | 12 ++-- src/base/Gas.ml | 4 +- src/base/ParserUtil.ml | 4 +- src/base/Recursion.ml | 10 +-- src/base/ScillaParser.mly | 5 +- src/base/Syntax.ml | 20 ++++-- src/base/SyntaxAnnotMapper.ml | 12 ++-- src/base/Type.ml | 112 ++++++++++++++------------------ src/base/TypeChecker.ml | 31 +++++---- src/base/TypeUtil.ml | 51 +++++++++------ src/eval/Eval.ml | 4 +- src/eval/EvalUtil.ml | 28 ++++---- src/formatter/ExtendedSyntax.ml | 4 +- src/formatter/Formatter.ml | 67 +++++++++---------- src/merge/Merge.ml | 4 +- 16 files changed, 198 insertions(+), 184 deletions(-) diff --git a/src/base/DeadCodeDetector.ml b/src/base/DeadCodeDetector.ml index 7ac0051b5..cc4bfe4a4 100644 --- a/src/base/DeadCodeDetector.ml +++ b/src/base/DeadCodeDetector.ml @@ -555,15 +555,15 @@ module DeadCodeDetector (SR : Rep) (ER : Rep) = struct (** Returns a set of field names of the contract address type. *) let get_addr_fields addr = List.fold_left (SType.IdLoc_Comp.Map.keys addr) ~init:emp_idset - ~f:(fun s (id, _mutability) -> SCIdentifierSet.add s (get_id id)) + ~f:(fun s id -> SCIdentifierSet.add s (get_id id)) (** Updates a map of identifiers [m] iff [ty] has contract address type. [m] has the following structure: [id |-> F] where [F] is a set of field names used in the contract address type. *) let update_contract_params_map m id ty = match ty with - | SType.Address (ContrAddr addr) -> - let data = get_addr_fields addr in + | SType.Address (ContrAddr (_im_addr, m_addr)) -> + let data = get_addr_fields m_addr in Map.set m ~key:(SCIdentifier.get_id id) ~data | _ -> m @@ -589,8 +589,8 @@ module DeadCodeDetector (SR : Rep) (ER : Rep) = struct when not @@ phys_equal (Set.length fields) (Set.length used_fields) -> ( match ty with - | SType.Address (ContrAddr m) -> - List.iter (SType.IdLoc_Comp.Map.keys m) ~f:(fun (id, _mutability) -> + | SType.Address (ContrAddr (_ims, ms)) -> + List.iter (SType.IdLoc_Comp.Map.keys ms) ~f:(fun id -> let name = get_id id in if Set.mem fields name && (not @@ Set.mem used_fields name) then @@ -676,8 +676,8 @@ module DeadCodeDetector (SR : Rep) (ER : Rep) = struct ~init:(Map.empty (module Int)) ~f: (fun i m -> function - | SType.Address (ContrAddr addr) -> - Map.set m ~key:i ~data:(get_addr_fields addr) + | SType.Address (ContrAddr (_im_addr, m_addr)) -> + Map.set m ~key:i ~data:(get_addr_fields m_addr) | _ -> m) in if Map.is_empty args_map then m diff --git a/src/base/Disambiguate.ml b/src/base/Disambiguate.ml index 4ebfd8923..8f6f0bbda 100644 --- a/src/base/Disambiguate.ml +++ b/src/base/Disambiguate.ml @@ -219,16 +219,18 @@ module ScillaDisambiguation (SR : Rep) (ER : Rep) = struct | Address AnyAddr -> pure @@ PostDisType.Address AnyAddr | Address CodeAddr -> pure @@ PostDisType.Address CodeAddr | Address LibAddr -> pure @@ PostDisType.Address LibAddr - | Address (ContrAddr fts) -> - let%bind dis_fts = + | Address (ContrAddr (im_fts, m_fts)) -> + let fts_disambiguator fts = foldM (IdLoc_Comp.Map.to_alist fts) - ~init:PostDisType.IdLoc_Comp.Map.empty ~f:(fun acc ((id, mutability), t) -> + ~init:PostDisType.IdLoc_Comp.Map.empty ~f:(fun acc (id, t) -> let%bind dis_id = name_def_as_simple_global id in let%bind dis_t = recurse t in pure - @@ PostDisType.IdLoc_Comp.Map.set acc ~key:(dis_id, mutability) ~data:dis_t) + @@ PostDisType.IdLoc_Comp.Map.set acc ~key:dis_id ~data:dis_t) in - pure @@ PostDisType.Address (ContrAddr dis_fts) + let%bind dis_im_fts = fts_disambiguator im_fts in + let%bind dis_m_fts = fts_disambiguator m_fts in + pure @@ PostDisType.Address (ContrAddr (dis_im_fts, dis_m_fts)) in recurse t diff --git a/src/base/Gas.ml b/src/base/Gas.ml index cbb6cb83f..c743a8b82 100644 --- a/src/base/Gas.ml +++ b/src/base/Gas.ml @@ -54,9 +54,9 @@ module ScillaGas (SR : Rep) (ER : Rep) = struct match t with | Address t' -> ( match t' with - | ContrAddr fts -> + | ContrAddr (im_fts, m_fts) -> (* look up _this_address and every listed field *) - 1 + IdLoc_Comp.Map.length fts + 1 + IdLoc_Comp.Map.length im_fts + IdLoc_Comp.Map.length m_fts | LibAddr | CodeAddr | AnyAddr -> 0) | _ -> 0 in diff --git a/src/base/ParserUtil.ml b/src/base/ParserUtil.ml index 8cd497b4c..a1d371d8a 100644 --- a/src/base/ParserUtil.ml +++ b/src/base/ParserUtil.ml @@ -107,7 +107,7 @@ module type Syn = sig ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t - * Type.field_mutability + * field_mutability | Store of ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t | Bind of ParserRep.rep SIdentifier.t * expr_annot (* m[k1][k2][..] := v OR delete m[k1][k2][...] *) @@ -127,7 +127,7 @@ module type Syn = sig ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t * ParserRep.rep SIdentifier.t - * Type.field_mutability + * field_mutability * ParserRep.rep SIdentifier.t list * bool | MatchStmt of diff --git a/src/base/Recursion.ml b/src/base/Recursion.ml index fac56ed4f..616d5a38f 100644 --- a/src/base/Recursion.ml +++ b/src/base/Recursion.ml @@ -73,8 +73,9 @@ module ScillaRecursion (SR : Rep) (ER : Rep) = struct forallM ~f:walk targs | PolyFun (_, t) -> walk t | Address AnyAddr | Address CodeAddr | Address LibAddr -> pure () - | Address (ContrAddr fts) -> - forallM (IdLoc_Comp.Map.to_alist fts) ~f:(fun (_, t) -> walk t) + | Address (ContrAddr (im_fts, m_fts)) -> + let%bind () = forallM (IdLoc_Comp.Map.to_alist im_fts) ~f:(fun (_, t) -> walk t) in + forallM (IdLoc_Comp.Map.to_alist m_fts) ~f:(fun (_, t) -> walk t) in walk t @@ -299,8 +300,9 @@ module ScillaRecursion (SR : Rep) (ER : Rep) = struct fail1 ~kind:"Type variables not allowed in type definitions" ?inst:None error_loc | Address AnyAddr | Address CodeAddr | Address LibAddr -> pure () - | Address (ContrAddr fts) -> - forallM (IdLoc_Comp.Map.to_alist fts) ~f:(fun (_, t) -> walk t) + | Address (ContrAddr (im_fts, m_fts)) -> + let%bind () = forallM (IdLoc_Comp.Map.to_alist im_fts) ~f:(fun (_, t) -> walk t) in + forallM (IdLoc_Comp.Map.to_alist m_fts) ~f:(fun (_, t) -> walk t) in walk t diff --git a/src/base/ScillaParser.mly b/src/base/ScillaParser.mly index a63f52b53..d613b3900 100644 --- a/src/base/ScillaParser.mly +++ b/src/base/ScillaParser.mly @@ -251,11 +251,10 @@ address_typ : | d = CID; WITH; CONTRACT; fs = separated_list(COMMA, address_type_field); END; { if d = "ByStr20" then - (* Add _this_address : ByStr20 to field list. This ensures the type is treated as a contract address *) let fs' = List.fold_left (fun acc (id, t) -> - SType.IdLoc_Comp.Map.set acc ~key:(id, Mutable) ~data:t) SType.IdLoc_Comp.Map.empty fs + SType.IdLoc_Comp.Map.set acc ~key:id ~data:t) SType.IdLoc_Comp.Map.empty fs in - Address (ContrAddr fs') + Address (ContrAddr (SType.IdLoc_Comp.Map.empty, fs')) else raise (SyntaxError ("Invalid type", toLoc $startpos(d))) } | d = CID; WITH; LIBRARY; END; { if d = "ByStr20" diff --git a/src/base/Syntax.ml b/src/base/Syntax.ml index 042f92abd..526177764 100644 --- a/src/base/Syntax.ml +++ b/src/base/Syntax.ml @@ -205,6 +205,16 @@ type component_type = CompTrans | CompProc [@@deriving sexp] let component_type_to_string ctp = match ctp with CompTrans -> "transition" | CompProc -> "procedure" +(*******************************************************) +(* Field mutability (for remote reads) *) +(*******************************************************) + +type field_mutability = Mutable | Immutable [@@deriving sexp] + +let is_mutable = function + | Mutable -> true + | Immutable -> false + (*******************************************************) (* Annotations *) (*******************************************************) @@ -317,7 +327,7 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct | Load of ER.rep SIdentifier.t * ER.rep SIdentifier.t (** [Load(I1, I2)] represents: [I1 <- I2] *) | RemoteLoad of - ER.rep SIdentifier.t * ER.rep SIdentifier.t * ER.rep SIdentifier.t * Type.field_mutability + ER.rep SIdentifier.t * ER.rep SIdentifier.t * ER.rep SIdentifier.t * field_mutability (** [RemoteLoad(I1, I2, I3, Mutable)] represents: [I1 <- & I2.I3] (reading a contract state field) * [RemoteLoad(I1, I2, I3, Immutable)] represents: [I1 <- & I2.(I3)] (reading a contract parameter) *) | Store of ER.rep SIdentifier.t * ER.rep SIdentifier.t @@ -343,7 +353,7 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct ER.rep SIdentifier.t * ER.rep SIdentifier.t * ER.rep SIdentifier.t - * Type.field_mutability + * field_mutability * ER.rep SIdentifier.t list * bool (** [RemoteMapGet(V, Adr, M, IsMutable, [K1; ...; Kn], Retrieve)] represents: @@ -608,7 +618,7 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct (as_error_string f) (as_error_string x) phase | RemoteLoad (x, adr, f, mutability) -> sprintf "Type error in reading value of `%s.%s%s%s` into `%s`:\n %s" - (as_error_string adr) (if Type.is_mutable mutability then "" else "(") (as_error_string f) (if Type.is_mutable mutability then "" else ")") (as_error_string x) phase + (as_error_string adr) (if is_mutable mutability then "" else "(") (as_error_string f) (if is_mutable mutability then "" else ")") (as_error_string x) phase | Store (f, r) -> sprintf "Type error in storing value of `%s` into the field `%s`:\n" (as_error_string r) (as_error_string f) @@ -622,9 +632,9 @@ module ScillaSyntax (SR : Rep) (ER : Rep) (Lit : ScillaLiteral) = struct ^ "\n" | RemoteMapGet (_, adr, m, mutability, keys, _) -> sprintf "Type error in getting map value %s.%s%s%s" (as_error_string adr) - (if Type.is_mutable mutability then "" else "(") + (if is_mutable mutability then "" else "(") (as_error_string m) - (if Type.is_mutable mutability then "" else ")") + (if is_mutable mutability then "" else ")") ^ List.fold keys ~init:"" ~f:(fun acc k -> acc ^ "[" ^ as_error_string k ^ "]") ^ "\n" diff --git a/src/base/SyntaxAnnotMapper.ml b/src/base/SyntaxAnnotMapper.ml index c0ab1e553..bc7c26d0c 100644 --- a/src/base/SyntaxAnnotMapper.ml +++ b/src/base/SyntaxAnnotMapper.ml @@ -75,14 +75,10 @@ struct let open MType in match kind with | AnyAddr | CodeAddr | LibAddr -> kind - | ContrAddr fields_map -> - let mapped_keys = - IdLoc_Comp.Map.map_keys_exn fields_map ~f:(fun (f, mutability) -> (map_id fl f, mutability)) - in - let mapped_values = - IdLoc_Comp.Map.map mapped_keys ~f:(fun ty -> map_type ty ~fl) - in - ContrAddr mapped_values + | ContrAddr (im_fields_map, m_fields_map) -> + let key_mapper fields_map = IdLoc_Comp.Map.map_keys_exn fields_map ~f:(map_id fl) in + let value_mapper fields_map = IdLoc_Comp.Map.map (key_mapper fields_map) ~f:(fun ty -> map_type ty ~fl) in + ContrAddr (value_mapper im_fields_map, value_mapper m_fields_map) let literal lit ~fl = let rec walk lit = diff --git a/src/base/Type.ml b/src/base/Type.ml index e301fb1b4..0faf7bd79 100644 --- a/src/base/Type.ml +++ b/src/base/Type.ml @@ -86,32 +86,11 @@ module PrimType = struct | Bystrx_typ b -> "ByStr" ^ Int.to_string b end -(*******************************************************) -(* Field mutability (for remote reads) *) -(*******************************************************) - -type field_mutability = Mutable | Immutable [@@deriving sexp] - -let is_mutable = function - | Mutable -> true - | Immutable -> false - module TIdentifier_Loc (TIdentifier : ScillaIdentifier) = struct - (* (x, true) = x is mutable * - * (x, false) = x is immutable *) - type t = loc TIdentifier.t * field_mutability [@@deriving sexp] - - let compare ((a, am) : t) ((b, bm) : t) = - match am, bm with - | Immutable, Mutable -> -1 - | Mutable, Immutable -> 1 - | _ -> TIdentifier.compare a b - let equal ((a, am) : t) ((b, bm) : t) = - match am, bm with - | Immutable, Mutable - | Mutable, Immutable -> false - | _ -> TIdentifier.equal a b + type t = loc TIdentifier.t [@@deriving sexp] + let compare (a : t) (b : t) = TIdentifier.compare a b + let equal (a : t) (b : t) = TIdentifier.equal a b end module IdLoc_Comp (TIdentifier : ScillaIdentifier) = struct @@ -142,8 +121,8 @@ module type ScillaType = sig | CodeAddr (* Address containing a library. *) | LibAddr - (* Address containing a contract. *) - | ContrAddr of 'a IdLoc_Comp.Map.t + (* Address containing a contract - immutable and mutable fields. *) + | ContrAddr of 'a IdLoc_Comp.Map.t * 'a IdLoc_Comp.Map.t [@@deriving sexp] type t = @@ -230,8 +209,8 @@ module MkType (I : ScillaIdentifier) = struct | CodeAddr (* Address containing a library. *) | LibAddr - (* Address containing a contract. *) - | ContrAddr of 'a IdLoc_Comp.Map.t + (* Address containing a contract - immutable and mutable fields. *) + | ContrAddr of 'a IdLoc_Comp.Map.t * 'a IdLoc_Comp.Map.t [@@deriving sexp] type t = @@ -263,22 +242,19 @@ module MkType (I : ScillaIdentifier) = struct | Address AnyAddr -> "ByStr20 with end" | Address CodeAddr -> "ByStr20 with _codehash end" | Address LibAddr -> "ByStr20 with library end" - | Address (ContrAddr fts) -> - let mutables, immutables = - List.partition_map (IdLoc_Comp.Map.to_alist fts) ~f:(fun ((f, mutability), t) -> - let f_t_str = sprintf "%s : %s" - (if is_error then TIdentifier.as_error_string f - else TIdentifier.as_string f) - (recurser t) - in - if is_mutable mutability then - Second (sprintf "field %s" f_t_str) - else - First f_t_str) + | Address (ContrAddr (im_fts, m_fts)) -> + let f_t_strs fts = List.map (IdLoc_Comp.Map.to_alist fts) ~f:(fun (f, t) -> + sprintf "%s : %s" + (if is_error then TIdentifier.as_error_string f + else TIdentifier.as_string f) + (recurser t)) in - let immutables_string = if List.is_empty immutables then "" else sprintf " (%s)" (String.concat ~sep:", " immutables) in - let mutables_string = if List.is_empty mutables then "" else sprintf " %s" (String.concat ~sep:", " mutables) in - sprintf "ByStr20 with contract%s%s end" immutables_string mutables_string + let immutables_str = + if IdLoc_Comp.Map.is_empty im_fts then "" + else sprintf " (%s)" (String.concat ~sep:", " (f_t_strs im_fts)) in + let mutables_str = if IdLoc_Comp.Map.is_empty m_fts then "" + else String.concat ~sep:"," (List.map (f_t_strs m_fts) ~f:(fun f_t_str -> sprintf " field %s" f_t_str)) in + sprintf "ByStr20 with contract%s%s end" immutables_str mutables_str and with_paren t = match t with @@ -310,9 +286,10 @@ module MkType (I : ScillaIdentifier) = struct let acc' = go bt acc in rem acc' arg | Address AnyAddr | Address LibAddr | Address CodeAddr -> acc - | Address (ContrAddr fts) -> - IdLoc_Comp.Map.fold fts ~init:acc ~f:(fun ~key:_ ~data acc -> - go data acc) + | Address (ContrAddr (im_fts, m_fts)) -> + let mapper ~key:_ ~data acc = go data acc in + let immuts_acc = IdLoc_Comp.Map.fold im_fts ~init:acc ~f:mapper in + IdLoc_Comp.Map.fold m_fts ~init:immuts_acc ~f:mapper in go tp [] @@ -346,9 +323,11 @@ module MkType (I : ScillaIdentifier) = struct if String.(tvar = arg) then tm else PolyFun (arg, subst_type_in_type tvar tp t) | Address AnyAddr | Address LibAddr | Address CodeAddr -> tm - | Address (ContrAddr fts) -> + | Address (ContrAddr (im_fts, m_fts)) -> Address - (ContrAddr (IdLoc_Comp.Map.map fts ~f:(subst_type_in_type tvar tp))) + (ContrAddr + (IdLoc_Comp.Map.map im_fts ~f:(subst_type_in_type tvar tp), + IdLoc_Comp.Map.map m_fts ~f:(subst_type_in_type tvar tp))) (* note: this is sequential substitution of multiple variables, _not_ simultaneous substitution *) @@ -372,9 +351,11 @@ module MkType (I : ScillaIdentifier) = struct let bt2 = recursor bt1 (update_taken arg' taken) in PolyFun (arg', bt2) | Address AnyAddr | Address LibAddr | Address CodeAddr -> t - | Address (ContrAddr fts) -> + | Address (ContrAddr (im_fts, m_fts)) -> Address - (ContrAddr (IdLoc_Comp.Map.map fts ~f:(fun t -> recursor t taken))) + (ContrAddr + (IdLoc_Comp.Map.map im_fts ~f:(fun t -> recursor t taken), + IdLoc_Comp.Map.map m_fts ~f:(fun t -> recursor t taken))) in recursor @@ -406,8 +387,9 @@ module MkType (I : ScillaIdentifier) = struct | Address LibAddr, Address LibAddr | Address CodeAddr, Address CodeAddr -> true - | Address (ContrAddr fts1), Address (ContrAddr fts2) -> - IdLoc_Comp.Map.equal equiv fts1 fts2 + | Address (ContrAddr (im_fts1, m_fts1)), Address (ContrAddr (im_fts2, m_fts2)) -> + IdLoc_Comp.Map.equal equiv im_fts1 im_fts2 && + IdLoc_Comp.Map.equal equiv m_fts1 m_fts2 | _ -> false in equiv t1 t2 @@ -432,16 +414,22 @@ module MkType (I : ScillaIdentifier) = struct | Address CodeAddr, Address (ContrAddr _) -> (* Any address containing code, library or contract is a code address. *) true - | Address (ContrAddr tfts), Address (ContrAddr ffts) -> - (* Check that tfts is a subset of ffts, and that types are assignable/equivalent. *) - IdLoc_Comp.Map.for_alli tfts ~f:(fun ~key:tf ~data:tft -> - match IdLoc_Comp.Map.find ffts tf with - | None -> - (* to field does not appear in from type *) - false - | Some fft -> - (* Matching field name. Types must be assignable. *) - assignable tft fft) + | Address (ContrAddr (to_im_fts, to_m_fts)), Address (ContrAddr (fr_im_fts, fr_m_fts)) -> + (* Check that + - to_im_fts is a subset of fr_im_fts, + - to_m_fts is a subset of fr_m_fts, and that + - all common fields have assignable/equivalent types. *) + let map_checker tfts ffts = + IdLoc_Comp.Map.for_alli tfts ~f:(fun ~key:tf ~data:tft -> + match IdLoc_Comp.Map.find ffts tf with + | None -> + (* to field does not appear in from type *) + false + | Some fft -> + (* Matching field name. Types must be assignable. *) + assignable tft fft) + in + map_checker to_im_fts fr_im_fts && map_checker to_m_fts fr_m_fts | PrimType (Bystrx_typ len), Address _ when len = address_length -> (* Any address is assignable to ByStr20. *) true diff --git a/src/base/TypeChecker.ml b/src/base/TypeChecker.ml index a5bd0963a..b0769a3eb 100644 --- a/src/base/TypeChecker.ml +++ b/src/base/TypeChecker.ml @@ -151,9 +151,10 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct | ADT (_, ts) -> List.fold_left ts ~init:1 ~f:(fun acc t -> acc + type_size t) | Address AnyAddr | Address CodeAddr | Address LibAddr -> 1 - | Address (ContrAddr fts) -> - IdLoc_Comp.Map.fold fts ~init:1 ~f:(fun ~key:_ ~data:t acc -> - acc + type_size t) + | Address (ContrAddr (im_fts, m_fts)) -> + let mapper ~key:_ ~data:t acc = acc + type_size t in + let im_acc = IdLoc_Comp.Map.fold im_fts ~init:1 ~f:mapper in + IdLoc_Comp.Map.fold m_fts ~init:im_acc ~f:mapper in let subst_type_cost tvar tm tp_size = @@ -167,10 +168,10 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct 1 | TypeVar n -> if String.(n = tvar) then tp_size else 1 | Address AnyAddr | Address LibAddr | Address CodeAddr -> 1 - | Address (ContrAddr fts) -> + | Address (ContrAddr (im_fts, m_fts)) -> + let mapper fts = IdLoc_Comp.Map.fold fts ~init:0 ~f:(fun ~key:_ ~data:t acc -> acc + cost t) in max 1 - (IdLoc_Comp.Map.fold fts ~init:0 ~f:(fun ~key:_ ~data:t acc -> - acc + cost t)) + (mapper im_fts + mapper m_fts) in cost tm in @@ -202,14 +203,16 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct let%bind res = recurser t' in pure (PolyFun (arg, res)) | Address AnyAddr | Address LibAddr | Address CodeAddr -> pure t - | Address (ContrAddr fts) -> - let%bind fts_res = + | Address (ContrAddr (im_fts, m_fts)) -> + let fts_mapper fts = foldM (IdLoc_Comp.Map.to_alist fts) ~init:IdLoc_Comp.Map.empty ~f:(fun acc (key, t) -> - let%bind dis_t = recurser t in - pure @@ IdLoc_Comp.Map.set acc ~key ~data:dis_t) + let%bind dis_t = recurser t in + pure @@ IdLoc_Comp.Map.set acc ~key ~data:dis_t) in - pure (Address (ContrAddr fts_res)) + let%bind im_fts_res = fts_mapper im_fts in + let%bind m_fts_res = fts_mapper m_fts in + pure (Address (ContrAddr (im_fts_res, m_fts_res))) in checkwrap_op thunk gas_cost (GasError, out_of_gas_err) in @@ -651,7 +654,7 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct in let%bind fr = fromR_TE - @@ address_field_type (ER.get_loc lc) f (rr_typ adr_typ).tp (Type.is_mutable mutability) + @@ address_field_type (ER.get_loc lc) f (rr_typ adr_typ).tp (is_mutable mutability) in pure @@ ((x, fr), rr_typ adr_typ, mk_qual_tp fr) in @@ -772,7 +775,7 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct | RemoteMapGet (v, adr, m, mutability, klist, valfetch) -> let%bind typed_adr, typed_m, typed_klist, v_type = let%bind typed_adr, typed_m, typed_klist, v_type = - type_remote_map_access env adr m (Type.is_mutable mutability) klist + type_remote_map_access env adr m (is_mutable mutability) klist in pure @@ (typed_adr, typed_m, typed_klist, v_type) in @@ -814,7 +817,7 @@ module ScillaTypechecker (SR : Rep) (ER : Rep) = struct match%bind type_actuals env.pure [ addr; iparams ] with | [ targ_addr; targ_iparams ], [ addr'; iparams' ] -> let contr_typ = - address_typ (ContrAddr IdLoc_Comp.Map.empty) + address_typ (ContrAddr (IdLoc_Comp.Map.empty, IdLoc_Comp.Map.empty)) in let%bind () = fromR_TE diff --git a/src/base/TypeUtil.ml b/src/base/TypeUtil.ml index 2f1b20e38..87da749a2 100644 --- a/src/base/TypeUtil.ml +++ b/src/base/TypeUtil.ml @@ -238,9 +238,10 @@ functor ~inst:a | PolyFun (arg, bt) -> is_wf_typ' bt (arg :: tb) | Address AnyAddr | Address CodeAddr | Address LibAddr -> pure () - | Address (ContrAddr fts) -> - foldM (IdLoc_Comp.Map.to_alist fts) ~init:() ~f:(fun _ (_, t) -> - is_wf_typ' t tb) + | Address (ContrAddr (im_fts, m_fts)) -> + let is_wf_typ'_wrapper _ (_, t) = is_wf_typ' t tb in + let%bind () = foldM (IdLoc_Comp.Map.to_alist im_fts) ~init:() ~f:is_wf_typ'_wrapper in + foldM (IdLoc_Comp.Map.to_alist m_fts) ~init:() ~f:is_wf_typ'_wrapper in is_wf_typ' t [] @@ -368,12 +369,12 @@ module TypeUtilities = struct (* Messages and Events are considered primitive types *) allow_messages_events || TUType.( - (not @@ [%equal: TUType.t] t msg_typ) - || [%equal: TUType.t] t event_typ) + (not @@ [%equal: TUType.t] t msg_typ) + || [%equal: TUType.t] t event_typ) | ADT (tname, ts) -> ( let open DataTypeDictionary in if List.mem seen_adts tname ~equal:TUIdentifier.equal then true - (* Inductive ADT - ignore this branch *) + (* Inductive ADT - ignore this branch *) else (* Check that ADT is serializable *) match lookup_name ~sloc:(get_rep tname) (get_id tname) with @@ -387,11 +388,13 @@ module TypeUtilities = struct in adt_serializable && List.for_all ts ~f:(fun t -> recurser t seen_adts seen_tvars) - ) - | Address (ContrAddr fts) when check_addresses -> + ) + | Address (ContrAddr (im_fts, m_fts)) when check_addresses -> (* If check_addresses is true, then all field types in the address type should be legal field types. No need to check for serialisability or storability, since addresses are stored and passed as ByStr20. *) - IdLoc_Comp.Map.for_all fts ~f:(fun t -> + IdLoc_Comp.Map.for_all im_fts ~f:(fun t -> + is_legal_contract_parameter_type_helper t seen_adts seen_tvars) && + IdLoc_Comp.Map.for_all m_fts ~f:(fun t -> is_legal_field_type_helper t seen_adts seen_tvars) | Address _ -> true in @@ -403,6 +406,14 @@ module TypeUtilities = struct ~allow_closures:false ~allow_polymorphism:false ~allow_unit:false ~check_addresses:true t seen_adts seen_tvars + and is_legal_contract_parameter_type_helper t seen_adts seen_tvars = + (* Like transitions parameters, except maps are allowed because a + bug was exploited before it had been fixed. Address values + should be checked for storable field types. *) + is_legal_type_helper ~allow_maps:true ~allow_messages_events:false + ~allow_closures:false ~allow_polymorphism:false ~allow_unit:false + ~check_addresses:true t seen_adts seen_tvars + let is_legal_message_field_type t = (* Maps are not allowed. Address values are considered ByStr20 when used as message field value. *) is_legal_type_helper ~allow_maps:false ~allow_messages_events:false @@ -422,12 +433,8 @@ module TypeUtilities = struct ~allow_closures:false ~allow_polymorphism:false ~allow_unit:false ~check_addresses:true t [] [] - let is_legal_contract_parameter_type t = - (* Like transitions parameters, except maps are allowed (due to an exploited bug). Address values should be checked for storable field types. *) - is_legal_type_helper ~allow_maps:true ~allow_messages_events:false - ~allow_closures:false ~allow_polymorphism:false ~allow_unit:false - ~check_addresses:true t [] [] - + let is_legal_contract_parameter_type t = is_legal_contract_parameter_type_helper t [] [] + let is_legal_field_type t = is_legal_field_type_helper t [] [] let is_legal_hash_argument_type t = @@ -469,7 +476,7 @@ module TypeUtilities = struct let rec map_depth mt = match mt with MapType (_, vt) -> 1 + map_depth vt | _ -> 0 - let address_field_type loc f t _is_mutable = + let address_field_type loc f t is_mutable = let preknown_field_type = if [%equal: TUName.t] (get_id f) ContractUtil.balance_label then Some ContractUtil.balance_type @@ -490,13 +497,17 @@ module TypeUtilities = struct | (Address LibAddr | Address CodeAddr | Address (ContrAddr _)) when Option.is_some preknown_field_type -> pure @@ Option.value_exn preknown_field_type - | Address (ContrAddr fts) -> ( - let loc_removed = - List.map (IdLoc_Comp.Map.to_alist fts) ~f:(fun ((f, _mut), t) -> + | Address (ContrAddr (im_fts, m_fts)) -> ( + let loc_remover fts = + List.map (IdLoc_Comp.Map.to_alist fts) ~f:(fun (f, t) -> (get_id f, t)) in + let loc_removed_fts = + if is_mutable then loc_remover m_fts + else loc_remover im_fts + in match - List.Assoc.find loc_removed (get_id f) ~equal:[%equal: TUName.t] + List.Assoc.find loc_removed_fts (get_id f) ~equal:[%equal: TUName.t] with | Some ft -> pure ft | None -> not_declared ()) diff --git a/src/eval/Eval.ml b/src/eval/Eval.ml index 8d5e96c40..87df40efb 100644 --- a/src/eval/Eval.ml +++ b/src/eval/Eval.ml @@ -376,7 +376,7 @@ let rec stmt_eval conf stmts = let%bind a = fromR @@ Configuration.lookup conf adr in match a with | ByStrX s' when Bystrx.width s' = Type.address_length -> - let%bind l = Configuration.remote_load conf s' r (Type.is_mutable mutability) in + let%bind l = Configuration.remote_load conf s' r (is_mutable mutability) in let conf' = Configuration.bind conf (get_id x) l in stmt_eval conf' sts | _ -> @@ -418,7 +418,7 @@ let rec stmt_eval conf stmts = mapM ~f:(fun k -> fromR @@ Configuration.lookup conf k) klist in let%bind l = - Configuration.remote_map_get abystr m (Type.is_mutable mutability) klist' fetchval + Configuration.remote_map_get abystr m (is_mutable mutability) klist' fetchval in let conf' = Configuration.bind conf (get_id x) l in stmt_eval conf' sts diff --git a/src/eval/EvalUtil.ml b/src/eval/EvalUtil.ml index a295dc561..476d1c192 100644 --- a/src/eval/EvalUtil.ml +++ b/src/eval/EvalUtil.ml @@ -600,16 +600,21 @@ module EvalTypecheck = struct pure contract_addr else pure true - let typecheck_remote_fields ~caddr fts = + let typecheck_remote_fields ~caddr im_fts m_fts = (* Check that all fields are defined at caddr, and that their types are assignable to what is expected *) - allM fts ~f:(fun ((f, mutability), t) -> - let%bind res = - StateService.external_fetch ~caddr ~fname:f ~_mutable_field:(Type.is_mutable mutability) ~keys:[] ~ignoreval:true - in - match res with - | _, Some ext_typ -> - pure @@ EvalType.type_assignable ~expected:t ~actual:ext_typ - | _, None -> pure false) + let checker fts mutables = + allM fts ~f:(fun (f, t) -> + let%bind res = + StateService.external_fetch ~caddr ~fname:f ~_mutable_field:mutables ~keys:[] ~ignoreval:true + in + match res with + | _, Some ext_typ -> + pure @@ EvalType.type_assignable ~expected:t ~actual:ext_typ + | _, None -> pure false) + in + let%bind im_ok = checker im_fts false in + let%bind m_ok = checker m_fts true in + pure (im_ok && m_ok) type evalTCResult = | AddressNotInUse @@ -629,14 +634,15 @@ module EvalTypecheck = struct | CodeAddr -> let%bind in_use = is_library_or_contract_addr ~caddr in if not in_use then pure NeitherCodeAtAddress else pure Success - | ContrAddr fts -> + | ContrAddr (im_fts, m_fts) -> (* True if the address contains a contract with the appropriate fields, false otherwise *) let%bind contract_addr = is_contract_addr ~caddr in if not contract_addr then pure NoContractAtAddress else let%bind fts_ok = typecheck_remote_fields ~caddr - (EvalType.IdLoc_Comp.Map.to_alist fts) + (EvalType.IdLoc_Comp.Map.to_alist im_fts) + (EvalType.IdLoc_Comp.Map.to_alist m_fts) in if not fts_ok then pure FieldTypeMismatch else pure Success diff --git a/src/formatter/ExtendedSyntax.ml b/src/formatter/ExtendedSyntax.ml index 6c7229ef5..c2395bf13 100644 --- a/src/formatter/ExtendedSyntax.ml +++ b/src/formatter/ExtendedSyntax.ml @@ -88,7 +88,7 @@ struct and stmt = | Load of ER.rep id_ann * ER.rep id_ann - | RemoteLoad of ER.rep id_ann * ER.rep id_ann * ER.rep id_ann * Type.field_mutability + | RemoteLoad of ER.rep id_ann * ER.rep id_ann * ER.rep id_ann * Syntax.field_mutability | Store of ER.rep id_ann * ER.rep id_ann | Bind of ER.rep id_ann * expr_annot | MapUpdate of ER.rep id_ann * ER.rep id_ann list * ER.rep id_ann option @@ -97,7 +97,7 @@ struct ER.rep id_ann * ER.rep id_ann * ER.rep id_ann - * Type.field_mutability + * Syntax.field_mutability * ER.rep id_ann list * bool | MatchStmt of diff --git a/src/formatter/Formatter.ml b/src/formatter/Formatter.ml index 6f873b8c2..4120102ad 100644 --- a/src/formatter/Formatter.ml +++ b/src/formatter/Formatter.ml @@ -66,6 +66,8 @@ struct let field_kwd = !^"field" let of_kwd = !^"of" let type_kwd = !^"type" + let address_type_kwd = !^"ByStr20 with" + let codehash_kwd = !^"_codehash" let import_kwd = !^"import" let library_kwd = !^"library" let scilla_version_kwd = !^"scilla_version" @@ -164,42 +166,37 @@ struct parens_if (p > 0) @@ match kind with (* Any address in use *) - | AnyAddr -> !^"ByStr20 with end" + | AnyAddr -> address_type_kwd ^//^ end_kwd (* Address containing a library *) - | LibAddr -> !^"ByStr20 with library end" + | LibAddr -> address_type_kwd ^//^ library_kwd ^//^ end_kwd (* Address containing a library or contract *) - | CodeAddr -> !^"ByStr20 with _codehash end" + | CodeAddr -> address_type_kwd ^//^ codehash_kwd ^//^ end_kwd (* Address containing a contract *) - | ContrAddr fields_map -> - let alist = Ast.SType.IdLoc_Comp.Map.to_alist fields_map in - if List.is_empty alist then !^"ByStr20 with contract end" - else - let mutables, immutables = List.partition_map alist ~f:(fun ((f, mutability), t) -> - if Type.is_mutable mutability then - First (f, t) - else - Second (f, t)) - in - let immutable_fields = - if List.is_empty immutables then - !^"" - else - lparen ^/^ - separate_map - (comma ^^ break 1) - (fun (f, ty) -> group (of_id f ^/^ colon ^/^ of_type ty)) - immutables ^/^ - rparen - in - let mutable_fields = - separate_map - (comma ^^ break 1) - (fun (f, ty) -> group (field_kwd ^/^ of_id f ^/^ colon ^/^ of_type ty)) - mutables - in + | ContrAddr (im_fields_map, m_fields_map) -> + let im_fields = + separate_map + (comma ^^ break 1) + (fun (f, ty) -> group (of_id f ^/^ colon ^/^ of_type ty)) + (Ast.SType.IdLoc_Comp.Map.to_alist im_fields_map) + in + let m_fields = + separate_map + (comma ^^ break 1) + (fun (f, ty) -> group (field_kwd ^/^ of_id f ^/^ colon ^/^ of_type ty)) + (Ast.SType.IdLoc_Comp.Map.to_alist m_fields_map) + in + match Ast.SType.IdLoc_Comp.Map.is_empty im_fields_map, Ast.SType.IdLoc_Comp.Map.is_empty m_fields_map with + | true, true -> address_type_kwd ^//^ contract_kwd ^//^ end_kwd + | false, true -> address_type_kwd ^//^ contract_kwd ^//^ (parens im_fields) ^//^ end_kwd + | true, false -> + surround indentation 1 + (address_type_kwd ^//^ contract_kwd) + m_fields + end_kwd + | false, false -> surround indentation 1 - (!^"ByStr20 with contract" ^/^ immutable_fields) - mutable_fields + (address_type_kwd ^//^ contract_kwd ^//^ (parens im_fields)) + m_fields end_kwd (* whitespace-separated non-primitive types need to be parenthesized *) @@ -387,7 +384,7 @@ struct | Ast.Load (id, field) -> of_ann_id id ^^^ rev_arrow ^//^ of_ann_id field | Ast.RemoteLoad (id, addr, field, mutability) -> - if Type.is_mutable mutability then + if Syntax.is_mutable mutability then of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ of_ann_id field else of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ lparen ^^ of_ann_id field ^^ rparen @@ -414,9 +411,9 @@ struct (* If mode is set, then we interpret this as value retrieve, otherwise as an "exists" query. *) if mode then - of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ of_map_access map (Type.is_mutable mutability) keys + of_ann_id id ^^^ blockchain_arrow ^//^ of_ann_id addr ^^ dot ^^ of_map_access map (Syntax.is_mutable mutability) keys else - of_ann_id id ^^^ blockchain_arrow ^//^ exists_kwd ^^^ of_ann_id addr ^^ dot ^^ of_map_access map (Type.is_mutable mutability) keys + of_ann_id id ^^^ blockchain_arrow ^//^ exists_kwd ^^^ of_ann_id addr ^^ dot ^^ of_map_access map (Syntax.is_mutable mutability) keys | Ast.MatchStmt (id, branches) -> match_kwd ^^^ of_ann_id id ^^^ with_kwd ^/^ separate_map hardline diff --git a/src/merge/Merge.ml b/src/merge/Merge.ml index 9fd56218c..76858a204 100644 --- a/src/merge/Merge.ml +++ b/src/merge/Merge.ml @@ -717,14 +717,14 @@ module ScillaMerger (SR : Rep) (ER : Rep) = struct match stmt with | RemoteLoad (l, _, v, mutability) -> let v' = remote_rename_er renames_map v in - if Type.is_mutable mutability then + if is_mutable mutability then (Load (l, v'), annot) else (* Immutable fields exist in the same namespace as local variables *) (Bind (l, (Var v', PIdentifier.get_rep v')), annot) | RemoteMapGet (l, _, m, mutability, keys, exists) -> let m' = remote_rename_er renames_map m in - if Type.is_mutable mutability then + if is_mutable mutability then (MapGet (l, m', keys, exists), annot) else (* Immutable fields exist in the same namespace as local variables. From c95aa4de58d77ae40949636a1edc07b477367d68 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Fri, 9 Dec 2022 14:14:20 +0100 Subject: [PATCH 10/33] address_field_type to support immutable fields --- src/base/TypeUtil.ml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/base/TypeUtil.ml b/src/base/TypeUtil.ml index 87da749a2..3e58f7261 100644 --- a/src/base/TypeUtil.ml +++ b/src/base/TypeUtil.ml @@ -498,17 +498,8 @@ module TypeUtilities = struct when Option.is_some preknown_field_type -> pure @@ Option.value_exn preknown_field_type | Address (ContrAddr (im_fts, m_fts)) -> ( - let loc_remover fts = - List.map (IdLoc_Comp.Map.to_alist fts) ~f:(fun (f, t) -> - (get_id f, t)) - in - let loc_removed_fts = - if is_mutable then loc_remover m_fts - else loc_remover im_fts - in - match - List.Assoc.find loc_removed_fts (get_id f) ~equal:[%equal: TUName.t] - with + let fts = if is_mutable then m_fts else im_fts in + match IdLoc_Comp.Map.find fts (mk_id (get_id f) dummy_loc) with | Some ft -> pure ft | None -> not_declared ()) | _ -> From 0b2eb533e400faac3deb322982a814fb6169533b Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Thu, 15 Dec 2022 00:19:13 +0100 Subject: [PATCH 11/33] Merge --- src/base/ParserFaults.messages | 404 ++++++++++-------- src/base/ScillaParser.mly | 27 +- .../gold/address_duplicate_field.scilla.gold | 4 +- 3 files changed, 243 insertions(+), 192 deletions(-) diff --git a/src/base/ParserFaults.messages b/src/base/ParserFaults.messages index 59bb45aa7..94a74c182 100644 --- a/src/base/ParserFaults.messages +++ b/src/base/ParserFaults.messages @@ -1,6 +1,9 @@ #@ WARNING: #@ The following comment has been copied from "src/base/ParserFaults.messages". #@ It may need to be proofread, updated, moved, or removed. +#@ WARNING: +#@ The following comment has been copied from "src/base/ParserFaults.messages". +#@ It may need to be proofread, updated, moved, or removed. # This file is part of scilla. # # Copyright (c) 2018 - present Zilliqa Research Pvt. Ltd. @@ -222,7 +225,7 @@ type_term: MAP CID UNDERSCORE ## address_typ -> CID . WITH CONTRACT loption(separated_nonempty_list(COMMA,address_type_field)) END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] ## address_typ -> CID . WITH LIBRARY END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] ## address_typ -> CID . WITH SPID END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] -## address_typ -> CID . WITH CONTRACT LPAREN loption(separated_nonempty_list(COMMA,param_pair)) RPAREN loption(separated_nonempty_list(COMMA,address_type_field)) END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] +## address_typ -> CID . WITH CONTRACT LPAREN separated_nonempty_list(COMMA,param_pair) RPAREN loption(separated_nonempty_list(COMMA,address_type_field)) END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] ## scid -> CID . [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] ## scid -> CID . PERIOD CID [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] ## @@ -295,7 +298,7 @@ type_term: CID WITH EOF ## address_typ -> CID WITH . CONTRACT loption(separated_nonempty_list(COMMA,address_type_field)) END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] ## address_typ -> CID WITH . LIBRARY END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] ## address_typ -> CID WITH . SPID END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] -## address_typ -> CID WITH . CONTRACT LPAREN loption(separated_nonempty_list(COMMA,param_pair)) RPAREN loption(separated_nonempty_list(COMMA,address_type_field)) END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] +## address_typ -> CID WITH . CONTRACT LPAREN separated_nonempty_list(COMMA,param_pair) RPAREN loption(separated_nonempty_list(COMMA,address_type_field)) END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] ## ## The known suffix of the stack is as follows: ## CID WITH @@ -306,7 +309,7 @@ Invalid or incomplete type. type_term: TID WITH ## -## Ends in an error in state: 370. +## Ends in an error in state: 376. ## ## typ -> typ . TARROW typ [ TARROW EOF ] ## type_term -> typ . EOF [ # ] @@ -320,7 +323,7 @@ This is an invalid type term, the ADT constructor arguments are likely incorrect type_term: WITH ## -## Ends in an error in state: 368. +## Ends in an error in state: 374. ## ## type_term' -> . type_term [ # ] ## @@ -333,7 +336,7 @@ This is an invalid type term. stmts_term: ACCEPT WITH ## -## Ends in an error in state: 320. +## Ends in an error in state: 326. ## ## separated_nonempty_list(SEMICOLON,stmt) -> stmt . [ EOF END BAR ] ## separated_nonempty_list(SEMICOLON,stmt) -> stmt . SEMICOLON separated_nonempty_list(SEMICOLON,stmt) [ EOF END BAR ] @@ -348,7 +351,7 @@ This is likely an improperly terminated statement (lacking the semicolon). stmts_term: CID WITH ## -## Ends in an error in state: 324. +## Ends in an error in state: 330. ## ## stmt -> component_id . list(sident) [ SEMICOLON EOF END BAR ] ## @@ -361,7 +364,7 @@ This is an invalid statements term. stmts_term: DELETE ID WITH ## -## Ends in an error in state: 317. +## Ends in an error in state: 323. ## ## stmt -> DELETE ID . nonempty_list(map_access) [ SEMICOLON EOF END BAR ] ## @@ -374,7 +377,7 @@ This is an invalid delete statement, it lacks the keys to delete. stmts_term: DELETE WITH ## -## Ends in an error in state: 316. +## Ends in an error in state: 322. ## ## stmt -> DELETE . ID nonempty_list(map_access) [ SEMICOLON EOF END BAR ] ## @@ -387,7 +390,7 @@ This is an invalid delete statement, it lacks a map to delete from. stmts_term: EVENT WITH ## -## Ends in an error in state: 314. +## Ends in an error in state: 320. ## ## stmt -> EVENT . sid [ SEMICOLON EOF END BAR ] ## @@ -400,7 +403,7 @@ This is an invalid event statement, it lacks a separated identifier for the even stmts_term: ID ASSIGN WITH ## -## Ends in an error in state: 306. +## Ends in an error in state: 312. ## ## stmt -> ID ASSIGN . sid [ SEMICOLON EOF END BAR ] ## @@ -417,9 +420,10 @@ stmts_term: ID FETCH AND WITH ## ## remote_fetch_stmt -> ID FETCH AND . ID PERIOD sident [ SEMICOLON EOF END BAR ] ## remote_fetch_stmt -> ID FETCH AND . SPID PERIOD SPID [ SEMICOLON EOF END BAR ] -## remote_fetch_stmt -> ID FETCH AND . ID PERIOD LPAREN sident RPAREN [ SEMICOLON EOF END BAR ] +## remote_fetch_stmt -> ID FETCH AND . ID PERIOD LPAREN sident RPAREN list(map_access) [ SEMICOLON EOF END BAR ] ## remote_fetch_stmt -> ID FETCH AND . ID PERIOD ID nonempty_list(map_access) [ SEMICOLON EOF END BAR ] ## remote_fetch_stmt -> ID FETCH AND . EXISTS ID PERIOD ID nonempty_list(map_access) [ SEMICOLON EOF END BAR ] +## remote_fetch_stmt -> ID FETCH AND . EXISTS ID PERIOD LPAREN ID RPAREN nonempty_list(map_access) [ SEMICOLON EOF END BAR ] ## remote_fetch_stmt -> ID FETCH AND . sident AS address_typ [ SEMICOLON EOF END BAR ] ## stmt -> ID FETCH AND . CID option(bcfetch_args) [ SEMICOLON EOF END BAR ] ## @@ -476,9 +480,10 @@ stmts_term: ID FETCH WITH ## ## remote_fetch_stmt -> ID FETCH . AND ID PERIOD sident [ SEMICOLON EOF END BAR ] ## remote_fetch_stmt -> ID FETCH . AND SPID PERIOD SPID [ SEMICOLON EOF END BAR ] -## remote_fetch_stmt -> ID FETCH . AND ID PERIOD LPAREN sident RPAREN [ SEMICOLON EOF END BAR ] +## remote_fetch_stmt -> ID FETCH . AND ID PERIOD LPAREN sident RPAREN list(map_access) [ SEMICOLON EOF END BAR ] ## remote_fetch_stmt -> ID FETCH . AND ID PERIOD ID nonempty_list(map_access) [ SEMICOLON EOF END BAR ] ## remote_fetch_stmt -> ID FETCH . AND EXISTS ID PERIOD ID nonempty_list(map_access) [ SEMICOLON EOF END BAR ] +## remote_fetch_stmt -> ID FETCH . AND EXISTS ID PERIOD LPAREN ID RPAREN nonempty_list(map_access) [ SEMICOLON EOF END BAR ] ## remote_fetch_stmt -> ID FETCH . AND sident AS address_typ [ SEMICOLON EOF END BAR ] ## stmt -> ID FETCH . sid [ SEMICOLON EOF END BAR ] ## stmt -> ID FETCH . AND CID option(bcfetch_args) [ SEMICOLON EOF END BAR ] @@ -494,7 +499,7 @@ This is an invalid bind statement, the bind can be followed by '&', 'exists' or stmts_term: ID EQ WITH ## -## Ends in an error in state: 304. +## Ends in an error in state: 310. ## ## stmt -> ID EQ . exp [ SEMICOLON EOF END BAR ] ## @@ -507,7 +512,7 @@ This is an invalid equal statement, it is lacking a valid expression on the righ stmts_term: ID LSQB SPID RSQB ASSIGN WITH ## -## Ends in an error in state: 309. +## Ends in an error in state: 315. ## ## stmt -> ID nonempty_list(map_access) ASSIGN . sid [ SEMICOLON EOF END BAR ] ## @@ -520,7 +525,7 @@ The map key must be assigned to some separated identifier. stmts_term: ID LSQB SPID RSQB SEMICOLON ## -## Ends in an error in state: 308. +## Ends in an error in state: 314. ## ## stmt -> ID nonempty_list(map_access) . ASSIGN sid [ SEMICOLON EOF END BAR ] ## @@ -579,7 +584,7 @@ This is an invalid statements term. The map access list is malformed. stmts_term: ID SPID WITH ## -## Ends in an error in state: 199. +## Ends in an error in state: 198. ## ## list(sident) -> sident . list(sident) [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -597,9 +602,10 @@ stmts_term: ID WITH ## component_id -> ID . [ SPID SEMICOLON ID EOF END CID BAR ] ## remote_fetch_stmt -> ID . FETCH AND ID PERIOD sident [ SEMICOLON EOF END BAR ] ## remote_fetch_stmt -> ID . FETCH AND SPID PERIOD SPID [ SEMICOLON EOF END BAR ] -## remote_fetch_stmt -> ID . FETCH AND ID PERIOD LPAREN sident RPAREN [ SEMICOLON EOF END BAR ] +## remote_fetch_stmt -> ID . FETCH AND ID PERIOD LPAREN sident RPAREN list(map_access) [ SEMICOLON EOF END BAR ] ## remote_fetch_stmt -> ID . FETCH AND ID PERIOD ID nonempty_list(map_access) [ SEMICOLON EOF END BAR ] ## remote_fetch_stmt -> ID . FETCH AND EXISTS ID PERIOD ID nonempty_list(map_access) [ SEMICOLON EOF END BAR ] +## remote_fetch_stmt -> ID . FETCH AND EXISTS ID PERIOD LPAREN ID RPAREN nonempty_list(map_access) [ SEMICOLON EOF END BAR ] ## remote_fetch_stmt -> ID . FETCH AND sident AS address_typ [ SEMICOLON EOF END BAR ] ## stmt -> ID . FETCH sid [ SEMICOLON EOF END BAR ] ## stmt -> ID . ASSIGN sid [ SEMICOLON EOF END BAR ] @@ -631,7 +637,7 @@ This is an invalid match statement, 'with' is expected after what is specified t stmts_term: MATCH SPID WITH BAR UNDERSCORE ARROW ACCEPT EOF ## -## Ends in an error in state: 328. +## Ends in an error in state: 334. ## ## list(stmt_pm_clause) -> stmt_pm_clause . list(stmt_pm_clause) [ END ] ## @@ -642,9 +648,9 @@ stmts_term: MATCH SPID WITH BAR UNDERSCORE ARROW ACCEPT EOF ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 320, spurious reduction of production separated_nonempty_list(SEMICOLON,stmt) -> stmt -## In state 326, spurious reduction of production loption(separated_nonempty_list(SEMICOLON,stmt)) -> separated_nonempty_list(SEMICOLON,stmt) -## In state 327, spurious reduction of production stmt_pm_clause -> BAR pattern ARROW loption(separated_nonempty_list(SEMICOLON,stmt)) +## In state 326, spurious reduction of production separated_nonempty_list(SEMICOLON,stmt) -> stmt +## In state 332, spurious reduction of production loption(separated_nonempty_list(SEMICOLON,stmt)) -> separated_nonempty_list(SEMICOLON,stmt) +## In state 333, spurious reduction of production stmt_pm_clause -> BAR pattern ARROW loption(separated_nonempty_list(SEMICOLON,stmt)) ## # see tests/parser/bad/stmts_t-match-spid-with-bar-underscore-arrow-accept-eof.scilla @@ -717,7 +723,7 @@ In a match statement, the parser expects a separated identifier to match with. stmts_term: SEND CID PERIOD WITH ## -## Ends in an error in state: 126. +## Ends in an error in state: 125. ## ## sid -> CID PERIOD . ID [ WITH TID SEMICOLON RBRACE MAP LPAREN HEXLIT EOF END COLON CID BAR ] ## @@ -730,7 +736,7 @@ This is an invalid send statement, the identifier is incorrect. After the period stmts_term: SEND CID WITH ## -## Ends in an error in state: 125. +## Ends in an error in state: 124. ## ## sid -> CID . PERIOD ID [ WITH TID SEMICOLON MAP LPAREN HEXLIT EOF END COLON CID BAR ] ## @@ -756,7 +762,7 @@ It is expected to send to a separated identifier. stmts_term: THROW END ## -## Ends in an error in state: 366. +## Ends in an error in state: 372. ## ## stmts_term -> stmts . EOF [ # ] ## @@ -769,9 +775,9 @@ stmts_term: THROW END ## may provide an INCOMPLETE view of the future (what was expected next). ## In state 249, spurious reduction of production option(sid) -> ## In state 251, spurious reduction of production stmt -> THROW option(sid) -## In state 320, spurious reduction of production separated_nonempty_list(SEMICOLON,stmt) -> stmt -## In state 326, spurious reduction of production loption(separated_nonempty_list(SEMICOLON,stmt)) -> separated_nonempty_list(SEMICOLON,stmt) -## In state 334, spurious reduction of production stmts -> loption(separated_nonempty_list(SEMICOLON,stmt)) +## In state 326, spurious reduction of production separated_nonempty_list(SEMICOLON,stmt) -> stmt +## In state 332, spurious reduction of production loption(separated_nonempty_list(SEMICOLON,stmt)) -> separated_nonempty_list(SEMICOLON,stmt) +## In state 340, spurious reduction of production stmts -> loption(separated_nonempty_list(SEMICOLON,stmt)) ## # special case, only via stmts_term entry point should never happen # throw itself is a valid statement term and a procedure or transition @@ -781,7 +787,7 @@ This is an invalid statements term, bad throw. stmts_term: THROW SEMICOLON WITH ## -## Ends in an error in state: 321. +## Ends in an error in state: 327. ## ## separated_nonempty_list(SEMICOLON,stmt) -> stmt SEMICOLON . separated_nonempty_list(SEMICOLON,stmt) [ EOF END BAR ] ## @@ -809,7 +815,7 @@ This throw does not throw a valid exception or is not properly terminated. stmts_term: WITH ## -## Ends in an error in state: 364. +## Ends in an error in state: 370. ## ## stmts_term' -> . stmts_term [ # ] ## @@ -862,7 +868,7 @@ To import another library mention the new library name directly after the previo lmodule: SCILLA_VERSION NUMLIT IMPORT CONTRACT ## -## Ends in an error in state: 360. +## Ends in an error in state: 366. ## ## lmodule -> SCILLA_VERSION NUMLIT imports . library EOF [ # ] ## @@ -895,7 +901,7 @@ If import is mentioned there must be one or more imported libraries with capital lmodule: SCILLA_VERSION NUMLIT LIBRARY CID CONTRACT ## -## Ends in an error in state: 361. +## Ends in an error in state: 367. ## ## lmodule -> SCILLA_VERSION NUMLIT imports library . EOF [ # ] ## @@ -907,7 +913,7 @@ lmodule: SCILLA_VERSION NUMLIT LIBRARY CID CONTRACT ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). ## In state 12, spurious reduction of production list(libentry) -> -## In state 223, spurious reduction of production library -> LIBRARY CID list(libentry) +## In state 222, spurious reduction of production library -> LIBRARY CID list(libentry) ## # see tests/parser/bad/lib/lmodule-library-cid-contract.scillib @@ -915,7 +921,7 @@ When writing solely Scilla libraries, there is no need for a contract. lmodule: SCILLA_VERSION NUMLIT LIBRARY CID LET ID COLON TID EQ WITH ## -## Ends in an error in state: 221. +## Ends in an error in state: 220. ## ## libentry -> LET ID type_annot EQ . exp [ TYPE LET EOF CONTRACT ] ## @@ -928,7 +934,7 @@ This (type-annotated) let expression is missing an expression to assign to an id lmodule: SCILLA_VERSION NUMLIT LIBRARY CID LET ID EQ HEXLIT WITH ## -## Ends in an error in state: 165. +## Ends in an error in state: 164. ## ## lit -> HEXLIT . [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## scid -> HEXLIT . PERIOD CID [ TYPE TRANSITION SPID SEMICOLON PROCEDURE LET LBRACE IN ID FIELD EOF END CONTRACT CID BAR ARROW ] @@ -942,7 +948,7 @@ Invalid module. A module entry (a type or variable definition for libraries, a f lmodule: SCILLA_VERSION NUMLIT LIBRARY CID LET ID EQ WITH ## -## Ends in an error in state: 117. +## Ends in an error in state: 116. ## ## libentry -> LET ID EQ . exp [ TYPE LET EOF CONTRACT ] ## @@ -955,7 +961,7 @@ This library let expression is missing a valid expression to assign to the ident lmodule: SCILLA_VERSION NUMLIT LIBRARY CID LET ID WITH ## -## Ends in an error in state: 116. +## Ends in an error in state: 115. ## ## libentry -> LET ID . EQ exp [ TYPE LET EOF CONTRACT ] ## libentry -> LET ID . type_annot EQ exp [ TYPE LET EOF CONTRACT ] @@ -969,7 +975,7 @@ This library let expression is missing an equals, '='. lmodule: SCILLA_VERSION NUMLIT LIBRARY CID LET WITH ## -## Ends in an error in state: 115. +## Ends in an error in state: 114. ## ## libentry -> LET . ID EQ exp [ TYPE LET EOF CONTRACT ] ## libentry -> LET . ID type_annot EQ exp [ TYPE LET EOF CONTRACT ] @@ -983,7 +989,7 @@ The let expression is missing an identifier to assign an expression to. lmodule: SCILLA_VERSION NUMLIT LIBRARY CID TYPE CID EQ BAR CID OF CID TRANSITION ## -## Ends in an error in state: 112. +## Ends in an error in state: 111. ## ## nonempty_list(tconstr) -> tconstr . [ TYPE LET EOF CONTRACT ] ## nonempty_list(tconstr) -> tconstr . nonempty_list(tconstr) [ TYPE LET EOF CONTRACT ] @@ -997,8 +1003,8 @@ lmodule: SCILLA_VERSION NUMLIT LIBRARY CID TYPE CID EQ BAR CID OF CID TRANSITION ## may provide an INCOMPLETE view of the future (what was expected next). ## In state 25, spurious reduction of production scid -> CID ## In state 78, spurious reduction of production targ -> scid -## In state 109, spurious reduction of production nonempty_list(targ) -> targ -## In state 111, spurious reduction of production tconstr -> BAR CID OF nonempty_list(targ) +## In state 108, spurious reduction of production nonempty_list(targ) -> targ +## In state 110, spurious reduction of production tconstr -> BAR CID OF nonempty_list(targ) ## # see tests/parser/bad/lib/lmodule-library-cid-type-cid-eq-bar-cid-of-cid-transition.scillib @@ -1114,7 +1120,7 @@ This is an invalid library module because it lacks a capital identifier for a na lmodule: SCILLA_VERSION NUMLIT WITH ## -## Ends in an error in state: 359. +## Ends in an error in state: 365. ## ## lmodule -> SCILLA_VERSION NUMLIT . imports library EOF [ # ] ## @@ -1127,7 +1133,7 @@ This is an invalid library module, Scilla version must be followed by 'library' lmodule: WITH ## -## Ends in an error in state: 357. +## Ends in an error in state: 363. ## ## lmodule' -> . lmodule [ # ] ## @@ -1140,7 +1146,7 @@ Scilla version number unspecified. exp_term: AT SPID TID WITH ## -## Ends in an error in state: 109. +## Ends in an error in state: 108. ## ## nonempty_list(targ) -> targ . [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## nonempty_list(targ) -> targ . nonempty_list(targ) [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] @@ -1154,7 +1160,7 @@ The type application is wrong. The list of types is problematic. exp_term: AT SPID WITH ## -## Ends in an error in state: 192. +## Ends in an error in state: 191. ## ## simple_exp -> AT sid . nonempty_list(targ) [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1167,7 +1173,7 @@ The type application is wrong. The parser expects a non-empty list of type argum exp_term: AT WITH ## -## Ends in an error in state: 191. +## Ends in an error in state: 190. ## ## simple_exp -> AT . sid nonempty_list(targ) [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1180,7 +1186,7 @@ This type application is wrong. A separated identifier is expected to apply type exp_term: BUILTIN ID LPAREN WITH ## -## Ends in an error in state: 180. +## Ends in an error in state: 179. ## ## builtin_args -> LPAREN . RPAREN [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1193,7 +1199,7 @@ Builtin functions only take a pair of brackets when of unit input type (e.g. "() exp_term: BUILTIN ID WITH ## -## Ends in an error in state: 174. +## Ends in an error in state: 173. ## ## simple_exp -> BUILTIN ID . option(ctargs) builtin_args [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1206,7 +1212,7 @@ The usage of the builtin function is incorrect. exp_term: BUILTIN WITH ## -## Ends in an error in state: 173. +## Ends in an error in state: 172. ## ## simple_exp -> BUILTIN . ID option(ctargs) builtin_args [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1219,7 +1225,7 @@ This expression is incorrect because it does not specify a specific builtin func exp_term: CID LBRACE TID EQ ## -## Ends in an error in state: 176. +## Ends in an error in state: 175. ## ## ctargs -> LBRACE list(targ) . RBRACE [ TYPE TRANSITION SPID SEMICOLON PROCEDURE LPAREN LET IN ID FIELD EOF END CONTRACT CID BAR ARROW ] ## @@ -1239,7 +1245,7 @@ The data constructor, list of type arguments is incorrect. The parser expects an exp_term: CID LBRACE WITH ## -## Ends in an error in state: 175. +## Ends in an error in state: 174. ## ## ctargs -> LBRACE . list(targ) RBRACE [ TYPE TRANSITION SPID SEMICOLON PROCEDURE LPAREN LET IN ID FIELD EOF END CONTRACT CID BAR ARROW ] ## @@ -1252,7 +1258,7 @@ The data constructor, list of type arguments is incorrect. The parser expects a exp_term: CID PERIOD CID WITH ## -## Ends in an error in state: 197. +## Ends in an error in state: 196. ## ## simple_exp -> scid . option(ctargs) list(sident) [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1265,7 +1271,7 @@ This is an invalid expression, most likely the data constructor is missing argum exp_term: CID PERIOD WITH ## -## Ends in an error in state: 172. +## Ends in an error in state: 171. ## ## scid -> CID PERIOD . CID [ TYPE TRANSITION SPID SEMICOLON PROCEDURE LET LBRACE IN ID FIELD EOF END CONTRACT CID BAR ARROW ] ## sid -> CID PERIOD . ID [ TYPE TRANSITION SPID SEMICOLON PROCEDURE LET IN ID FIELD EOF END CONTRACT CID BAR ARROW ] @@ -1279,7 +1285,7 @@ This is an invalid expression, most likely the data constructor name is unfinish exp_term: CID WITH ## -## Ends in an error in state: 171. +## Ends in an error in state: 170. ## ## lit -> CID . NUMLIT [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## scid -> CID . [ TYPE TRANSITION SPID SEMICOLON PROCEDURE LET LBRACE IN ID FIELD EOF END CONTRACT CID BAR ARROW ] @@ -1295,7 +1301,7 @@ This is a malformed expression, it may be an incorrect data constructor usage. exp_term: EMP WITH ## -## Ends in an error in state: 152. +## Ends in an error in state: 151. ## ## lit -> EMP . t_map_key t_map_value [ TYPE TRANSITION SEMICOLON RBRACE PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1308,7 +1314,7 @@ The empty map has invalid key type (capitalised identifier). exp_term: FUN LPAREN ID COLON TID RPAREN ARROW WITH ## -## Ends in an error in state: 170. +## Ends in an error in state: 169. ## ## simple_exp -> FUN LPAREN id_with_typ RPAREN ARROW . exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1321,7 +1327,7 @@ This function is lacking a valid result expression. exp_term: FUN LPAREN ID COLON TID RPAREN WITH ## -## Ends in an error in state: 169. +## Ends in an error in state: 168. ## ## simple_exp -> FUN LPAREN id_with_typ RPAREN . ARROW exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1374,7 +1380,7 @@ Missing type annotation (a colon followed by a legal type). exp_term: FUN LPAREN WITH ## -## Ends in an error in state: 167. +## Ends in an error in state: 166. ## ## simple_exp -> FUN LPAREN . id_with_typ RPAREN ARROW exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1387,7 +1393,7 @@ This function is missing a valid argument identifier, beginning with a lower cas exp_term: FUN WITH ## -## Ends in an error in state: 166. +## Ends in an error in state: 165. ## ## simple_exp -> FUN . LPAREN id_with_typ RPAREN ARROW exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1400,7 +1406,7 @@ This function needs brackets for the argument. exp_term: LBRACE SPID COLON CID WITH ## -## Ends in an error in state: 155. +## Ends in an error in state: 154. ## ## lit -> CID . NUMLIT [ SEMICOLON RBRACE ] ## sid -> CID . PERIOD ID [ SEMICOLON RBRACE ] @@ -1414,7 +1420,7 @@ This is an invalid message construction. The parser expects another message entr exp_term: LBRACE SPID COLON HEXLIT SEMICOLON WITH ## -## Ends in an error in state: 161. +## Ends in an error in state: 160. ## ## separated_nonempty_list(SEMICOLON,msg_entry) -> msg_entry SEMICOLON . separated_nonempty_list(SEMICOLON,msg_entry) [ RBRACE ] ## @@ -1427,7 +1433,7 @@ This is an invalid message construction. The parser after a semicolon expects an exp_term: LBRACE SPID COLON HEXLIT WITH ## -## Ends in an error in state: 160. +## Ends in an error in state: 159. ## ## separated_nonempty_list(SEMICOLON,msg_entry) -> msg_entry . [ RBRACE ] ## separated_nonempty_list(SEMICOLON,msg_entry) -> msg_entry . SEMICOLON separated_nonempty_list(SEMICOLON,msg_entry) [ RBRACE ] @@ -1441,7 +1447,7 @@ This is likely an invalid message construction. The parser expects another messa exp_term: LBRACE SPID COLON WITH ## -## Ends in an error in state: 150. +## Ends in an error in state: 149. ## ## msg_entry -> sid COLON . lit [ SEMICOLON RBRACE ] ## msg_entry -> sid COLON . sid [ SEMICOLON RBRACE ] @@ -1455,7 +1461,7 @@ This is an invalid message construction. Following the colon, a literal or separ exp_term: LBRACE SPID WITH ## -## Ends in an error in state: 149. +## Ends in an error in state: 148. ## ## msg_entry -> sid . COLON lit [ SEMICOLON RBRACE ] ## msg_entry -> sid . COLON sid [ SEMICOLON RBRACE ] @@ -1469,7 +1475,7 @@ This is an invalid message construction. With a message entry, the parser expect exp_term: LBRACE WITH ## -## Ends in an error in state: 148. +## Ends in an error in state: 147. ## ## simple_exp -> LBRACE . loption(separated_nonempty_list(SEMICOLON,msg_entry)) RBRACE [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1483,7 +1489,7 @@ This is an invalid message construction. The parser expects a semi-colon separat exp_term: LET ID COLON TID EQ STRING IN WITH ## -## Ends in an error in state: 211. +## Ends in an error in state: 210. ## ## simple_exp -> LET ID type_annot EQ simple_exp IN . exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1496,7 +1502,7 @@ This let expression (type-annotated) is likely missing an expression to substitu exp_term: LET ID EQ STRING IN WITH ## -## Ends in an error in state: 206. +## Ends in an error in state: 205. ## ## simple_exp -> LET ID EQ simple_exp IN . exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1509,7 +1515,7 @@ This let expression likely does not substitute a variable into a valid expressio exp_term: LET ID EQ STRING WITH ## -## Ends in an error in state: 205. +## Ends in an error in state: 204. ## ## simple_exp -> LET ID EQ simple_exp . IN exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1522,7 +1528,7 @@ This let expression is likely missing an 'in'. exp_term: LET ID EQ WITH ## -## Ends in an error in state: 147. +## Ends in an error in state: 146. ## ## simple_exp -> LET ID EQ . simple_exp IN exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1535,7 +1541,7 @@ This let expression is missing an expression to substitute a variable in. exp_term: LET ID WITH ## -## Ends in an error in state: 146. +## Ends in an error in state: 145. ## ## simple_exp -> LET ID . EQ simple_exp IN exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## simple_exp -> LET ID . type_annot EQ simple_exp IN exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] @@ -1549,7 +1555,7 @@ This let expression is missing an equals ('=') or type annotation, directly afte exp_term: LET WITH ## -## Ends in an error in state: 145. +## Ends in an error in state: 144. ## ## simple_exp -> LET . ID EQ simple_exp IN exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## simple_exp -> LET . ID type_annot EQ simple_exp IN exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] @@ -1564,7 +1570,7 @@ This let expression is missing an identifier for the variable. exp_term: MATCH SPID UNDERSCORE ## -## Ends in an error in state: 128. +## Ends in an error in state: 127. ## ## simple_exp -> MATCH sid . WITH list(exp_pm_clause) END [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1577,7 +1583,7 @@ This match expression is missing 'with'. exp_term: MATCH SPID WITH BAR CID LPAREN UNDERSCORE WITH ## -## Ends in an error in state: 136. +## Ends in an error in state: 135. ## ## arg_pattern -> LPAREN pattern . RPAREN [ UNDERSCORE RPAREN LPAREN ID HEXLIT CID ARROW ] ## @@ -1590,7 +1596,7 @@ This is an invalid match expression, possibly unterminated brackets for pattern exp_term: MATCH SPID WITH BAR CID LPAREN WITH ## -## Ends in an error in state: 135. +## Ends in an error in state: 134. ## ## arg_pattern -> LPAREN . pattern RPAREN [ UNDERSCORE RPAREN LPAREN ID HEXLIT CID ARROW ] ## @@ -1603,7 +1609,7 @@ This match expression has invalid pattern arguments, in the brackets we expect a exp_term: MATCH SPID WITH BAR CID UNDERSCORE WITH ## -## Ends in an error in state: 141. +## Ends in an error in state: 140. ## ## list(arg_pattern) -> arg_pattern . list(arg_pattern) [ RPAREN ARROW ] ## @@ -1616,7 +1622,7 @@ In this match expression, following the pattern the parser expects an arrow (e.g exp_term: MATCH SPID WITH BAR UNDERSCORE ARROW WITH ## -## Ends in an error in state: 144. +## Ends in an error in state: 143. ## ## exp_pm_clause -> BAR pattern ARROW . exp [ END BAR ] ## @@ -1629,7 +1635,7 @@ This is an invalid match expression. Following an arrow we expect a valid expres exp_term: MATCH SPID WITH BAR UNDERSCORE WITH ## -## Ends in an error in state: 143. +## Ends in an error in state: 142. ## ## exp_pm_clause -> BAR pattern . ARROW exp [ END BAR ] ## @@ -1642,7 +1648,7 @@ This is in an invalid match expression. Following a pattern, we expect an arrow exp_term: MATCH SPID WITH BAR WITH ## -## Ends in an error in state: 130. +## Ends in an error in state: 129. ## ## exp_pm_clause -> BAR . pattern ARROW exp [ END BAR ] ## @@ -1655,7 +1661,7 @@ This is an invalid match expression. In a pattern matching clause following the exp_term: MATCH SPID WITH WITH ## -## Ends in an error in state: 129. +## Ends in an error in state: 128. ## ## simple_exp -> MATCH sid WITH . list(exp_pm_clause) END [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1668,7 +1674,7 @@ This is an invalid match expression, a pattern matching clause is necessary (pos exp_term: MATCH WITH ## -## Ends in an error in state: 123. +## Ends in an error in state: 122. ## ## simple_exp -> MATCH . sid WITH list(exp_pm_clause) END [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1681,7 +1687,7 @@ This is an invalid match expression, it is lacking a valid identifier to match w exp_term: SPID CID PERIOD WITH ## -## Ends in an error in state: 184. +## Ends in an error in state: 183. ## ## sident -> CID PERIOD . ID [ TYPE TRANSITION SPID SEMICOLON RSQB RPAREN PROCEDURE LET IN ID FIELD EOF END CONTRACT COMMA CID BAR AS ARROW ] ## @@ -1694,7 +1700,7 @@ This is an invalid expression, the identifier is incomplete or erroneous. exp_term: SPID CID WITH ## -## Ends in an error in state: 183. +## Ends in an error in state: 182. ## ## sident -> CID . PERIOD ID [ TYPE TRANSITION SPID SEMICOLON RSQB RPAREN PROCEDURE LET IN ID FIELD EOF END CONTRACT COMMA CID BAR ARROW ] ## @@ -1707,7 +1713,7 @@ This may be a type application missing '@' or an incorrect function application exp_term: SPID SPID WITH ## -## Ends in an error in state: 186. +## Ends in an error in state: 185. ## ## nonempty_list(sident) -> sident . [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## nonempty_list(sident) -> sident . nonempty_list(sident) [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] @@ -1723,7 +1729,7 @@ If this is an application of a function, it is necessary to supply a list of val exp_term: SPID WITH ## -## Ends in an error in state: 195. +## Ends in an error in state: 194. ## ## atomic_exp -> sid . [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## simple_exp -> sid . nonempty_list(sident) [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] @@ -1737,7 +1743,7 @@ This is an invalid expression. If it is an application of a function, it is nece exp_term: STRING WITH ## -## Ends in an error in state: 355. +## Ends in an error in state: 361. ## ## exp_term -> exp . EOF [ # ] ## @@ -1750,7 +1756,7 @@ This is not a valid expression, possible bad literal. exp_term: TFUN TID ARROW WITH ## -## Ends in an error in state: 120. +## Ends in an error in state: 119. ## ## simple_exp -> TFUN TID ARROW . exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1763,7 +1769,7 @@ Type functions expect a valid expression after the arrow. exp_term: TFUN TID WITH ## -## Ends in an error in state: 119. +## Ends in an error in state: 118. ## ## simple_exp -> TFUN TID . ARROW exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1776,7 +1782,7 @@ Type functions following the type id expect an arrow (e.g. '=>'). exp_term: TFUN WITH ## -## Ends in an error in state: 118. +## Ends in an error in state: 117. ## ## simple_exp -> TFUN . TID ARROW exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -1789,7 +1795,7 @@ Type functions expect a type id (e.g. 'A). exp_term: WITH ## -## Ends in an error in state: 353. +## Ends in an error in state: 359. ## ## exp_term' -> . exp_term [ # ] ## @@ -1802,7 +1808,7 @@ This is an invalid expression term, possibly avoid unnecessary brackets. cmodule: SCILLA_VERSION NUMLIT CONTRACT CID LPAREN ID COLON CID COMMA WITH ## -## Ends in an error in state: 88. +## Ends in an error in state: 97. ## ## separated_nonempty_list(COMMA,param_pair) -> param_pair COMMA . separated_nonempty_list(COMMA,param_pair) [ RPAREN ] ## @@ -1830,7 +1836,7 @@ For a mutable field declaration, the parser expects a valid lower case beginning cmodule: SCILLA_VERSION NUMLIT CONTRACT CID LPAREN RPAREN PROCEDURE ID LPAREN RPAREN WITH ## -## Ends in an error in state: 338. +## Ends in an error in state: 344. ## ## procedure -> PROCEDURE component_id component_params . component_body [ TRANSITION PROCEDURE EOF ] ## @@ -1843,7 +1849,7 @@ In the transition body the parser expects a list of semi-colon separated stateme cmodule: SCILLA_VERSION NUMLIT CONTRACT CID LPAREN RPAREN PROCEDURE ID WITH ## -## Ends in an error in state: 337. +## Ends in an error in state: 343. ## ## procedure -> PROCEDURE component_id . component_params component_body [ TRANSITION PROCEDURE EOF ] ## @@ -1857,7 +1863,7 @@ be a left parenthesis. cmodule: SCILLA_VERSION NUMLIT CONTRACT CID LPAREN RPAREN PROCEDURE WITH ## -## Ends in an error in state: 336. +## Ends in an error in state: 342. ## ## procedure -> PROCEDURE . component_id component_params component_body [ TRANSITION PROCEDURE EOF ] ## @@ -1870,7 +1876,7 @@ A procedure requires a valid name. cmodule: SCILLA_VERSION NUMLIT CONTRACT CID LPAREN RPAREN TRANSITION ID LPAREN RPAREN END WITH ## -## Ends in an error in state: 343. +## Ends in an error in state: 349. ## ## list(component) -> component . list(component) [ EOF ] ## @@ -1883,7 +1889,7 @@ Following a transition definition, the parser expects a transition or a procedur cmodule: SCILLA_VERSION NUMLIT CONTRACT CID LPAREN RPAREN TRANSITION ID LPAREN RPAREN THROW BAR ## -## Ends in an error in state: 332. +## Ends in an error in state: 338. ## ## component_body -> stmts . END [ TRANSITION PROCEDURE EOF ] ## @@ -1896,9 +1902,9 @@ cmodule: SCILLA_VERSION NUMLIT CONTRACT CID LPAREN RPAREN TRANSITION ID LPAREN R ## may provide an INCOMPLETE view of the future (what was expected next). ## In state 249, spurious reduction of production option(sid) -> ## In state 251, spurious reduction of production stmt -> THROW option(sid) -## In state 320, spurious reduction of production separated_nonempty_list(SEMICOLON,stmt) -> stmt -## In state 326, spurious reduction of production loption(separated_nonempty_list(SEMICOLON,stmt)) -> separated_nonempty_list(SEMICOLON,stmt) -## In state 334, spurious reduction of production stmts -> loption(separated_nonempty_list(SEMICOLON,stmt)) +## In state 326, spurious reduction of production separated_nonempty_list(SEMICOLON,stmt) -> stmt +## In state 332, spurious reduction of production loption(separated_nonempty_list(SEMICOLON,stmt)) -> separated_nonempty_list(SEMICOLON,stmt) +## In state 340, spurious reduction of production stmts -> loption(separated_nonempty_list(SEMICOLON,stmt)) ## # see tests/parser/cmodule-transition-id-lparen-rparen-throw-bar.scilla @@ -1973,7 +1979,7 @@ After the definition of the immutable fields, either a contract constraint, the cmodule: SCILLA_VERSION NUMLIT CONTRACT CID LPAREN WITH ## -## Ends in an error in state: 229. +## Ends in an error in state: 228. ## ## contract -> CONTRACT CID LPAREN . loption(separated_nonempty_list(COMMA,param_pair)) RPAREN list(field) list(component) [ EOF ] ## contract -> CONTRACT CID LPAREN . loption(separated_nonempty_list(COMMA,param_pair)) RPAREN with_constraint list(field) list(component) [ EOF ] @@ -1988,7 +1994,7 @@ The name of an immutable field should begin with a lower case letter ('a' - 'z') cmodule: SCILLA_VERSION NUMLIT CONTRACT CID WITH ## -## Ends in an error in state: 228. +## Ends in an error in state: 227. ## ## contract -> CONTRACT CID . LPAREN loption(separated_nonempty_list(COMMA,param_pair)) RPAREN list(field) list(component) [ EOF ] ## contract -> CONTRACT CID . LPAREN loption(separated_nonempty_list(COMMA,param_pair)) RPAREN with_constraint list(field) list(component) [ EOF ] @@ -2002,7 +2008,7 @@ The declaration of zero or more immutable fields in brackets is expected. cmodule: SCILLA_VERSION NUMLIT CONTRACT WITH ## -## Ends in an error in state: 227. +## Ends in an error in state: 226. ## ## contract -> CONTRACT . CID LPAREN loption(separated_nonempty_list(COMMA,param_pair)) RPAREN list(field) list(component) [ EOF ] ## contract -> CONTRACT . CID LPAREN loption(separated_nonempty_list(COMMA,param_pair)) RPAREN with_constraint list(field) list(component) [ EOF ] @@ -2016,7 +2022,7 @@ When a contract is being defined a valid identifier is expected. cmodule: SCILLA_VERSION NUMLIT LIBRARY CID EOF ## -## Ends in an error in state: 226. +## Ends in an error in state: 225. ## ## cmodule -> SCILLA_VERSION NUMLIT imports option(library) . contract EOF [ # ] ## @@ -2028,8 +2034,8 @@ cmodule: SCILLA_VERSION NUMLIT LIBRARY CID EOF ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). ## In state 12, spurious reduction of production list(libentry) -> -## In state 223, spurious reduction of production library -> LIBRARY CID list(libentry) -## In state 351, spurious reduction of production option(library) -> library +## In state 222, spurious reduction of production library -> LIBRARY CID list(libentry) +## In state 357, spurious reduction of production option(library) -> library ## # see tests/parser/bad/cmodule-version-number-library-name @@ -2076,7 +2082,7 @@ Scilla version number unspecified. exp_term: CID LBRACE RBRACE AT ## -## Ends in an error in state: 198. +## Ends in an error in state: 197. ## ## simple_exp -> scid option(ctargs) . list(sident) [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -2089,7 +2095,7 @@ In a data constructor application, the parser expects valid separated uncapitali exp_term: LET ID COLON TID EQ STRING WITH ## -## Ends in an error in state: 210. +## Ends in an error in state: 209. ## ## simple_exp -> LET ID type_annot EQ simple_exp . IN exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -2102,7 +2108,7 @@ This typed let expression does not have a well placed 'in'. exp_term: LET ID COLON TID EQ WITH ## -## Ends in an error in state: 209. +## Ends in an error in state: 208. ## ## simple_exp -> LET ID type_annot EQ . simple_exp IN exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -2115,7 +2121,7 @@ This typed let expression does not have a valid expression to use for the substi type_term: CID MAP CID TYPE ## -## Ends in an error in state: 107. +## Ends in an error in state: 106. ## ## targ -> MAP t_map_key . t_map_value [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] ## @@ -2152,7 +2158,7 @@ Ends in an error in state: 66. type_term: CID WITH CONTRACT FIELD ID COLON TID COMMA WITH ## -## Ends in an error in state: 99. +## Ends in an error in state: 94. ## ## separated_nonempty_list(COMMA,address_type_field) -> address_type_field COMMA . separated_nonempty_list(COMMA,address_type_field) [ END ] ## @@ -2164,7 +2170,7 @@ Ends in an error in state: 93. type_term: CID WITH CONTRACT FIELD ID COLON TID RPAREN ## -## Ends in an error in state: 98. +## Ends in an error in state: 93. ## ## separated_nonempty_list(COMMA,address_type_field) -> address_type_field . [ END ] ## separated_nonempty_list(COMMA,address_type_field) -> address_type_field . COMMA separated_nonempty_list(COMMA,address_type_field) [ END ] @@ -2178,14 +2184,14 @@ type_term: CID WITH CONTRACT FIELD ID COLON TID RPAREN ## may provide an INCOMPLETE view of the future (what was expected next). ## In state 84, spurious reduction of production type_annot -> COLON typ ## In state 85, spurious reduction of production id_with_typ -> ID type_annot -## In state 94, spurious reduction of production address_type_field -> FIELD id_with_typ +## In state 89, spurious reduction of production address_type_field -> FIELD id_with_typ ## Ends in an error in state: 92. type_term: CID WITH CONTRACT FIELD WITH ## -## Ends in an error in state: 93. +## Ends in an error in state: 88. ## ## address_type_field -> FIELD . id_with_typ [ END COMMA ] ## @@ -2195,44 +2201,11 @@ type_term: CID WITH CONTRACT FIELD WITH Contract fields are not allowed to start with underscore. -type_term: CID WITH CONTRACT LPAREN ID COLON TID EQ -## -## Ends in an error in state: 87. -## -## separated_nonempty_list(COMMA,param_pair) -> param_pair . [ RPAREN ] -## separated_nonempty_list(COMMA,param_pair) -> param_pair . COMMA separated_nonempty_list(COMMA,param_pair) [ RPAREN ] -## -## The known suffix of the stack is as follows: -## param_pair -## -## WARNING: This example involves spurious reductions. -## This implies that, although the LR(1) items shown above provide an -## accurate view of the past (what has been recognized so far), they -## may provide an INCOMPLETE view of the future (what was expected next). -## In state 84, spurious reduction of production type_annot -> COLON typ -## In state 85, spurious reduction of production id_with_typ -> ID type_annot -## In state 90, spurious reduction of production param_pair -> id_with_typ -## - -Ends in an error in state: 81. - -type_term: CID WITH CONTRACT LPAREN RPAREN WITH -## -## Ends in an error in state: 92. -## -## address_typ -> CID WITH CONTRACT LPAREN loption(separated_nonempty_list(COMMA,param_pair)) RPAREN . loption(separated_nonempty_list(COMMA,address_type_field)) END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] -## -## The known suffix of the stack is as follows: -## CID WITH CONTRACT LPAREN loption(separated_nonempty_list(COMMA,param_pair)) RPAREN -## - -Ends in an error in state: 86. - type_term: CID WITH CONTRACT LPAREN WITH ## ## Ends in an error in state: 33. ## -## address_typ -> CID WITH CONTRACT LPAREN . loption(separated_nonempty_list(COMMA,param_pair)) RPAREN loption(separated_nonempty_list(COMMA,address_type_field)) END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] +## address_typ -> CID WITH CONTRACT LPAREN . separated_nonempty_list(COMMA,param_pair) RPAREN loption(separated_nonempty_list(COMMA,address_type_field)) END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] ## ## The known suffix of the stack is as follows: ## CID WITH CONTRACT LPAREN @@ -2245,7 +2218,7 @@ type_term: CID WITH CONTRACT WITH ## Ends in an error in state: 32. ## ## address_typ -> CID WITH CONTRACT . loption(separated_nonempty_list(COMMA,address_type_field)) END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] -## address_typ -> CID WITH CONTRACT . LPAREN loption(separated_nonempty_list(COMMA,param_pair)) RPAREN loption(separated_nonempty_list(COMMA,address_type_field)) END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] +## address_typ -> CID WITH CONTRACT . LPAREN separated_nonempty_list(COMMA,param_pair) RPAREN loption(separated_nonempty_list(COMMA,address_type_field)) END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] ## ## The known suffix of the stack is as follows: ## CID WITH CONTRACT @@ -2305,7 +2278,7 @@ Likely an incorrect map value type: arrow types, forall-types and type variables type_term: MAP LPAREN CID TYPE ## -## Ends in an error in state: 103. +## Ends in an error in state: 102. ## ## t_map_key -> LPAREN scid . RPAREN [ MAP LPAREN HEXLIT CID ] ## @@ -2323,7 +2296,7 @@ Likely an incorrect map key type: only primitive types are supported. type_term: MAP LPAREN CID WITH END WITH ## -## Ends in an error in state: 105. +## Ends in an error in state: 104. ## ## t_map_key -> LPAREN address_typ . RPAREN [ MAP LPAREN HEXLIT CID ] ## @@ -2335,7 +2308,7 @@ Ends in an error in state: 99. stmts_term: FORALL SPID WITH ## -## Ends in an error in state: 312. +## Ends in an error in state: 318. ## ## stmt -> FORALL sident . component_id [ SEMICOLON EOF END BAR ] ## @@ -2347,7 +2320,7 @@ Ends in an error in state: 297. stmts_term: FORALL WITH ## -## Ends in an error in state: 311. +## Ends in an error in state: 317. ## ## stmt -> FORALL . sident component_id [ SEMICOLON EOF END BAR ] ## @@ -2359,7 +2332,7 @@ Ends in an error in state: 296. stmts_term: ID FETCH AND CID PERIOD ID WITH ## -## Ends in an error in state: 299. +## Ends in an error in state: 305. ## ## remote_fetch_stmt -> ID FETCH AND sident . AS address_typ [ SEMICOLON EOF END BAR ] ## @@ -2371,7 +2344,7 @@ Remote reads are not allowed to use namespaces. stmts_term: ID FETCH AND CID WITH ## -## Ends in an error in state: 289. +## Ends in an error in state: 296. ## ## sident -> CID . PERIOD ID [ AS ] ## stmt -> ID FETCH AND CID . option(bcfetch_args) [ SEMICOLON EOF END BAR ] @@ -2384,7 +2357,7 @@ Ends in an error in state: 283. stmts_term: ID FETCH AND EXISTS ID PERIOD ID WITH ## -## Ends in an error in state: 287. +## Ends in an error in state: 294. ## ## remote_fetch_stmt -> ID FETCH AND EXISTS ID PERIOD ID . nonempty_list(map_access) [ SEMICOLON EOF END BAR ] ## @@ -2396,9 +2369,10 @@ Ends in an error in state: 281. stmts_term: ID FETCH AND EXISTS ID PERIOD WITH ## -## Ends in an error in state: 286. +## Ends in an error in state: 289. ## ## remote_fetch_stmt -> ID FETCH AND EXISTS ID PERIOD . ID nonempty_list(map_access) [ SEMICOLON EOF END BAR ] +## remote_fetch_stmt -> ID FETCH AND EXISTS ID PERIOD . LPAREN ID RPAREN nonempty_list(map_access) [ SEMICOLON EOF END BAR ] ## ## The known suffix of the stack is as follows: ## ID FETCH AND EXISTS ID PERIOD @@ -2408,9 +2382,10 @@ Ends in an error in state: 280. stmts_term: ID FETCH AND EXISTS ID WITH ## -## Ends in an error in state: 285. +## Ends in an error in state: 288. ## ## remote_fetch_stmt -> ID FETCH AND EXISTS ID . PERIOD ID nonempty_list(map_access) [ SEMICOLON EOF END BAR ] +## remote_fetch_stmt -> ID FETCH AND EXISTS ID . PERIOD LPAREN ID RPAREN nonempty_list(map_access) [ SEMICOLON EOF END BAR ] ## ## The known suffix of the stack is as follows: ## ID FETCH AND EXISTS ID @@ -2420,9 +2395,10 @@ Ends in an error in state: 279. stmts_term: ID FETCH AND EXISTS WITH ## -## Ends in an error in state: 284. +## Ends in an error in state: 287. ## ## remote_fetch_stmt -> ID FETCH AND EXISTS . ID PERIOD ID nonempty_list(map_access) [ SEMICOLON EOF END BAR ] +## remote_fetch_stmt -> ID FETCH AND EXISTS . ID PERIOD LPAREN ID RPAREN nonempty_list(map_access) [ SEMICOLON EOF END BAR ] ## ## The known suffix of the stack is as follows: ## ID FETCH AND EXISTS @@ -2432,7 +2408,7 @@ Ends in an error in state: 278. stmts_term: ID FETCH AND ID PERIOD ID WITH ## -## Ends in an error in state: 281. +## Ends in an error in state: 284. ## ## remote_fetch_stmt -> ID FETCH AND ID PERIOD ID . nonempty_list(map_access) [ SEMICOLON EOF END BAR ] ## sident -> ID . [ SEMICOLON EOF END BAR ] @@ -2447,7 +2423,7 @@ stmts_term: ID FETCH AND ID PERIOD LPAREN SPID WITH ## ## Ends in an error in state: 279. ## -## remote_fetch_stmt -> ID FETCH AND ID PERIOD LPAREN sident . RPAREN [ SEMICOLON EOF END BAR ] +## remote_fetch_stmt -> ID FETCH AND ID PERIOD LPAREN sident . RPAREN list(map_access) [ SEMICOLON EOF END BAR ] ## ## The known suffix of the stack is as follows: ## ID FETCH AND ID PERIOD LPAREN sident @@ -2459,7 +2435,7 @@ stmts_term: ID FETCH AND ID PERIOD LPAREN WITH ## ## Ends in an error in state: 278. ## -## remote_fetch_stmt -> ID FETCH AND ID PERIOD LPAREN . sident RPAREN [ SEMICOLON EOF END BAR ] +## remote_fetch_stmt -> ID FETCH AND ID PERIOD LPAREN . sident RPAREN list(map_access) [ SEMICOLON EOF END BAR ] ## ## The known suffix of the stack is as follows: ## ID FETCH AND ID PERIOD LPAREN @@ -2472,7 +2448,7 @@ stmts_term: ID FETCH AND ID PERIOD WITH ## Ends in an error in state: 277. ## ## remote_fetch_stmt -> ID FETCH AND ID PERIOD . sident [ SEMICOLON EOF END BAR ] -## remote_fetch_stmt -> ID FETCH AND ID PERIOD . LPAREN sident RPAREN [ SEMICOLON EOF END BAR ] +## remote_fetch_stmt -> ID FETCH AND ID PERIOD . LPAREN sident RPAREN list(map_access) [ SEMICOLON EOF END BAR ] ## remote_fetch_stmt -> ID FETCH AND ID PERIOD . ID nonempty_list(map_access) [ SEMICOLON EOF END BAR ] ## ## The known suffix of the stack is as follows: @@ -2486,7 +2462,7 @@ stmts_term: ID FETCH AND ID WITH ## Ends in an error in state: 276. ## ## remote_fetch_stmt -> ID FETCH AND ID . PERIOD sident [ SEMICOLON EOF END BAR ] -## remote_fetch_stmt -> ID FETCH AND ID . PERIOD LPAREN sident RPAREN [ SEMICOLON EOF END BAR ] +## remote_fetch_stmt -> ID FETCH AND ID . PERIOD LPAREN sident RPAREN list(map_access) [ SEMICOLON EOF END BAR ] ## remote_fetch_stmt -> ID FETCH AND ID . PERIOD ID nonempty_list(map_access) [ SEMICOLON EOF END BAR ] ## sident -> ID . [ AS ] ## @@ -2498,13 +2474,13 @@ Either blockchain state variable or remote field read expected. stmts_term: ID FETCH AND SPID AS CID UNDERSCORE ## -## Ends in an error in state: 301. +## Ends in an error in state: 307. ## ## address_typ -> CID . WITH END [ SEMICOLON EOF END BAR ] ## address_typ -> CID . WITH CONTRACT loption(separated_nonempty_list(COMMA,address_type_field)) END [ SEMICOLON EOF END BAR ] ## address_typ -> CID . WITH LIBRARY END [ SEMICOLON EOF END BAR ] ## address_typ -> CID . WITH SPID END [ SEMICOLON EOF END BAR ] -## address_typ -> CID . WITH CONTRACT LPAREN loption(separated_nonempty_list(COMMA,param_pair)) RPAREN loption(separated_nonempty_list(COMMA,address_type_field)) END [ SEMICOLON EOF END BAR ] +## address_typ -> CID . WITH CONTRACT LPAREN separated_nonempty_list(COMMA,param_pair) RPAREN loption(separated_nonempty_list(COMMA,address_type_field)) END [ SEMICOLON EOF END BAR ] ## ## The known suffix of the stack is as follows: ## CID @@ -2514,7 +2490,7 @@ Casts to non-ByStr20 types are not allowed. stmts_term: ID FETCH AND SPID AS WITH ## -## Ends in an error in state: 300. +## Ends in an error in state: 306. ## ## remote_fetch_stmt -> ID FETCH AND sident AS . address_typ [ SEMICOLON EOF END BAR ] ## @@ -2551,7 +2527,7 @@ Ends in an error in state: 267. lmodule: SCILLA_VERSION WITH ## -## Ends in an error in state: 358. +## Ends in an error in state: 364. ## ## lmodule -> SCILLA_VERSION . NUMLIT imports library EOF [ # ] ## @@ -2563,7 +2539,7 @@ Ends in an error in state: 343. exp_term: BUILTIN ID LBRACE RBRACE CATCH ## -## Ends in an error in state: 178. +## Ends in an error in state: 177. ## ## simple_exp -> BUILTIN ID option(ctargs) . builtin_args [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -2575,7 +2551,7 @@ Ends in an error in state: 172. exp_term: EMP CID TYPE ## -## Ends in an error in state: 153. +## Ends in an error in state: 152. ## ## lit -> EMP t_map_key . t_map_value [ TYPE TRANSITION SEMICOLON RBRACE PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -2594,7 +2570,7 @@ Ends in an error in state: 147. exp_term: FUN LPAREN ID COLON TID EQ ## -## Ends in an error in state: 168. +## Ends in an error in state: 167. ## ## simple_exp -> FUN LPAREN id_with_typ . RPAREN ARROW exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -2625,7 +2601,7 @@ Ends in an error in state: 23. exp_term: LET ID COLON CID RPAREN ## -## Ends in an error in state: 208. +## Ends in an error in state: 207. ## ## simple_exp -> LET ID type_annot . EQ simple_exp IN exp [ TYPE TRANSITION SEMICOLON PROCEDURE LET IN FIELD EOF END CONTRACT BAR ARROW ] ## @@ -2646,7 +2622,7 @@ Ends in an error in state: 202. exp_term: MATCH SPID WITH BAR UNDERSCORE ARROW STRING WITH ## -## Ends in an error in state: 216. +## Ends in an error in state: 215. ## ## list(exp_pm_clause) -> exp_pm_clause . list(exp_pm_clause) [ END ] ## @@ -2658,7 +2634,7 @@ match-expression is probably missing `end` keyword. cmodule: SCILLA_VERSION NUMLIT CONTRACT CID LPAREN RPAREN FIELD ID COLON TID EQ STRING WITH ## -## Ends in an error in state: 345. +## Ends in an error in state: 351. ## ## list(field) -> field . list(field) [ TRANSITION PROCEDURE EOF ] ## @@ -2737,7 +2713,7 @@ Ends in an error in state: 226. cmodule: SCILLA_VERSION NUMLIT LIBRARY CID LET ID COLON CID RPAREN ## -## Ends in an error in state: 220. +## Ends in an error in state: 219. ## ## libentry -> LET ID type_annot . EQ exp [ TYPE LET EOF CONTRACT ] ## @@ -2758,7 +2734,7 @@ Ends in an error in state: 214. cmodule: SCILLA_VERSION NUMLIT LIBRARY CID LET ID EQ STRING WITH ## -## Ends in an error in state: 224. +## Ends in an error in state: 223. ## ## list(libentry) -> libentry . list(libentry) [ EOF CONTRACT ] ## @@ -2901,7 +2877,7 @@ This is an invalid map type, the map value type is likely incorrect. The map typ exp_term: MATCH SPID WITH BAR CID MAP ## -## Ends in an error in state: 133. +## Ends in an error in state: 132. ## ## pattern -> scid . list(arg_pattern) [ RPAREN ARROW ] ## @@ -2944,9 +2920,9 @@ Ends in an error in state: 29. Please report your example at https://github.com/ stmts_term: ID FETCH AND CID LPAREN WITH ## -## Ends in an error in state: 290. +## Ends in an error in state: 297. ## -## bcfetch_args -> LPAREN . loption(separated_nonempty_list(COMMA,sident)) RPAREN [ SEMICOLON EOF END BAR ] +## bcfetch_args -> LPAREN . separated_nonempty_list(COMMA,sident) RPAREN [ SEMICOLON EOF END BAR ] ## ## The known suffix of the stack is as follows: ## LPAREN @@ -2956,7 +2932,7 @@ Ends in an error in state: 290. Please report your example at https://github.com stmts_term: ID FETCH AND CID LPAREN ID WITH ## -## Ends in an error in state: 291. +## Ends in an error in state: 298. ## ## separated_nonempty_list(COMMA,sident) -> sident . [ RPAREN ] ## separated_nonempty_list(COMMA,sident) -> sident . COMMA separated_nonempty_list(COMMA,sident) [ RPAREN ] @@ -2969,7 +2945,7 @@ Ends in an error in state: 291. Please report your example at https://github.com stmts_term: ID FETCH AND CID LPAREN ID COMMA WITH ## -## Ends in an error in state: 292. +## Ends in an error in state: 299. ## ## separated_nonempty_list(COMMA,sident) -> sident COMMA . separated_nonempty_list(COMMA,sident) [ RPAREN ] ## @@ -2978,3 +2954,75 @@ stmts_term: ID FETCH AND CID LPAREN ID COMMA WITH ## Ends in an error in state: 292. Please report your example at https://github.com/Zilliqa/scilla/issues. + +type_term: CID WITH CONTRACT LPAREN ID COLON CID RPAREN WITH +## +## Ends in an error in state: 87. +## +## address_typ -> CID WITH CONTRACT LPAREN separated_nonempty_list(COMMA,param_pair) RPAREN . loption(separated_nonempty_list(COMMA,address_type_field)) END [ TYPE TRANSITION TID TARROW SEMICOLON RPAREN RBRACE PROCEDURE MAP LPAREN LET IN HEXLIT FIELD EQ EOF END CONTRACT COMMA CID BAR ARROW ] +## +## The known suffix of the stack is as follows: +## CID WITH CONTRACT LPAREN separated_nonempty_list(COMMA,param_pair) RPAREN +## + + + +stmts_term: ID FETCH AND ID PERIOD LPAREN ID RPAREN WITH +## +## Ends in an error in state: 280. +## +## remote_fetch_stmt -> ID FETCH AND ID PERIOD LPAREN sident RPAREN . list(map_access) [ SEMICOLON EOF END BAR ] +## +## The known suffix of the stack is as follows: +## ID FETCH AND ID PERIOD LPAREN sident RPAREN +## + + + +stmts_term: ID FETCH AND ID PERIOD LPAREN ID RPAREN LSQB ID RSQB WITH +## +## Ends in an error in state: 281. +## +## list(map_access) -> map_access . list(map_access) [ SEMICOLON EOF END BAR ] +## +## The known suffix of the stack is as follows: +## map_access +## + + + +stmts_term: ID FETCH AND EXISTS ID PERIOD LPAREN WITH +## +## Ends in an error in state: 290. +## +## remote_fetch_stmt -> ID FETCH AND EXISTS ID PERIOD LPAREN . ID RPAREN nonempty_list(map_access) [ SEMICOLON EOF END BAR ] +## +## The known suffix of the stack is as follows: +## ID FETCH AND EXISTS ID PERIOD LPAREN +## + + + +stmts_term: ID FETCH AND EXISTS ID PERIOD LPAREN ID WITH +## +## Ends in an error in state: 291. +## +## remote_fetch_stmt -> ID FETCH AND EXISTS ID PERIOD LPAREN ID . RPAREN nonempty_list(map_access) [ SEMICOLON EOF END BAR ] +## +## The known suffix of the stack is as follows: +## ID FETCH AND EXISTS ID PERIOD LPAREN ID +## + + + +stmts_term: ID FETCH AND EXISTS ID PERIOD LPAREN ID RPAREN WITH +## +## Ends in an error in state: 292. +## +## remote_fetch_stmt -> ID FETCH AND EXISTS ID PERIOD LPAREN ID RPAREN . nonempty_list(map_access) [ SEMICOLON EOF END BAR ] +## +## The known suffix of the stack is as follows: +## ID FETCH AND EXISTS ID PERIOD LPAREN ID RPAREN +## + + diff --git a/src/base/ScillaParser.mly b/src/base/ScillaParser.mly index 6c929aa50..a1498c8fc 100644 --- a/src/base/ScillaParser.mly +++ b/src/base/ScillaParser.mly @@ -66,6 +66,17 @@ | t -> PrimType t with | _ -> raise (exn ()) + let mk_contract_address_typ immutables mutables = + let open SType in + let mk_fs fs field_kind = List.fold_left (fun acc (id, t) -> + match IdLoc_Comp.Map.add acc ~key:id ~data:t with + | `Ok new_map -> new_map + | `Duplicate -> + raise (SyntaxError (("Duplicate " ^ field_kind ^ " name " ^ (ParserIdentifier.as_string id) ^ " in address type"), ParserIdentifier.get_rep id))) + IdLoc_Comp.Map.empty fs + in + Address (ContrAddr (mk_fs immutables "contract parameter", mk_fs mutables "field")) + let build_prim_literal_exn t v loc = match SLiteral.build_prim_literal t v with | Some l -> l @@ -243,22 +254,14 @@ t_map_value_allow_targs : | t = t_map_value { t } -address_typ : +address_typ: | d = CID; WITH; END; { if d = "ByStr20" then Address AnyAddr else raise (SyntaxError ("Invalid type", toLoc $startpos(d))) } | d = CID; WITH; CONTRACT; fs = separated_list(COMMA, address_type_field); END; { if d = "ByStr20" - then - let fs' = List.fold_left (fun acc (id, t) -> - match SType.IdLoc_Comp.Map.add acc ~key:id ~data:t with - | `Ok new_map -> new_map - | `Duplicate -> - raise (SyntaxError (Printf.sprintf "Duplicate field name %s in address type" (ParserIdentifier.as_string id), toLoc $startpos(d)))) - SType.IdLoc_Comp.Map.empty fs - in - Address (ContrAddr (SType.IdLoc_Comp.Map.empty, fs')) + then mk_contract_address_typ [] fs else raise (SyntaxError ("Invalid type", toLoc $startpos(d))) } | d = CID; WITH; LIBRARY; END; { if d = "ByStr20" @@ -269,9 +272,9 @@ address_typ : then Address CodeAddr else raise (SyntaxError ("Invalid type", toLoc $startpos(d))) } | (* Adding this production in preparation for contract parameters *) - d = CID; WITH; CONTRACT; LPAREN; _ps = separated_list(COMMA, param_pair); RPAREN; _fs = separated_list(COMMA, address_type_field); END; + d = CID; WITH; CONTRACT; LPAREN; ps = separated_nonempty_list(COMMA, param_pair); RPAREN; fs = separated_list(COMMA, address_type_field); END; { if d = "ByStr20" - then raise (SyntaxError ("Contract parameters in address types not yet supported", toLoc $startpos(d))) + then mk_contract_address_typ ps fs else raise (SyntaxError ("Invalid type", toLoc $startpos(d))) } typ : diff --git a/tests/base/parser/bad/gold/address_duplicate_field.scilla.gold b/tests/base/parser/bad/gold/address_duplicate_field.scilla.gold index 6dfa9e61d..5ae0c0638 100644 --- a/tests/base/parser/bad/gold/address_duplicate_field.scilla.gold +++ b/tests/base/parser/bad/gold/address_duplicate_field.scilla.gold @@ -4,8 +4,8 @@ "error_message": "Syntax error: Duplicate field name b in address type", "start_location": { "file": "base/parser/bad/address_duplicate_field.scilla", - "line": 8, - "column": 7 + "line": 11, + "column": 15 }, "end_location": { "file": "", "line": 0, "column": 0 } } From 58ae50fd4905dd2ffa4388b17e93285cac6a5db9 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Mon, 19 Dec 2022 14:28:10 +0100 Subject: [PATCH 12/33] Remove outdated comment --- src/base/ScillaParser.mly | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/base/ScillaParser.mly b/src/base/ScillaParser.mly index a1498c8fc..667e08331 100644 --- a/src/base/ScillaParser.mly +++ b/src/base/ScillaParser.mly @@ -460,8 +460,7 @@ remote_fetch_stmt: { RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), Mutable, keys, false), toLoc $startpos } | l = ID; FETCH; AND; EXISTS; adr = ID; PERIOD; LPAREN; r = ID; RPAREN; keys = nonempty_list(map_access) { RemoteMapGet(to_loc_id l (toLoc $startpos(l)), to_loc_id adr (toLoc $startpos(adr)), to_loc_id r (toLoc $startpos(r)), Immutable, keys, false), toLoc $startpos } -| (* Adding this production in preparation for address type casts *) - l = ID; FETCH; AND; adr = sident; AS; t = address_typ +| l = ID; FETCH; AND; adr = sident; AS; t = address_typ { TypeCast(to_loc_id l (toLoc $startpos(l)), adr, t), toLoc $startpos } stmt_pm_clause: From db83e7c999b57ce24bf349b9af7c6df1666a5f38 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Mon, 19 Dec 2022 14:29:19 +0100 Subject: [PATCH 13/33] Test cparam remote reads in scilla-checker --- tests/base/parser/bad/Bad.ml | 2 + .../address_type_duplicate_parameter.scilla | 8 + .../bad/address_type_empty_parameter.scilla | 8 + ...dress_type_duplicate_parameter.scilla.gold | 15 + .../address_type_empty_parameter.scilla.gold | 14 + tests/checker/good/Good.ml | 1 + .../remote_state_reads_cparam.scilla.gold | 346 ++++++++++++++++++ .../remote_state_reads_cparam.scilla | 95 +++++ 8 files changed, 489 insertions(+) create mode 100644 tests/base/parser/bad/address_type_duplicate_parameter.scilla create mode 100644 tests/base/parser/bad/address_type_empty_parameter.scilla create mode 100644 tests/base/parser/bad/gold/address_type_duplicate_parameter.scilla.gold create mode 100644 tests/base/parser/bad/gold/address_type_empty_parameter.scilla.gold create mode 100644 tests/checker/good/gold/remote_state_reads_cparam.scilla.gold create mode 100644 tests/contracts/remote_state_reads_cparam.scilla diff --git a/tests/base/parser/bad/Bad.ml b/tests/base/parser/bad/Bad.ml index b63003297..5768e14be 100644 --- a/tests/base/parser/bad/Bad.ml +++ b/tests/base/parser/bad/Bad.ml @@ -36,6 +36,8 @@ module Tests = Scilla_test.Util.DiffBasedTests (struct [ "address_duplicate_field.scilla"; "address_spid_as_field.scilla"; + "address_type_duplicate_parameter.scilla"; + "address_type_empty_parameter.scilla"; "bad_cast_2.scilla"; "bad_cast_3.scilla"; "bad_map_key_2.scilla"; diff --git a/tests/base/parser/bad/address_type_duplicate_parameter.scilla b/tests/base/parser/bad/address_type_duplicate_parameter.scilla new file mode 100644 index 000000000..1d4cdf550 --- /dev/null +++ b/tests/base/parser/bad/address_type_duplicate_parameter.scilla @@ -0,0 +1,8 @@ +scilla_version 0 + +contract T () + + (* Duplicate parameter names not allowed in address type *) +transition F (z : ByStr20 with contract (x : Uint128, x : Uint64) end) + y <-& x._balance +end \ No newline at end of file diff --git a/tests/base/parser/bad/address_type_empty_parameter.scilla b/tests/base/parser/bad/address_type_empty_parameter.scilla new file mode 100644 index 000000000..d105d0bd1 --- /dev/null +++ b/tests/base/parser/bad/address_type_empty_parameter.scilla @@ -0,0 +1,8 @@ +scilla_version 0 + +contract T () + + (* When using () in an address type, must include at least one contract parameter *) +transition F (z : ByStr20 with contract () end) + y <-& x._balance +end \ No newline at end of file diff --git a/tests/base/parser/bad/gold/address_type_duplicate_parameter.scilla.gold b/tests/base/parser/bad/gold/address_type_duplicate_parameter.scilla.gold new file mode 100644 index 000000000..3fc5eedd4 --- /dev/null +++ b/tests/base/parser/bad/gold/address_type_duplicate_parameter.scilla.gold @@ -0,0 +1,15 @@ +{ + "errors": [ + { + "error_message": + "Syntax error: Duplicate contract parameter name x in address type", + "start_location": { + "file": "base/parser/bad/address_type_duplicate_parameter.scilla", + "line": 6, + "column": 55 + }, + "end_location": { "file": "", "line": 0, "column": 0 } + } + ], + "warnings": [] +} \ No newline at end of file diff --git a/tests/base/parser/bad/gold/address_type_empty_parameter.scilla.gold b/tests/base/parser/bad/gold/address_type_empty_parameter.scilla.gold new file mode 100644 index 000000000..9c88f979a --- /dev/null +++ b/tests/base/parser/bad/gold/address_type_empty_parameter.scilla.gold @@ -0,0 +1,14 @@ +{ + "errors": [ + { + "error_message": "Ends in an error in state: 29.\n", + "start_location": { + "file": "base/parser/bad/address_type_empty_parameter.scilla", + "line": 6, + "column": 43 + }, + "end_location": { "file": "", "line": 0, "column": 0 } + } + ], + "warnings": [] +} \ No newline at end of file diff --git a/tests/checker/good/Good.ml b/tests/checker/good/Good.ml index 358ce3c80..da2c4b3f8 100644 --- a/tests/checker/good/Good.ml +++ b/tests/checker/good/Good.ml @@ -70,6 +70,7 @@ module Tests = Scilla_test.Util.DiffBasedTests (struct "shadow_import.scilla"; "remote_state_reads.scilla"; "remote_state_reads_2.scilla"; + "remote_state_reads_cparam.scilla"; "address_eq_test.scilla"; "address_list_traversal.scilla"; "polymorphic_address.scilla"; diff --git a/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold b/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold new file mode 100644 index 000000000..1aba16d60 --- /dev/null +++ b/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold @@ -0,0 +1,346 @@ +{ + "cashflow_tags": { + "State variables": [ + { "field": "cparam1", "tag": "NoInfo" }, + { "field": "remote_reads_test_res_1", "tag": "NoInfo" }, + { "field": "remote_reads_test_res_2", "tag": "(AddressADT )" }, + { "field": "remote_reads_test_res_3_2", "tag": "NoInfo" }, + { "field": "remote_reads_test_res_3_3", "tag": "NoInfo" }, + { "field": "remote_reads_test_res_4_1", "tag": "NoInfo" }, + { "field": "remote_reads_test_res_4_2", "tag": "NoInfo" }, + { "field": "remote_reads_test_res_5_1", "tag": "NoInfo" }, + { "field": "remote_reads_test_res_5_3", "tag": "(Option NoInfo)" }, + { "field": "remote_reads_test_res_5_5", "tag": "(Option NoInfo)" }, + { "field": "remote_reads_test_res_6_1", "tag": "NoInfo" }, + { "field": "remote_reads_test_res_6_2", "tag": "NoInfo" }, + { "field": "remote_reads_test_res_7_3", "tag": "(Option NotMoney)" }, + { "field": "remote_reads_test_res_7_6", "tag": "(Option NotMoney)" } + ], + "ADT constructors": [] + }, + "contract_info": { + "scilla_major_version": "0", + "vname": "RRCPContract", + "params": [ { "vname": "cparam1", "type": "ByStr20 with end" } ], + "fields": [ + { "vname": "remote_reads_test_res_1", "type": "Uint128", "depth": 0 }, + { + "vname": "remote_reads_test_res_2", + "type": "remote_state_reads_cparam.AddressADT", + "depth": 0 + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "depth": 0 }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "depth": 0 }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "depth": 0 }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "depth": 0 }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "depth": 1 + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "depth": 0 + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "depth": 0 + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "depth": 0 }, + { "vname": "remote_reads_test_res_6_2", "type": "Uint64", "depth": 0 }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "depth": 0 + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "depth": 0 + } + ], + "transitions": [ + { + "vname": "RemoteReadContractParameterTest1", + "params": [ + { + "vname": "remote1", + "type": "ByStr20 with contract (x : Uint128) end" + } + ] + }, + { + "vname": "RemoteReadContractParameterTest2", + "params": [ + { + "vname": "remote2", + "type": + "ByStr20 with contract (x : remote_state_reads_cparam.AddressADT) end" + } + ] + }, + { + "vname": "RemoteReadContractParameterTest3", + "params": [ + { + "vname": "remote3", + "type": + "ByStr20 with contract (x : ByStr20 with contract (x : Uint128) field y : Uint64 end) end" + } + ] + }, + { + "vname": "RemoteReadContractParameterTest4", + "params": [ + { + "vname": "remote4", + "type": "ByStr20 with contract (x : Uint128, y : String) end" + } + ] + }, + { + "vname": "RemoteReadContractParameterTest5", + "params": [ + { + "vname": "remote5", + "type": "ByStr20 with contract (x : Map (Uint128) (Bool)) end" + } + ] + }, + { + "vname": "RemoteReadContractParameterTest6", + "params": [ + { + "vname": "remote6", + "type": + "ByStr20 with contract (x : Uint128) field x : Uint64 end" + } + ] + }, + { + "vname": "RemoteReadContractParameterTest7", + "params": [ + { + "vname": "remote7", + "type": + "ByStr20 with contract (x : Uint128, y : Uint64) field x : Uint128, field y : Uint64 end" + } + ] + } + ], + "procedures": [], + "events": [], + "ADTs": [ + { + "tname": "Option", + "tparams": [ "'A" ], + "tmap": [ + { "cname": "Some", "argtypes": [ "'A" ] }, + { "cname": "None", "argtypes": [] } + ] + }, + { + "tname": "remote_state_reads_cparam.AddressADT", + "tparams": [], + "tmap": [ + { + "cname": "remote_state_reads_cparam.Address1", + "argtypes": [ "ByStr20 with end" ] + }, + { + "cname": "remote_state_reads_cparam.Address2", + "argtypes": [ + "ByStr20 with contract (param : ByStr20 with contract (x : Uint128) end) field admin : ByStr20 with end end" + ] + } + ] + }, + { + "tname": "Bool", + "tparams": [], + "tmap": [ + { "cname": "True", "argtypes": [] }, + { "cname": "False", "argtypes": [] } + ] + }, + { + "tname": "Nat", + "tparams": [], + "tmap": [ + { "cname": "Zero", "argtypes": [] }, + { "cname": "Succ", "argtypes": [ "Nat" ] } + ] + }, + { + "tname": "List", + "tparams": [ "'A" ], + "tmap": [ + { "cname": "Cons", "argtypes": [ "'A", "List ('A)" ] }, + { "cname": "Nil", "argtypes": [] } + ] + }, + { + "tname": "Pair", + "tparams": [ "'A", "'B" ], + "tmap": [ { "cname": "Pair", "argtypes": [ "'A", "'B" ] } ] + } + ] + }, + "warnings": [ + { + "warning_message": "Write only field: remote_reads_test_res_7_6", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 93, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_reads_test_res_7_3", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 89, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_reads_test_res_6_2", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 80, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_reads_test_res_6_1", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 78, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_reads_test_res_5_5", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 71, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_reads_test_res_5_3", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 68, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_reads_test_res_5_1", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 64, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_reads_test_res_4_2", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 57, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_reads_test_res_4_1", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 56, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_reads_test_res_3_3", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 48, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_reads_test_res_3_2", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 46, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_reads_test_res_2", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 38, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_reads_test_res_1", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 31, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Unused ADT constructor: Address2", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 8, + "column": 1 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": + "No transition in contract RRCPContract contains an accept statement\n", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 10, + "column": 10 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 1 + } + ], + "gas_remaining": "7999" +} + diff --git a/tests/contracts/remote_state_reads_cparam.scilla b/tests/contracts/remote_state_reads_cparam.scilla new file mode 100644 index 000000000..5e70b3680 --- /dev/null +++ b/tests/contracts/remote_state_reads_cparam.scilla @@ -0,0 +1,95 @@ +scilla_version 0 + +library RRCPLib + +(* Tests various aspects of address types with contract parameters *) +type AddressADT = +| Address1 of ByStr20 with end +| Address2 of ByStr20 with contract (param : ByStr20 with contract (x : Uint128) end) field admin : ByStr20 with end end + +contract RRCPContract ( + cparam1: ByStr20 with end) + +field remote_reads_test_res_1 : Uint128 = Uint128 0 (* (x) of remote1 *) +field remote_reads_test_res_2 : AddressADT = Address1 cparam1 (* (x) of remote2 *) +field remote_reads_test_res_3_2 : Uint128 = Uint128 0 (* (x) of remote3, then (x) of (x) *) +field remote_reads_test_res_3_3 : Uint64 = Uint64 0 (* (x) of remote3, then y of (x) *) +field remote_reads_test_res_4_1 : Uint128 = Uint128 0 (* (x) of remote4 *) +field remote_reads_test_res_4_2 : String = "" (* (y) of remote4 *) +field remote_reads_test_res_5_1 : Map Uint128 Bool = Emp Uint128 Bool (* (x) of remote5 *) +field remote_reads_test_res_5_3 : Option Bool = None { Bool } (* exists (x)[0] of remote5 *) +field remote_reads_test_res_5_5 : Option (Option Bool) = None { (Option Bool) } (* (x)[0] of remote5 *) +field remote_reads_test_res_6_1 : Uint128 = Uint128 0 (* (x) of remote6 *) +field remote_reads_test_res_6_2 : Uint64 = Uint64 0 (* x of remote6 *) +field remote_reads_test_res_7_3 : Option Bool = None { Bool } (* (x) = x in remote7 *) +field remote_reads_test_res_7_6 : Option Bool = None { Bool } (* (y) = y in remote7 *) + +transition RemoteReadContractParameterTest1( + remote1: ByStr20 with contract (x : Uint128) end + ) + tmp_1 <-& remote1.(x); + remote_reads_test_res_1 := tmp_1 +end + +transition RemoteReadContractParameterTest2( + remote2: ByStr20 with contract (x : AddressADT) end + ) + tmp_2 <-& remote2.(x); + remote_reads_test_res_2 := tmp_2 +end + +transition RemoteReadContractParameterTest3( + remote3: ByStr20 with contract (x : ByStr20 with contract (x : Uint128) field y : Uint64 end) end + ) + tmp_3_1 <-& remote3.(x); + tmp_3_2 <-& tmp_3_1.(x); + remote_reads_test_res_3_2 := tmp_3_2; + tmp_3_3 <-& tmp_3_1.y; + remote_reads_test_res_3_3 := tmp_3_3 +end + +transition RemoteReadContractParameterTest4( + remote4: ByStr20 with contract (x : Uint128, y : String) end + ) + tmp_4_1 <-& remote4.(x); + tmp_4_2 <-& remote4.(y); + remote_reads_test_res_4_1 := tmp_4_1; + remote_reads_test_res_4_2 := tmp_4_2 +end + +transition RemoteReadContractParameterTest5( + remote5: ByStr20 with contract (x : Map Uint128 Bool) end + ) + tmp_5_1 <-& remote5.(x); + remote_reads_test_res_5_1 := tmp_5_1; + zero = Uint128 0 ; + tmp_5_2 <-& exists remote5.(x)[zero]; + tmp_5_3 = Some { Bool } tmp_5_2; + remote_reads_test_res_5_3 := tmp_5_3; + tmp_5_4 <-& remote5.(x)[zero]; + tmp_5_5 = Some { (Option Bool) } tmp_5_4; + remote_reads_test_res_5_5 := tmp_5_5 +end + +transition RemoteReadContractParameterTest6( + remote6: ByStr20 with contract (x : Uint128) field x : Uint64 end + ) + tmp_6_1 <-& remote6.(x); + remote_reads_test_res_6_1 := tmp_6_1; + tmp_6_2 <-& remote6.x; + remote_reads_test_res_6_2 := tmp_6_2 +end + +transition RemoteReadContractParameterTest7( + remote7: ByStr20 with contract (x : Uint128, y : Uint64) field y : Uint64, field x : Uint128 end + ) + tmp_7_1 <-& remote7.(x); + tmp_7_2 <-& remote7.x; + tmp_7_3 = let res = builtin eq tmp_7_1 tmp_7_2 in Some { Bool } res; + remote_reads_test_res_7_3 := tmp_7_3; + tmp_7_4 <-& remote7.(y); + tmp_7_5 <-& remote7.y; + tmp_7_6 = let res = builtin eq tmp_7_4 tmp_7_5 in Some { Bool } res; + remote_reads_test_res_7_6 := tmp_7_6 +end + From 911e0a57ce21d47e55cee3c18a218936bec9d32f Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Tue, 20 Dec 2022 12:20:55 +0100 Subject: [PATCH 14/33] EvalUtil should treat special fields (_balance and such) as mutable --- src/eval/EvalUtil.ml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/eval/EvalUtil.ml b/src/eval/EvalUtil.ml index 476d1c192..fe87338a8 100644 --- a/src/eval/EvalUtil.ml +++ b/src/eval/EvalUtil.ml @@ -397,7 +397,7 @@ module Configuration = struct (* Check that sender balance is sufficient *) let%bind sender_addr = lookup_sender_addr st in let%bind sender_balance_l = - remote_load st sender_addr (mk_loc_id balance_label) false + remote_load st sender_addr (mk_loc_id balance_label) true in let incoming' = st.incoming_funds in match sender_balance_l with @@ -555,7 +555,7 @@ module EvalTypecheck = struct let is_contract_addr ~caddr = let this_id = EvalIdentifier.mk_loc_id this_address_label in let%bind _, this_typ_opt = - StateService.external_fetch ~caddr ~fname:this_id ~_mutable_field:false ~keys:[] ~ignoreval:true + StateService.external_fetch ~caddr ~fname:this_id ~_mutable_field:true ~keys:[] ~ignoreval:true in pure @@ Option.is_some this_typ_opt @@ -563,7 +563,7 @@ module EvalTypecheck = struct let is_library_or_contract_addr ~caddr = let this_id = EvalIdentifier.mk_loc_id codehash_label in let%bind _, this_typ_opt = - StateService.external_fetch ~caddr ~fname:this_id ~_mutable_field:false ~keys:[] ~ignoreval:true + StateService.external_fetch ~caddr ~fname:this_id ~_mutable_field:true ~keys:[] ~ignoreval:true in pure @@ Option.is_some this_typ_opt @@ -578,11 +578,11 @@ module EvalTypecheck = struct let balance_id = EvalIdentifier.mk_loc_id balance_label in let nonce_id = EvalIdentifier.mk_loc_id nonce_label in let%bind balance_lit, _ = - StateService.external_fetch ~caddr ~fname:balance_id ~_mutable_field:false ~keys:[] + StateService.external_fetch ~caddr ~fname:balance_id ~_mutable_field:true ~keys:[] ~ignoreval:false in let%bind nonce_lit, _ = - StateService.external_fetch ~caddr ~fname:nonce_id ~_mutable_field:false ~keys:[] + StateService.external_fetch ~caddr ~fname:nonce_id ~_mutable_field:true ~keys:[] ~ignoreval:false in match (balance_lit, nonce_lit) with From 4882b2eac30329e41f4d2a850cd6e9ef1add121a Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Wed, 21 Dec 2022 02:55:38 +0100 Subject: [PATCH 15/33] Fix most of EvalUtil and StateService --- src/eval/EvalUtil.ml | 28 ++++++++--------- src/eval/Runner.ml | 8 ++--- src/eval/StateIPCClient.ml | 4 +-- src/eval/StateIPCClient.mli | 2 ++ src/eval/StateService.ml | 63 ++++++++++++++++++++----------------- 5 files changed, 56 insertions(+), 49 deletions(-) diff --git a/src/eval/EvalUtil.ml b/src/eval/EvalUtil.ml index fe87338a8..06090b93e 100644 --- a/src/eval/EvalUtil.ml +++ b/src/eval/EvalUtil.ml @@ -191,10 +191,10 @@ module Configuration = struct ~inst:(EvalName.as_error_string i) (ER.get_loc (get_rep k)) - let remote_load st caddr k mutable_field = + let remote_load st caddr k is_mutable = let%bind fval = fromR - @@ StateService.external_fetch ~caddr ~fname:k ~_mutable_field:mutable_field ~keys:[] ~ignoreval:false + @@ StateService.external_fetch ~caddr ~fname:k ~is_mutable ~keys:[] ~ignoreval:false in match fval with | Some v, _ -> @@ -227,10 +227,10 @@ module Configuration = struct ~inst:(EvalName.as_error_string (get_id k)) (ER.get_loc (get_rep k)) - let remote_field_type caddr k mutable_field = + let remote_field_type caddr k is_mutable = let%bind fval = fromR - @@ StateService.external_fetch ~caddr ~fname:k ~_mutable_field:mutable_field ~keys:[] ~ignoreval:true + @@ StateService.external_fetch ~caddr ~fname:k ~is_mutable ~keys:[] ~ignoreval:true in match fval with | _, Some ty -> pure ty @@ -270,23 +270,23 @@ module Configuration = struct (ER.get_loc (get_rep m)) else let%bind is_member = - fromR @@ StateService.is_member ~fname:m ~keys:klist + fromR @@ StateService.is_member ~fname:m ~is_mutable:true ~keys:klist in pure @@ EvalLiteral.build_bool_lit is_member - let remote_map_get caddr m mutable_field keys fetchval = + let remote_map_get caddr m is_mutable keys fetchval = let open EvalLiteral in if fetchval then (* We need to fetch the type in advance because the type-option returned * by the actual call may be None if the key(s) wasn't found, * (but the map map field itself still exists). *) - let%bind mt = remote_field_type caddr m mutable_field in + let%bind mt = remote_field_type caddr m is_mutable in let%bind vt = fromR @@ EvalTypeUtilities.map_access_type mt (List.length keys) in let%bind vopt, _ = fromR - @@ StateService.external_fetch ~caddr ~fname:m ~_mutable_field:mutable_field ~keys ~ignoreval:false + @@ StateService.external_fetch ~caddr ~fname:m ~is_mutable ~keys ~ignoreval:false in (* Need to wrap the result in a Scilla Option. *) match vopt with @@ -295,7 +295,7 @@ module Configuration = struct else let%bind _, topt = fromR - @@ StateService.external_fetch ~caddr ~fname:m ~_mutable_field:mutable_field ~keys ~ignoreval:true + @@ StateService.external_fetch ~caddr ~fname:m ~is_mutable ~keys ~ignoreval:true in pure @@ EvalLiteral.build_bool_lit (Option.is_some topt) @@ -555,7 +555,7 @@ module EvalTypecheck = struct let is_contract_addr ~caddr = let this_id = EvalIdentifier.mk_loc_id this_address_label in let%bind _, this_typ_opt = - StateService.external_fetch ~caddr ~fname:this_id ~_mutable_field:true ~keys:[] ~ignoreval:true + StateService.external_fetch ~caddr ~fname:this_id ~is_mutable:true ~keys:[] ~ignoreval:true in pure @@ Option.is_some this_typ_opt @@ -563,7 +563,7 @@ module EvalTypecheck = struct let is_library_or_contract_addr ~caddr = let this_id = EvalIdentifier.mk_loc_id codehash_label in let%bind _, this_typ_opt = - StateService.external_fetch ~caddr ~fname:this_id ~_mutable_field:true ~keys:[] ~ignoreval:true + StateService.external_fetch ~caddr ~fname:this_id ~is_mutable:true ~keys:[] ~ignoreval:true in pure @@ Option.is_some this_typ_opt @@ -578,11 +578,11 @@ module EvalTypecheck = struct let balance_id = EvalIdentifier.mk_loc_id balance_label in let nonce_id = EvalIdentifier.mk_loc_id nonce_label in let%bind balance_lit, _ = - StateService.external_fetch ~caddr ~fname:balance_id ~_mutable_field:true ~keys:[] + StateService.external_fetch ~caddr ~fname:balance_id ~is_mutable:true ~keys:[] ~ignoreval:false in let%bind nonce_lit, _ = - StateService.external_fetch ~caddr ~fname:nonce_id ~_mutable_field:true ~keys:[] + StateService.external_fetch ~caddr ~fname:nonce_id ~is_mutable:true ~keys:[] ~ignoreval:false in match (balance_lit, nonce_lit) with @@ -605,7 +605,7 @@ module EvalTypecheck = struct let checker fts mutables = allM fts ~f:(fun (f, t) -> let%bind res = - StateService.external_fetch ~caddr ~fname:f ~_mutable_field:mutables ~keys:[] ~ignoreval:true + StateService.external_fetch ~caddr ~fname:f ~is_mutable:mutables ~keys:[] ~ignoreval:true in match res with | _, Some ext_typ -> diff --git a/src/eval/Runner.ml b/src/eval/Runner.ml index f7c22ed2f..6ea3e44ef 100644 --- a/src/eval/Runner.ml +++ b/src/eval/Runner.ml @@ -518,7 +518,7 @@ let run_with_args args = let fields = List.filter_map cstate'.fields ~f:(fun (s, t) -> if [%equal: RunnerName.t] s balance_label then None - else Some { fname = s; ftyp = t; fval = None }) + else Some { fname = s; f_is_mutable = true; ftyp = t; fval = None }) in let sm = IPC args.ipc_address in let () = @@ -602,7 +602,7 @@ let run_with_args args = List.filter_map cstate.fields ~f:(fun (s, t) -> let open StateService in if [%equal: RunnerName.t] s balance_label then None - else Some { fname = s; ftyp = t; fval = None }) + else Some { fname = s; f_is_mutable = true; ftyp = t; fval = None }) in let () = StateService.initialize ~sm:(IPC args.ipc_address) ~fields @@ -654,14 +654,14 @@ let run_with_args args = let fields = List.map field_vals ~f:(fun (s, t, l) -> let open StateService in - { fname = s; ftyp = t; fval = Some l }) + { fname = s; f_is_mutable = true; ftyp = t; fval = Some l }) in let ext_states = let open StateService in List.map ext_states ~f:(fun (addr, fields) -> let fields' = List.map fields ~f:(fun (n, t, l) -> - { fname = n; ftyp = t; fval = Some l }) + { fname = n; f_is_mutable = true (* TODO: handle immutables *); ftyp = t; fval = Some l }) in { caddr = addr; cstate = fields' }) in diff --git a/src/eval/StateIPCClient.ml b/src/eval/StateIPCClient.ml index 25802bbb5..47db82d43 100644 --- a/src/eval/StateIPCClient.ml +++ b/src/eval/StateIPCClient.ml @@ -194,7 +194,7 @@ let fetch ~socket_addr ~fname ~keys ~tp = * if ~ignoreval is false: (Some val, Some type) is returned * Else: (None, None) is returned *) -let external_fetch ~socket_addr ~caddr ~fname ~keys ~ignoreval = +let external_fetch ~socket_addr ~caddr ~fname ~(_is_mutable:bool) ~keys ~ignoreval = let open Ipcmessage_types in let q = { @@ -254,7 +254,7 @@ let update ~socket_addr ~fname ~keys ~value ~tp = pure () (* Is a key in a map. keys must be non-empty. *) -let is_member ~socket_addr ~fname ~keys ~tp = +let is_member ~socket_addr ~fname ~(_is_mutable:bool) ~keys ~tp = let open Ipcmessage_types in let q = { diff --git a/src/eval/StateIPCClient.mli b/src/eval/StateIPCClient.mli index a208f2069..862c8e03d 100644 --- a/src/eval/StateIPCClient.mli +++ b/src/eval/StateIPCClient.mli @@ -39,6 +39,7 @@ val external_fetch : socket_addr:string -> caddr:string -> fname:'a IPCCIdentifier.t -> + _is_mutable: bool -> keys:IPCCLiteral.t list -> ignoreval:bool -> (IPCCLiteral.t option * IPCCType.t option, scilla_error list) result @@ -56,6 +57,7 @@ val update : val is_member : socket_addr:string -> fname:loc IPCCIdentifier.t -> + _is_mutable:bool -> keys:IPCCLiteral.t list -> tp:IPCCType.t -> (bool, scilla_error list) result diff --git a/src/eval/StateService.ml b/src/eval/StateService.ml index 1bbc43f33..a0a889109 100644 --- a/src/eval/StateService.ml +++ b/src/eval/StateService.ml @@ -36,6 +36,7 @@ open SSIdentifier type ss_field = { fname : SSName.t; + f_is_mutable : bool; ftyp : SSType.t; fval : SSLiteral.t option; (* We may or may not have the value in memory. *) } @@ -69,25 +70,26 @@ module MakeStateService () = struct | Uninitialized -> fail0 ~kind:"StateService: Uninitialized" ?inst:None | SS (sm, fields, estates, bcinfo) -> pure (sm, fields, estates, bcinfo) - let field_type fields fname = + let field_type fields fname is_mutable = match - List.find fields ~f:(fun z -> [%equal: SSName.t] z.fname (get_id fname)) + List.find fields ~f:(fun z -> [%equal: SSName.t] z.fname (get_id fname) && ([%equal:bool] z.f_is_mutable is_mutable)) with | Some f -> pure @@ f.ftyp | None -> fail1 ~kind: - (sprintf "StateService: Unable to determine the type of field %s." + (sprintf "StateService: Unable to determine the type of %s %s." + (if is_mutable then "field" else "contract parameter") (as_error_string fname)) ?inst:None (ER.get_loc (get_rep fname)) - let fetch_local ~fname ~keys fields = + let fetch_local ~fname ~is_mutable ~keys fields = let s = fields in match - List.find s ~f:(fun z -> [%equal: SSName.t] z.fname (get_id fname)) + List.find s ~f:(fun z -> [%equal: SSName.t] z.fname (get_id fname) && ([%equal:bool] z.f_is_mutable is_mutable)) with - | Some { fname = _; ftyp = MapType _; fval = Some (Map ((kt, vt), mlit)) } + | Some { fname = _; f_is_mutable = _ ; ftyp = MapType _; fval = Some (Map ((kt, vt), mlit)) } when not @@ List.is_empty keys -> let%bind ret_val_type = SSTypeUtil.map_access_type (MapType (kt, vt)) (List.length keys) @@ -139,11 +141,12 @@ module MakeStateService () = struct (ER.get_loc (get_rep fname)) in recurser mlit keys vt - | Some { fname = _; ftyp = _; fval = Some l } -> pure @@ Some l + | Some { fname = _; f_is_mutable = _ ; ftyp = _; fval = Some l } -> pure @@ Some l | _ -> fail1 ~kind: - (sprintf "StateService: field \"%s\" not found.\n" + (sprintf "StateService: %s \"%s\" not found.\n" + (if is_mutable then "field" else "contract parameter") (as_error_string fname)) ?inst:None (ER.get_loc (get_rep fname)) @@ -152,7 +155,7 @@ module MakeStateService () = struct let%bind sm, fields, _estates, _bcinfo = assert_init () in match sm with | IPC socket_addr -> ( - let%bind tp = field_type fields fname in + let%bind tp = field_type fields fname true in let%bind res = StateIPCClient.fetch ~socket_addr ~fname ~keys ~tp in if not @@ List.is_empty keys then pure @@ res else @@ -165,7 +168,7 @@ module MakeStateService () = struct ?inst:None (ER.get_loc (get_rep fname)) | Some _res' -> pure @@ res) - | Local -> fetch_local ~fname ~keys fields + | Local -> fetch_local ~fname ~is_mutable:true ~keys fields let fetch_bcinfo ~query_name ~query_args = let%bind sm, _fields, _estates, bcinfo = assert_init () in @@ -194,12 +197,12 @@ module MakeStateService () = struct * if ~ignoreval is false: (Some val, Some type) is returned * Else: (None, None) is returned *) - let external_fetch ~caddr ~fname ~(_mutable_field:bool) ~keys ~ignoreval = + let external_fetch ~caddr ~fname ~is_mutable ~keys ~ignoreval = let%bind sm, _fields, estates, _bcinfo = assert_init () in let caddr_hex = SSLiteral.Bystrx.hex_encoding caddr in match sm with | IPC socket_addr -> - StateIPCClient.external_fetch ~socket_addr ~caddr:caddr_hex ~fname ~keys + StateIPCClient.external_fetch ~socket_addr ~caddr:caddr_hex ~fname ~_is_mutable:is_mutable ~keys ~ignoreval | Local -> ( match @@ -211,12 +214,12 @@ module MakeStateService () = struct | Some fields -> ( match List.find_map fields ~f:(fun field -> - if SSName.equal field.fname (get_id fname) then + if SSName.equal field.fname (get_id fname) && ([%equal:bool] field.f_is_mutable is_mutable) then Some field.ftyp else None) with | Some stored_tp -> - let%bind res = fetch_local ~fname ~keys fields in + let%bind res = fetch_local ~fname ~is_mutable ~keys fields in pure (res, Option.map res ~f:(fun _ -> stored_tp)) | None -> pure (None, None)) | None -> pure (None, None)) @@ -224,9 +227,9 @@ module MakeStateService () = struct let update_local ~fname ~keys vopt fields = let s = fields in match - List.find s ~f:(fun z -> [%equal: SSName.t] z.fname (get_id fname)) + List.find s ~f:(fun z -> [%equal: SSName.t] z.fname (get_id fname) && z.f_is_mutable) with - | Some { fname = _; ftyp = _; fval = Some (Map ((_, vt), mlit)) } + | Some { fname = _; f_is_mutable = true ; ftyp = _; fval = Some (Map ((_, vt), mlit)) } when not @@ List.is_empty keys -> let rec recurser mlit' klist' vt' = match klist' with @@ -289,14 +292,14 @@ module MakeStateService () = struct (ER.get_loc (get_rep fname)) in recurser mlit keys vt - | Some { fname = f; ftyp = t; fval = Some _ } -> ( + | Some { fname = f; f_is_mutable = true; ftyp = t; fval = Some _ } -> ( match vopt with | Some fval' -> let fields' = List.filter fields ~f:(fun f -> - not ([%equal: SSName.t] f.fname (get_id fname))) + not ([%equal: SSName.t] f.fname (get_id fname) && f.f_is_mutable)) in - pure ({ fname = f; ftyp = t; fval = Some fval' } :: fields') + pure ({ fname = f; f_is_mutable = true; ftyp = t; fval = Some fval' } :: fields') | None -> fail1 ~kind: @@ -317,7 +320,7 @@ module MakeStateService () = struct let%bind sm, fields, estates, bcinfo = assert_init () in match sm with | IPC socket_addr -> - let%bind tp = field_type fields fname in + let%bind tp = field_type fields fname true in StateIPCClient.update ~socket_addr ~fname ~keys ~value ~tp | Local -> let%bind fields' = update_local ~fname ~keys (Some value) fields in @@ -325,15 +328,15 @@ module MakeStateService () = struct pure () (* Is a key in a map. keys must be non-empty. *) - let is_member ~fname ~keys = + let is_member ~fname ~is_mutable ~keys = let%bind sm, fields, _estates, _bcinfo = assert_init () in match sm with | IPC socket_addr -> - let%bind tp = field_type fields fname in - let%bind res = StateIPCClient.is_member ~socket_addr ~fname ~keys ~tp in + let%bind tp = field_type fields fname is_mutable in + let%bind res = StateIPCClient.is_member ~socket_addr ~fname ~_is_mutable:is_mutable ~keys ~tp in pure @@ res | Local -> - let%bind v = fetch_local ~fname ~keys fields in + let%bind v = fetch_local ~fname ~is_mutable ~keys fields in pure @@ Option.is_some v (* Remove a key from a map. keys must be non-empty. *) @@ -341,7 +344,7 @@ module MakeStateService () = struct let%bind sm, fields, _estates, _bcinfo = assert_init () in match sm with | IPC socket_addr -> - let%bind tp = field_type fields fname in + let%bind tp = field_type fields fname true in StateIPCClient.remove ~socket_addr ~fname ~keys ~tp | Local -> let%bind _ = update_local ~fname ~keys None fields in @@ -358,21 +361,23 @@ module MakeStateService () = struct | None -> fail0 ~kind: - (sprintf "StateService: Field %s's value is not known" + (sprintf "StateService: %s %s's value is not known" + (if f.f_is_mutable then "Field" else "Contract parameter") (SSName.as_error_string f.fname)) ?inst:None - | Some l -> pure (f.fname, f.ftyp, l)) + | Some l -> pure (f.fname, f.f_is_mutable, f.ftyp, l)) | SS (IPC _, fl, _estates, _bcstate) -> let%bind sl = mapM fl ~f:(fun f -> let%bind vopt = fetch ~fname:(mk_loc_id f.fname) ~keys:[] in match vopt with - | Some v -> pure (f.fname, f.ftyp, v) + | Some v -> pure (f.fname, f.f_is_mutable, f.ftyp, v) | None -> fail0 ~kind: (sprintf - "StateService: Field %s's value not found on server" + "StateService: %s %s's value not found on server" + (if f.f_is_mutable then "Field" else "Contract parameter") (SSName.as_error_string f.fname)) ?inst:None) in From 32b4c4efa6a37b08a78bee3e1367eea4f35a57ff Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Mon, 16 Jan 2023 15:45:11 +0100 Subject: [PATCH 16/33] Pass is_mutable in protobuf call --- src/eval/Disambiguator.ml | 8 +++++--- src/eval/Ipcmessage_pb.ml | 4 +++- src/eval/Ipcmessage_types.ml | 11 ++++++++--- src/eval/Ipcmessage_types.mli | 2 ++ src/eval/Runner.ml | 5 ++++- src/eval/StateIPCClient.ml | 9 +++++++-- src/eval/StateIPCClient.mli | 4 ++-- src/eval/StateService.ml | 4 ++-- tests/ipc/StateIPCTest.ml | 2 +- tests/ipc/StateIPCTestClient.ml | 5 ++++- 10 files changed, 38 insertions(+), 16 deletions(-) diff --git a/src/eval/Disambiguator.ml b/src/eval/Disambiguator.ml index f14242069..0a47ffd0e 100644 --- a/src/eval/Disambiguator.ml +++ b/src/eval/Disambiguator.ml @@ -822,6 +822,7 @@ module InputStateService = struct let q = { name = InputIdentifier.as_string fname; + is_mutable = true; mapdepth = TypeUtil.TypeUtilities.map_depth tp; indices = []; (* indices are not needed, as we are only fetching entire states *) @@ -926,7 +927,8 @@ let run_with_args args = if String.is_empty args.ipc_address then (* Use the provided state json. *) (* We control the state files, so we can assume the type info is correct *) - parse_json args.input_state this_address + parse_json args.input_state this_address |> + List.map ~f:(fun (n, t, v) -> (n, true, t, v)) else (* Use IPC *) (* Fetch state from IPC server *) @@ -988,7 +990,7 @@ let run_with_args args = let outputfields = List.map state ~f:(fun (n, tp, v) -> let open StateService in - { fname = n; ftyp = tp; fval = Some v }) + { fname = n; f_is_mutable = true; ftyp = tp; fval = Some v }) in (* Initialise with the final values, then update, then finalise. *) (* ~ext_states not initialised, since they are not supported anyway *) @@ -1027,7 +1029,7 @@ let run_with_args args = (* state_to_json maps name * literal to a vname * type * value json, which is the format for both init and state jsons *) ( JSON.ContractState.state_to_json init, - JSON.ContractState.state_to_json state ) + JSON.ContractState.state_to_json (List.filter_map ~f:(fun (f, m, t, v) -> if m then Some (f, t, v) else None) state)) let output_to_string = Yojson.Basic.pretty_to_string diff --git a/src/eval/Ipcmessage_pb.ml b/src/eval/Ipcmessage_pb.ml index 13a0a6afb..64b783aba 100644 --- a/src/eval/Ipcmessage_pb.ml +++ b/src/eval/Ipcmessage_pb.ml @@ -28,13 +28,14 @@ let default_proto_scilla_val_map_mutable () : proto_scilla_val_map_mutable = type proto_scilla_query_mutable = { mutable name : string; + mutable is_mutable : bool; mutable mapdepth : int; mutable indices : bytes list; mutable ignoreval : bool; } let default_proto_scilla_query_mutable () : proto_scilla_query_mutable = - { name = ""; mapdepth = 0; indices = []; ignoreval = false } + { name = ""; is_mutable = true; mapdepth = 0; indices = []; ignoreval = false } let rec decode_proto_scilla_val_map d = let v = default_proto_scilla_val_map_mutable () in @@ -101,6 +102,7 @@ let rec decode_proto_scilla_query d = done; ({ Ipcmessage_types.name = v.name; + Ipcmessage_types.is_mutable = v.is_mutable; Ipcmessage_types.mapdepth = v.mapdepth; Ipcmessage_types.indices = v.indices; Ipcmessage_types.ignoreval = v.ignoreval; diff --git a/src/eval/Ipcmessage_types.ml b/src/eval/Ipcmessage_types.ml index 1f1046ea2..31644bfb5 100644 --- a/src/eval/Ipcmessage_types.ml +++ b/src/eval/Ipcmessage_types.ml @@ -24,6 +24,7 @@ and proto_scilla_val = Bval of bytes | Mval of proto_scilla_val_map type proto_scilla_query = { name : string; + is_mutable : bool; mapdepth : int; indices : bytes list; ignoreval : bool; @@ -35,7 +36,11 @@ let rec default_proto_scilla_val_map and default_proto_scilla_val () : proto_scilla_val = Bval (Bytes.create 0) -let rec default_proto_scilla_query ?(name : string = "") ?(mapdepth : int = 0) - ?(indices : bytes list = []) ?(ignoreval : bool = false) () : +let rec default_proto_scilla_query + ?(name : string = "") + ?(is_mutable : bool = true) + ?(mapdepth : int = 0) + ?(indices : bytes list = []) + ?(ignoreval : bool = false) () : proto_scilla_query = - { name; mapdepth; indices; ignoreval } + { name; is_mutable; mapdepth; indices; ignoreval } diff --git a/src/eval/Ipcmessage_types.mli b/src/eval/Ipcmessage_types.mli index beb42198c..d745d1b2c 100644 --- a/src/eval/Ipcmessage_types.mli +++ b/src/eval/Ipcmessage_types.mli @@ -24,6 +24,7 @@ and proto_scilla_val = Bval of bytes | Mval of proto_scilla_val_map type proto_scilla_query = { name : string; + is_mutable : bool; mapdepth : int; indices : bytes list; ignoreval : bool; @@ -40,6 +41,7 @@ val default_proto_scilla_val : unit -> proto_scilla_val val default_proto_scilla_query : ?name:string -> + ?is_mutable:bool -> ?mapdepth:int -> ?indices:bytes list -> ?ignoreval:bool -> diff --git a/src/eval/Runner.ml b/src/eval/Runner.ml index 6ea3e44ef..657d81b3c 100644 --- a/src/eval/Runner.ml +++ b/src/eval/Runner.ml @@ -706,7 +706,10 @@ let run_with_args args = gas in - let osj = output_state_json cstate'.balance field_vals in + let osj = + (* get_full_state contains both mutables and immutables, so filter out the immutables *) + List.filter_map field_vals ~f:(fun (f, m, t, v) -> if m then Some (f, t, v) else None) |> + output_state_json cstate'.balance in let omj = output_message_json gas mlist in let oej = output_event_json elist in let gas' = Gas.finalize_remaining_gas args.gas_limit gas in diff --git a/src/eval/StateIPCClient.ml b/src/eval/StateIPCClient.ml index 47db82d43..525fc8926 100644 --- a/src/eval/StateIPCClient.ml +++ b/src/eval/StateIPCClient.ml @@ -160,6 +160,7 @@ let fetch ~socket_addr ~fname ~keys ~tp = let q = { name = IPCCIdentifier.as_string fname; + is_mutable = true; mapdepth = TypeUtilities.map_depth tp; indices = List.map keys ~f:serialize_literal; ignoreval = false; @@ -194,11 +195,12 @@ let fetch ~socket_addr ~fname ~keys ~tp = * if ~ignoreval is false: (Some val, Some type) is returned * Else: (None, None) is returned *) -let external_fetch ~socket_addr ~caddr ~fname ~(_is_mutable:bool) ~keys ~ignoreval = +let external_fetch ~socket_addr ~caddr ~fname ~is_mutable ~keys ~ignoreval = let open Ipcmessage_types in let q = { name = IPCCIdentifier.as_string fname; + is_mutable; (* We don't have the type information (and hence map depth) for remote state reads. The blockchain does. It'll take care of it. *) @@ -237,6 +239,7 @@ let update ~socket_addr ~fname ~keys ~value ~tp = let q = { name = IPCCIdentifier.as_string fname; + is_mutable = true; mapdepth = TypeUtilities.map_depth tp; indices = List.map keys ~f:serialize_literal; ignoreval = false; @@ -254,11 +257,12 @@ let update ~socket_addr ~fname ~keys ~value ~tp = pure () (* Is a key in a map. keys must be non-empty. *) -let is_member ~socket_addr ~fname ~(_is_mutable:bool) ~keys ~tp = +let is_member ~socket_addr ~fname ~is_mutable ~keys ~tp = let open Ipcmessage_types in let q = { name = IPCCIdentifier.as_string fname; + is_mutable; mapdepth = TypeUtilities.map_depth tp; indices = List.map keys ~f:serialize_literal; ignoreval = true; @@ -279,6 +283,7 @@ let remove ~socket_addr ~fname ~keys ~tp = let q = { name = IPCCIdentifier.as_string fname; + is_mutable = true; mapdepth = TypeUtilities.map_depth tp; indices = List.map keys ~f:serialize_literal; ignoreval = true; diff --git a/src/eval/StateIPCClient.mli b/src/eval/StateIPCClient.mli index 862c8e03d..18cde50cb 100644 --- a/src/eval/StateIPCClient.mli +++ b/src/eval/StateIPCClient.mli @@ -39,7 +39,7 @@ val external_fetch : socket_addr:string -> caddr:string -> fname:'a IPCCIdentifier.t -> - _is_mutable: bool -> + is_mutable: bool -> keys:IPCCLiteral.t list -> ignoreval:bool -> (IPCCLiteral.t option * IPCCType.t option, scilla_error list) result @@ -57,7 +57,7 @@ val update : val is_member : socket_addr:string -> fname:loc IPCCIdentifier.t -> - _is_mutable:bool -> + is_mutable:bool -> keys:IPCCLiteral.t list -> tp:IPCCType.t -> (bool, scilla_error list) result diff --git a/src/eval/StateService.ml b/src/eval/StateService.ml index a0a889109..741dd927b 100644 --- a/src/eval/StateService.ml +++ b/src/eval/StateService.ml @@ -202,7 +202,7 @@ module MakeStateService () = struct let caddr_hex = SSLiteral.Bystrx.hex_encoding caddr in match sm with | IPC socket_addr -> - StateIPCClient.external_fetch ~socket_addr ~caddr:caddr_hex ~fname ~_is_mutable:is_mutable ~keys + StateIPCClient.external_fetch ~socket_addr ~caddr:caddr_hex ~fname ~is_mutable ~keys ~ignoreval | Local -> ( match @@ -333,7 +333,7 @@ module MakeStateService () = struct match sm with | IPC socket_addr -> let%bind tp = field_type fields fname is_mutable in - let%bind res = StateIPCClient.is_member ~socket_addr ~fname ~_is_mutable:is_mutable ~keys ~tp in + let%bind res = StateIPCClient.is_member ~socket_addr ~fname ~is_mutable ~keys ~tp in pure @@ res | Local -> let%bind v = fetch_local ~fname ~is_mutable ~keys fields in diff --git a/tests/ipc/StateIPCTest.ml b/tests/ipc/StateIPCTest.ml index 06a3583a1..4ee759a30 100644 --- a/tests/ipc/StateIPCTest.ml +++ b/tests/ipc/StateIPCTest.ml @@ -269,7 +269,7 @@ let setup_and_initialize ~start_mock_server ~sock_addr ~state_json_path (* Update the server (via the test client) with the state values we want. *) List.iter state ~f:(fun (addr_opt, (fname, tp, value)) -> match addr_opt with - | Some caddr -> StateIPCTestClient.update_ext ~caddr ~fname ~value ~tp + | Some caddr -> StateIPCTestClient.update_ext ~caddr ~fname ~is_mutable:true ~value ~tp | None -> if String.(fname <> CUName.as_string balance_label) then StateIPCTestClient.update ~fname ~value); diff --git a/tests/ipc/StateIPCTestClient.ml b/tests/ipc/StateIPCTestClient.ml index 44068b905..875a39080 100644 --- a/tests/ipc/StateIPCTestClient.ml +++ b/tests/ipc/StateIPCTestClient.ml @@ -112,6 +112,7 @@ let fetch ~fname = let q = { name = fname; + is_mutable = true; mapdepth = TypeUtilities.map_depth tp; indices = []; ignoreval = false; @@ -140,6 +141,7 @@ let update ~fname ~value = let q = { name = fname; + is_mutable = true; mapdepth = TypeUtilities.map_depth tp; indices = []; ignoreval = false; @@ -151,12 +153,13 @@ let update ~fname ~value = @@ IPCClient.update_state_value (binary_rpc ~sock_addr) q' value' (* Update full state variable (of another contract) to server (no indexing). *) -let update_ext ~caddr ~fname ~value ~tp = +let update_ext ~caddr ~fname ~is_mutable ~value ~tp = let open Ipcmessage_types in let sock_addr, _ = assert_init () in let q = { name = fname; + is_mutable; mapdepth = TypeUtilities.map_depth tp; indices = []; ignoreval = false; From 4ef4133a7378c2d27eb5adadccc7ab5cc3f87d49 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Tue, 17 Jan 2023 09:51:50 +0100 Subject: [PATCH 17/33] is_mutable added to ProtoScillaQuery type --- src/eval/Ipcmessage.proto | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/eval/Ipcmessage.proto b/src/eval/Ipcmessage.proto index 9f74be6ed..1bf0785c0 100644 --- a/src/eval/Ipcmessage.proto +++ b/src/eval/Ipcmessage.proto @@ -31,7 +31,8 @@ message ProtoScillaVal { message ProtoScillaQuery { string name = 1; - uint32 mapdepth = 2 [(ocaml_type) = int_t]; - repeated bytes indices = 3; - bool ignoreval = 4; + bool is_mutable = 2; + uint32 mapdepth = 3 [(ocaml_type) = int_t]; + repeated bytes indices = 4; + bool ignoreval = 5; } \ No newline at end of file From c1b464f01006ca232fad681988eb94d199e25008 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Wed, 18 Jan 2023 19:22:44 +0100 Subject: [PATCH 18/33] Add contract parameters to external contracts in test suite --- src/base/JSON.ml | 71 ++++++++++--------- src/eval/Runner.ml | 23 +++--- tests/runner/addfunds/state_1.json | 1 + tests/runner/addfunds_proxy/state_1.json | 1 + tests/runner/addfunds_proxy/state_2.json | 1 + tests/runner/address_eq_test/state_1.json | 1 + tests/runner/address_eq_test/state_10.json | 1 + tests/runner/address_eq_test/state_11.json | 1 + tests/runner/address_eq_test/state_2.json | 2 + tests/runner/address_eq_test/state_3.json | 1 + tests/runner/address_eq_test/state_4.json | 1 + tests/runner/address_eq_test/state_5.json | 1 + tests/runner/address_eq_test/state_6.json | 1 + tests/runner/address_eq_test/state_7.json | 1 + tests/runner/address_eq_test/state_8.json | 1 + tests/runner/address_eq_test/state_9.json | 1 + .../init_address_type_state.json | 1 + .../init_illegal_nested_type_state.json | 1 + .../init_illegal_type_state.json | 1 + .../init_illegal_value_state.json | 1 + .../address_list_as_cparam/init_state.json | 1 + .../address_list_traversal/state_1.json | 3 + .../address_list_traversal/state_2.json | 3 + .../address_list_traversal/state_3.json | 4 ++ tests/runner/ark/state_1.json | 1 + tests/runner/ark/state_2.json | 1 + tests/runner/auction/state_1.json | 1 + tests/runner/auction/state_2.json | 1 + tests/runner/auction/state_3.json | 1 + tests/runner/auction/state_4.json | 1 + tests/runner/auction/state_5.json | 1 + tests/runner/cfinvoke/state_1.json | 1 + tests/runner/cfinvoke/state_4.json | 1 + .../runner/chain-call-balance-1/state_1.json | 1 + .../runner/chain-call-balance-2/state_1.json | 1 + .../runner/chain-call-balance-3/state_1.json | 1 + tests/runner/codehash/state_1.json | 1 + tests/runner/codehash/state_100.json | 1 + tests/runner/codehash/state_101.json | 1 + tests/runner/codehash/state_102.json | 1 + tests/runner/codehash/state_2.json | 1 + tests/runner/codehash/state_3.json | 1 + tests/runner/codehash/state_4.json | 1 + tests/runner/crowdfunding/state_1.json | 1 + tests/runner/crowdfunding/state_2.json | 1 + tests/runner/crowdfunding/state_3.json | 1 + tests/runner/crowdfunding/state_6.json | 1 + tests/runner/crowdfunding_proc/state_1.json | 1 + tests/runner/crowdfunding_proc/state_2.json | 1 + tests/runner/crowdfunding_proc/state_3.json | 1 + tests/runner/crowdfunding_proc/state_6.json | 1 + tests/runner/earmarked-coin/state_1.json | 1 + .../map_as_cparam/init_illegal_key_state.json | 4 ++ .../init_illegal_value_state.json | 4 ++ tests/runner/map_as_cparam/init_state.json | 4 ++ .../init_unassignable_2_state.json | 4 ++ .../init_unassignable_state.json | 4 ++ tests/runner/polymorphic_address/state_1.json | 1 + tests/runner/polymorphic_address/state_2.json | 1 + .../init_address_type_state.json | 1 + .../init_assignable_map_types_state.json | 1 + .../init_balance_and_nonce_state.json | 2 + .../init_balance_no_nonce_state.json | 2 + .../init_missing_field_state.json | 1 + .../init_no_address_state.json | 2 + .../init_nonce_no_balance_state.json | 2 + .../runner/remote_state_reads/init_state.json | 1 + .../init_wrong_address_field_type_state.json | 1 + .../init_wrong_field_type_state.json | 1 + .../init_wrong_map_type_state.json | 1 + tests/runner/remote_state_reads/state_1.json | 4 ++ tests/runner/remote_state_reads/state_10.json | 4 ++ .../runner/remote_state_reads/state_100.json | 3 + .../runner/remote_state_reads/state_101.json | 4 ++ .../runner/remote_state_reads/state_102.json | 4 ++ .../runner/remote_state_reads/state_103.json | 4 ++ .../runner/remote_state_reads/state_104.json | 4 ++ .../runner/remote_state_reads/state_105.json | 4 ++ .../runner/remote_state_reads/state_106.json | 4 ++ .../runner/remote_state_reads/state_107.json | 4 ++ .../runner/remote_state_reads/state_108.json | 4 ++ .../runner/remote_state_reads/state_109.json | 5 ++ tests/runner/remote_state_reads/state_11.json | 4 ++ .../runner/remote_state_reads/state_110.json | 4 ++ .../runner/remote_state_reads/state_111.json | 4 ++ .../runner/remote_state_reads/state_112.json | 4 ++ .../runner/remote_state_reads/state_113.json | 4 ++ .../runner/remote_state_reads/state_114.json | 4 ++ .../runner/remote_state_reads/state_115.json | 4 ++ .../runner/remote_state_reads/state_116.json | 4 ++ .../runner/remote_state_reads/state_117.json | 5 ++ .../runner/remote_state_reads/state_118.json | 4 ++ .../runner/remote_state_reads/state_119.json | 4 ++ .../runner/remote_state_reads/state_120.json | 4 ++ .../runner/remote_state_reads/state_121.json | 5 ++ .../runner/remote_state_reads/state_122.json | 5 ++ .../runner/remote_state_reads/state_123.json | 4 ++ .../runner/remote_state_reads/state_124.json | 4 ++ .../runner/remote_state_reads/state_125.json | 4 ++ .../runner/remote_state_reads/state_126.json | 4 ++ .../runner/remote_state_reads/state_127.json | 1 + .../runner/remote_state_reads/state_128.json | 4 ++ .../runner/remote_state_reads/state_129.json | 4 ++ .../runner/remote_state_reads/state_130.json | 5 ++ .../runner/remote_state_reads/state_131.json | 5 ++ tests/runner/remote_state_reads/state_2.json | 4 ++ tests/runner/remote_state_reads/state_3.json | 4 ++ tests/runner/remote_state_reads/state_4.json | 4 ++ tests/runner/remote_state_reads/state_5.json | 4 ++ tests/runner/remote_state_reads/state_6.json | 4 ++ tests/runner/remote_state_reads/state_7.json | 4 ++ tests/runner/remote_state_reads/state_8.json | 4 ++ tests/runner/remote_state_reads/state_9.json | 1 + .../remote_state_reads_2/init_state.json | 3 + .../runner/remote_state_reads_2/state_1.json | 3 + .../runner/remote_state_reads_2/state_2.json | 3 + .../runner/remote_state_reads_2/state_3.json | 3 + .../runner/remote_state_reads_2/state_4.json | 3 + .../runner/remote_state_reads_2/state_5.json | 3 + tests/runner/replicate/state_1.json | 1 + tests/runner/replicate/state_100.json | 1 + tests/runner/replicate/state_101.json | 1 + tests/runner/replicate/state_2.json | 1 + tests/runner/salarybot/state_0.json | 1 + tests/runner/type_casts/state_1.json | 1 + tests/runner/type_casts/state_10.json | 1 + tests/runner/type_casts/state_11.json | 1 + tests/runner/type_casts/state_12.json | 1 + tests/runner/type_casts/state_13.json | 1 + tests/runner/type_casts/state_14.json | 1 + tests/runner/type_casts/state_15.json | 1 + tests/runner/type_casts/state_16.json | 1 + tests/runner/type_casts/state_17.json | 1 + tests/runner/type_casts/state_18.json | 1 + tests/runner/type_casts/state_19.json | 1 + tests/runner/type_casts/state_2.json | 1 + tests/runner/type_casts/state_20.json | 1 + tests/runner/type_casts/state_21.json | 1 + tests/runner/type_casts/state_22.json | 1 + tests/runner/type_casts/state_23.json | 1 + tests/runner/type_casts/state_24.json | 1 + tests/runner/type_casts/state_25.json | 1 + tests/runner/type_casts/state_26.json | 1 + tests/runner/type_casts/state_27.json | 1 + tests/runner/type_casts/state_28.json | 1 + tests/runner/type_casts/state_29.json | 1 + tests/runner/type_casts/state_3.json | 1 + tests/runner/type_casts/state_30.json | 1 + tests/runner/type_casts/state_31.json | 1 + tests/runner/type_casts/state_32.json | 1 + tests/runner/type_casts/state_33.json | 1 + tests/runner/type_casts/state_34.json | 1 + tests/runner/type_casts/state_35.json | 1 + tests/runner/type_casts/state_36.json | 1 + tests/runner/type_casts/state_37.json | 2 + tests/runner/type_casts/state_4.json | 1 + tests/runner/type_casts/state_5.json | 1 + tests/runner/type_casts/state_6.json | 1 + tests/runner/type_casts/state_7.json | 1 + tests/runner/type_casts/state_8.json | 1 + tests/runner/type_casts/state_9.json | 1 + tests/runner/wallet/state_1.json | 1 + tests/runner/wallet/state_6.json | 1 + tests/runner/wallet_2/state_1.json | 1 + tests/runner/wallet_2/state_2.json | 1 + 165 files changed, 381 insertions(+), 44 deletions(-) diff --git a/src/base/JSON.ml b/src/base/JSON.ml index 6de10a65b..061e5ca07 100644 --- a/src/base/JSON.ml +++ b/src/base/JSON.ml @@ -42,10 +42,10 @@ open JSONType open JSONLiteral type json_parsed_field = - (* A field belonging to this contract. *) + (* A field (mutable or immutable) belonging to this contract. *) | ThisContr of string * JSONType.t * JSONLiteral.t (* External contracts and their fields. *) - | ExtrContrs of (Bystrx.t * (string * JSONType.t * JSONLiteral.t) list) list + | ExtrContrs of (Bystrx.t * (string * field_mutability * JSONType.t * JSONLiteral.t) list) list (****************************************************************) (* Exception wrappers *) @@ -246,37 +246,42 @@ and json_to_lit_exn t v = in raise (exn ()) -let rec jobj_to_statevar json = - let n = member_exn "vname" json |> to_string_exn in - let v = member_exn "value" json in - if String.equal n "_external" then - (* We have a list of external addresses, each with their own fields. *) - let exts = v |> to_list_exn in - let exts' = - List.fold exts ~init:[] ~f:(fun acc ext -> - let addr = - member_exn "address" ext |> to_string_exn |> Bystrx.parse_hex - in - let state = member_exn "state" ext |> to_list_exn in - let state' = - List.map state ~f:(fun s -> - match jobj_to_statevar s with - | ThisContr (n, t, l) -> (n, t, l) - | _ -> - raise - @@ mk_invalid_json - ~kind: - "External contract fields cannot contain other \ - external fields" - ?inst:None) - in - (addr, state') :: acc) - in - ExtrContrs exts' - else - let tstring = member_exn "type" json |> to_string_exn in - let t = parse_typ_exn tstring in - ThisContr (n, t, json_to_lit_exn t v) +let jobj_to_statevar json = + let rec recurser json = + let n = member_exn "vname" json |> to_string_exn in + let v = member_exn "value" json in + if String.equal n "_external" then + (* We have a list of external addresses, each with their own fields. *) + let exts = v |> to_list_exn in + let exts' = + List.fold exts ~init:[] ~f:(fun acc ext -> + let addr = + member_exn "address" ext |> to_string_exn |> Bystrx.parse_hex + in + let cparams = member_exn "cparams" ext |> to_list_exn in + let cparams' = List.map cparams ~f:(recurser_mapper Immutable) in + let state = member_exn "state" ext |> to_list_exn in + let all_fields = List.rev_map_append state cparams' ~f:(recurser_mapper Mutable) + in + (addr, all_fields) :: acc) + in + ExtrContrs exts' + else + let tstring = member_exn "type" json |> to_string_exn in + let t = parse_typ_exn tstring in + ThisContr (n, t, json_to_lit_exn t v) + and recurser_mapper mutability json = + match recurser json with + | ThisContr (n, t, l) -> (n, mutability, t, l) + | _ -> + raise + @@ mk_invalid_json + ~kind: + "External contract fields cannot contain other \ + external fields" + ?inst:None + in + recurser json (****************************************************************) (* JSON printing *) diff --git a/src/eval/Runner.ml b/src/eval/Runner.ml index 657d81b3c..6fb8d4189 100644 --- a/src/eval/Runner.ml +++ b/src/eval/Runner.ml @@ -108,20 +108,21 @@ let check_after_step res gas_limit = ^ sprintf "Emitted events:\n%s\n\n" (pp_literal_list events)); ((cstate, outs, events, accepted_b), remaining_gas) -let map_json_input_strings_to_names map = - List.map map ~f:(fun (x, t, l) -> - match String.split x ~on:'.' with - | [ simple_name ] -> (RunnerName.parse_simple_name simple_name, t, l) - | _ -> raise (mk_invalid_json ~kind:"invalid name in json input" ~inst:x)) - +let map_input_string_to_name x = + match String.split x ~on:'.' with + | [ simple_name ] -> RunnerName.parse_simple_name simple_name + | _ -> raise (mk_invalid_json ~kind:"invalid name in json input" ~inst:x) + (* Parse the input state json and extract out _balance separately *) let input_state_json filename = let open JSON.ContractState in let states_str, estates_str = get_json_data filename in - let states = map_json_input_strings_to_names states_str in + let states = + List.map states_str ~f:(fun (x, t, l) -> (map_input_string_to_name x, t, l)) + in let estates = List.map estates_str ~f:(fun (addr, states_str) -> - (addr, map_json_input_strings_to_names states_str)) + (addr, List.map states_str ~f:(fun (x, m, t, l) -> (map_input_string_to_name x, m, t, l)))) in let bal_lit = match @@ -236,7 +237,7 @@ let validate_get_init_json init_file gas_remaining source_ver = in (* Read init.json, and strip types. Types in init files must be ignored due to backward compatibility *) let initargs = - map_json_input_strings_to_names initargs_str + List.map initargs_str ~f:(fun (x, t, l) -> (map_input_string_to_name x, t, l)) |> List.map ~f:(fun (n, t, l) -> let () = assert_no_address_type_in_type t gas_remaining in let () = assert_no_address_type_in_literal l gas_remaining in @@ -660,8 +661,8 @@ let run_with_args args = let open StateService in List.map ext_states ~f:(fun (addr, fields) -> let fields' = - List.map fields ~f:(fun (n, t, l) -> - { fname = n; f_is_mutable = true (* TODO: handle immutables *); ftyp = t; fval = Some l }) + List.map fields ~f:(fun (n, m, t, l) -> + { fname = n; f_is_mutable = is_mutable m; ftyp = t; fval = Some l }) in { caddr = addr; cstate = fields' }) in diff --git a/tests/runner/addfunds/state_1.json b/tests/runner/addfunds/state_1.json index 6efc2d4a1..37d9ed936 100644 --- a/tests/runner/addfunds/state_1.json +++ b/tests/runner/addfunds/state_1.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ab", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "142" } ] diff --git a/tests/runner/addfunds_proxy/state_1.json b/tests/runner/addfunds_proxy/state_1.json index dd1bfd858..0dd9282fc 100644 --- a/tests/runner/addfunds_proxy/state_1.json +++ b/tests/runner/addfunds_proxy/state_1.json @@ -15,6 +15,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ab", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "142" } ] diff --git a/tests/runner/addfunds_proxy/state_2.json b/tests/runner/addfunds_proxy/state_2.json index dd1bfd858..0dd9282fc 100644 --- a/tests/runner/addfunds_proxy/state_2.json +++ b/tests/runner/addfunds_proxy/state_2.json @@ -15,6 +15,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ab", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "142" } ] diff --git a/tests/runner/address_eq_test/state_1.json b/tests/runner/address_eq_test/state_1.json index 54fee51fb..a1a90963a 100644 --- a/tests/runner/address_eq_test/state_1.json +++ b/tests/runner/address_eq_test/state_1.json @@ -86,6 +86,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_eq_test/state_10.json b/tests/runner/address_eq_test/state_10.json index 1d24cb989..1043546c9 100644 --- a/tests/runner/address_eq_test/state_10.json +++ b/tests/runner/address_eq_test/state_10.json @@ -86,6 +86,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_eq_test/state_11.json b/tests/runner/address_eq_test/state_11.json index 4fdd1f65d..b06f4a4ca 100644 --- a/tests/runner/address_eq_test/state_11.json +++ b/tests/runner/address_eq_test/state_11.json @@ -86,6 +86,7 @@ "value": [ { "address": "0x4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_eq_test/state_2.json b/tests/runner/address_eq_test/state_2.json index a1fc1aaf1..9075f14d7 100644 --- a/tests/runner/address_eq_test/state_2.json +++ b/tests/runner/address_eq_test/state_2.json @@ -86,6 +86,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -97,6 +98,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_eq_test/state_3.json b/tests/runner/address_eq_test/state_3.json index 1d24cb989..1043546c9 100644 --- a/tests/runner/address_eq_test/state_3.json +++ b/tests/runner/address_eq_test/state_3.json @@ -86,6 +86,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_eq_test/state_4.json b/tests/runner/address_eq_test/state_4.json index 1d24cb989..1043546c9 100644 --- a/tests/runner/address_eq_test/state_4.json +++ b/tests/runner/address_eq_test/state_4.json @@ -86,6 +86,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_eq_test/state_5.json b/tests/runner/address_eq_test/state_5.json index 1d24cb989..1043546c9 100644 --- a/tests/runner/address_eq_test/state_5.json +++ b/tests/runner/address_eq_test/state_5.json @@ -86,6 +86,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_eq_test/state_6.json b/tests/runner/address_eq_test/state_6.json index 1d24cb989..1043546c9 100644 --- a/tests/runner/address_eq_test/state_6.json +++ b/tests/runner/address_eq_test/state_6.json @@ -86,6 +86,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_eq_test/state_7.json b/tests/runner/address_eq_test/state_7.json index 1d24cb989..1043546c9 100644 --- a/tests/runner/address_eq_test/state_7.json +++ b/tests/runner/address_eq_test/state_7.json @@ -86,6 +86,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_eq_test/state_8.json b/tests/runner/address_eq_test/state_8.json index 1d24cb989..1043546c9 100644 --- a/tests/runner/address_eq_test/state_8.json +++ b/tests/runner/address_eq_test/state_8.json @@ -86,6 +86,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_eq_test/state_9.json b/tests/runner/address_eq_test/state_9.json index 1d24cb989..1043546c9 100644 --- a/tests/runner/address_eq_test/state_9.json +++ b/tests/runner/address_eq_test/state_9.json @@ -86,6 +86,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_list_as_cparam/init_address_type_state.json b/tests/runner/address_list_as_cparam/init_address_type_state.json index 26979dbf3..1f67699c8 100644 --- a/tests/runner/address_list_as_cparam/init_address_type_state.json +++ b/tests/runner/address_list_as_cparam/init_address_type_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_list_as_cparam/init_illegal_nested_type_state.json b/tests/runner/address_list_as_cparam/init_illegal_nested_type_state.json index 26979dbf3..1f67699c8 100644 --- a/tests/runner/address_list_as_cparam/init_illegal_nested_type_state.json +++ b/tests/runner/address_list_as_cparam/init_illegal_nested_type_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_list_as_cparam/init_illegal_type_state.json b/tests/runner/address_list_as_cparam/init_illegal_type_state.json index 26979dbf3..1f67699c8 100644 --- a/tests/runner/address_list_as_cparam/init_illegal_type_state.json +++ b/tests/runner/address_list_as_cparam/init_illegal_type_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_list_as_cparam/init_illegal_value_state.json b/tests/runner/address_list_as_cparam/init_illegal_value_state.json index fa1677b96..22593a0a6 100644 --- a/tests/runner/address_list_as_cparam/init_illegal_value_state.json +++ b/tests/runner/address_list_as_cparam/init_illegal_value_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_list_as_cparam/init_state.json b/tests/runner/address_list_as_cparam/init_state.json index 26979dbf3..1f67699c8 100644 --- a/tests/runner/address_list_as_cparam/init_state.json +++ b/tests/runner/address_list_as_cparam/init_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_list_traversal/state_1.json b/tests/runner/address_list_traversal/state_1.json index 0368ded2f..34d54f3ac 100644 --- a/tests/runner/address_list_traversal/state_1.json +++ b/tests/runner/address_list_traversal/state_1.json @@ -16,6 +16,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564322", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -24,6 +25,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -33,6 +35,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_list_traversal/state_2.json b/tests/runner/address_list_traversal/state_2.json index 0368ded2f..34d54f3ac 100644 --- a/tests/runner/address_list_traversal/state_2.json +++ b/tests/runner/address_list_traversal/state_2.json @@ -16,6 +16,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564322", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -24,6 +25,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -33,6 +35,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/address_list_traversal/state_3.json b/tests/runner/address_list_traversal/state_3.json index 42e36d53a..ee8807566 100644 --- a/tests/runner/address_list_traversal/state_3.json +++ b/tests/runner/address_list_traversal/state_3.json @@ -16,6 +16,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564322", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -24,6 +25,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -33,6 +35,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -42,6 +45,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/ark/state_1.json b/tests/runner/ark/state_1.json index 9bc13937c..8e529f64b 100644 --- a/tests/runner/ark/state_1.json +++ b/tests/runner/ark/state_1.json @@ -32,6 +32,7 @@ { "address": "0x8a79bac7a6383211ae902f34e86c6b729906346d", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" }, diff --git a/tests/runner/ark/state_2.json b/tests/runner/ark/state_2.json index 4a6bc5da5..dda4d7915 100644 --- a/tests/runner/ark/state_2.json +++ b/tests/runner/ark/state_2.json @@ -59,6 +59,7 @@ { "address": "0x8a79bac7a6383211ae902f34e86c6b729906346d", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" }, diff --git a/tests/runner/auction/state_1.json b/tests/runner/auction/state_1.json index be6b92de3..87fa36ca1 100644 --- a/tests/runner/auction/state_1.json +++ b/tests/runner/auction/state_1.json @@ -26,6 +26,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ab", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/auction/state_2.json b/tests/runner/auction/state_2.json index 1d614fbd2..c104c27b7 100644 --- a/tests/runner/auction/state_2.json +++ b/tests/runner/auction/state_2.json @@ -26,6 +26,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ab", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/auction/state_3.json b/tests/runner/auction/state_3.json index 69cc7944a..f69a1a219 100644 --- a/tests/runner/auction/state_3.json +++ b/tests/runner/auction/state_3.json @@ -28,6 +28,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678cd", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/auction/state_4.json b/tests/runner/auction/state_4.json index 6bf19c078..64dbe4e0f 100644 --- a/tests/runner/auction/state_4.json +++ b/tests/runner/auction/state_4.json @@ -28,6 +28,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678cd", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "542" } ] diff --git a/tests/runner/auction/state_5.json b/tests/runner/auction/state_5.json index 1be085cc1..faac141d8 100644 --- a/tests/runner/auction/state_5.json +++ b/tests/runner/auction/state_5.json @@ -26,6 +26,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678cd", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "642" } ] diff --git a/tests/runner/cfinvoke/state_1.json b/tests/runner/cfinvoke/state_1.json index 0f1496945..8c00337dd 100644 --- a/tests/runner/cfinvoke/state_1.json +++ b/tests/runner/cfinvoke/state_1.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ab", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/cfinvoke/state_4.json b/tests/runner/cfinvoke/state_4.json index 85dcaf7e3..98dbddee9 100644 --- a/tests/runner/cfinvoke/state_4.json +++ b/tests/runner/cfinvoke/state_4.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x8992d4dfafd282e8a8b3c776eb9fc907d321e21a", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/chain-call-balance-1/state_1.json b/tests/runner/chain-call-balance-1/state_1.json index bc1954bba..fb5f46619 100644 --- a/tests/runner/chain-call-balance-1/state_1.json +++ b/tests/runner/chain-call-balance-1/state_1.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x02345678901234567890123456789012345678ab", + "cparams": [], "state": [ { "vname": "_balance", diff --git a/tests/runner/chain-call-balance-2/state_1.json b/tests/runner/chain-call-balance-2/state_1.json index a01821b6a..3053fa2f6 100644 --- a/tests/runner/chain-call-balance-2/state_1.json +++ b/tests/runner/chain-call-balance-2/state_1.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ab", + "cparams": [], "state": [ { "vname": "_balance", diff --git a/tests/runner/chain-call-balance-3/state_1.json b/tests/runner/chain-call-balance-3/state_1.json index bc1954bba..fb5f46619 100644 --- a/tests/runner/chain-call-balance-3/state_1.json +++ b/tests/runner/chain-call-balance-3/state_1.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x02345678901234567890123456789012345678ab", + "cparams": [], "state": [ { "vname": "_balance", diff --git a/tests/runner/codehash/state_1.json b/tests/runner/codehash/state_1.json index 43cd40242..a6125d5ff 100644 --- a/tests/runner/codehash/state_1.json +++ b/tests/runner/codehash/state_1.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ff", + "cparams": [], "state": [ { "vname": "_nonce", diff --git a/tests/runner/codehash/state_100.json b/tests/runner/codehash/state_100.json index 0e41d127a..0aeb35ee0 100644 --- a/tests/runner/codehash/state_100.json +++ b/tests/runner/codehash/state_100.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ff", + "cparams": [], "state": [ { "vname": "_nonce", diff --git a/tests/runner/codehash/state_101.json b/tests/runner/codehash/state_101.json index 0e41d127a..0aeb35ee0 100644 --- a/tests/runner/codehash/state_101.json +++ b/tests/runner/codehash/state_101.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ff", + "cparams": [], "state": [ { "vname": "_nonce", diff --git a/tests/runner/codehash/state_102.json b/tests/runner/codehash/state_102.json index 1b6605355..ef8ac1770 100644 --- a/tests/runner/codehash/state_102.json +++ b/tests/runner/codehash/state_102.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ff", + "cparams": [], "state": [ { "vname": "_nonce", diff --git a/tests/runner/codehash/state_2.json b/tests/runner/codehash/state_2.json index 43cd40242..a6125d5ff 100644 --- a/tests/runner/codehash/state_2.json +++ b/tests/runner/codehash/state_2.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ff", + "cparams": [], "state": [ { "vname": "_nonce", diff --git a/tests/runner/codehash/state_3.json b/tests/runner/codehash/state_3.json index 43cd40242..a6125d5ff 100644 --- a/tests/runner/codehash/state_3.json +++ b/tests/runner/codehash/state_3.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ff", + "cparams": [], "state": [ { "vname": "_nonce", diff --git a/tests/runner/codehash/state_4.json b/tests/runner/codehash/state_4.json index 7dda9fcb5..86be9514a 100644 --- a/tests/runner/codehash/state_4.json +++ b/tests/runner/codehash/state_4.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ff", + "cparams": [], "state": [ { "vname": "_nonce", diff --git a/tests/runner/crowdfunding/state_1.json b/tests/runner/crowdfunding/state_1.json index 93f8134a7..a08883d80 100644 --- a/tests/runner/crowdfunding/state_1.json +++ b/tests/runner/crowdfunding/state_1.json @@ -16,6 +16,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ab", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "142" } ] diff --git a/tests/runner/crowdfunding/state_2.json b/tests/runner/crowdfunding/state_2.json index e3d8c0674..410191055 100644 --- a/tests/runner/crowdfunding/state_2.json +++ b/tests/runner/crowdfunding/state_2.json @@ -18,6 +18,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678cd", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/crowdfunding/state_3.json b/tests/runner/crowdfunding/state_3.json index 642f6132d..348965147 100644 --- a/tests/runner/crowdfunding/state_3.json +++ b/tests/runner/crowdfunding/state_3.json @@ -23,6 +23,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678cd", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/crowdfunding/state_6.json b/tests/runner/crowdfunding/state_6.json index 3ab74f6d9..e72a98bc1 100644 --- a/tests/runner/crowdfunding/state_6.json +++ b/tests/runner/crowdfunding/state_6.json @@ -22,6 +22,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678cd", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/crowdfunding_proc/state_1.json b/tests/runner/crowdfunding_proc/state_1.json index abdf0542a..bb959a326 100644 --- a/tests/runner/crowdfunding_proc/state_1.json +++ b/tests/runner/crowdfunding_proc/state_1.json @@ -16,6 +16,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678ab", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/crowdfunding_proc/state_2.json b/tests/runner/crowdfunding_proc/state_2.json index e3d8c0674..410191055 100644 --- a/tests/runner/crowdfunding_proc/state_2.json +++ b/tests/runner/crowdfunding_proc/state_2.json @@ -18,6 +18,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678cd", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/crowdfunding_proc/state_3.json b/tests/runner/crowdfunding_proc/state_3.json index 642f6132d..348965147 100644 --- a/tests/runner/crowdfunding_proc/state_3.json +++ b/tests/runner/crowdfunding_proc/state_3.json @@ -23,6 +23,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678cd", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/crowdfunding_proc/state_6.json b/tests/runner/crowdfunding_proc/state_6.json index 3ab74f6d9..e72a98bc1 100644 --- a/tests/runner/crowdfunding_proc/state_6.json +++ b/tests/runner/crowdfunding_proc/state_6.json @@ -22,6 +22,7 @@ "value": [ { "address": "0x12345678901234567890123456789012345678cd", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/earmarked-coin/state_1.json b/tests/runner/earmarked-coin/state_1.json index 4b2e0ee70..bc1a156b2 100644 --- a/tests/runner/earmarked-coin/state_1.json +++ b/tests/runner/earmarked-coin/state_1.json @@ -12,6 +12,7 @@ "value": [ { "address": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/map_as_cparam/init_illegal_key_state.json b/tests/runner/map_as_cparam/init_illegal_key_state.json index 28c87ea20..599ee1648 100644 --- a/tests/runner/map_as_cparam/init_illegal_key_state.json +++ b/tests/runner/map_as_cparam/init_illegal_key_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -16,6 +17,7 @@ }, { "address": "0x1234567890123456789012345678901234567891", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -25,6 +27,7 @@ }, { "address": "0x1234567890123456789012345678901234567892", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -35,6 +38,7 @@ }, { "address": "0x1234567890123456789012345678901234567893", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/map_as_cparam/init_illegal_value_state.json b/tests/runner/map_as_cparam/init_illegal_value_state.json index 0a2790294..a8291c8a2 100644 --- a/tests/runner/map_as_cparam/init_illegal_value_state.json +++ b/tests/runner/map_as_cparam/init_illegal_value_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -15,6 +16,7 @@ }, { "address": "0x1234567890123456789012345678901234567891", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -25,6 +27,7 @@ }, { "address": "0x1234567890123456789012345678901234567892", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -34,6 +37,7 @@ }, { "address": "0x1234567890123456789012345678901234567893", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/map_as_cparam/init_state.json b/tests/runner/map_as_cparam/init_state.json index 9c4b91f20..9bc906018 100644 --- a/tests/runner/map_as_cparam/init_state.json +++ b/tests/runner/map_as_cparam/init_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -15,6 +16,7 @@ }, { "address": "0x1234567890123456789012345678901234567891", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -24,6 +26,7 @@ }, { "address": "0x1234567890123456789012345678901234567892", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -33,6 +36,7 @@ }, { "address": "0x1234567890123456789012345678901234567893", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/map_as_cparam/init_unassignable_2_state.json b/tests/runner/map_as_cparam/init_unassignable_2_state.json index 9c4b91f20..9bc906018 100644 --- a/tests/runner/map_as_cparam/init_unassignable_2_state.json +++ b/tests/runner/map_as_cparam/init_unassignable_2_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -15,6 +16,7 @@ }, { "address": "0x1234567890123456789012345678901234567891", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -24,6 +26,7 @@ }, { "address": "0x1234567890123456789012345678901234567892", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -33,6 +36,7 @@ }, { "address": "0x1234567890123456789012345678901234567893", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/map_as_cparam/init_unassignable_state.json b/tests/runner/map_as_cparam/init_unassignable_state.json index 9c4b91f20..9bc906018 100644 --- a/tests/runner/map_as_cparam/init_unassignable_state.json +++ b/tests/runner/map_as_cparam/init_unassignable_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -15,6 +16,7 @@ }, { "address": "0x1234567890123456789012345678901234567891", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -24,6 +26,7 @@ }, { "address": "0x1234567890123456789012345678901234567892", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -33,6 +36,7 @@ }, { "address": "0x1234567890123456789012345678901234567893", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/polymorphic_address/state_1.json b/tests/runner/polymorphic_address/state_1.json index ab5f88b27..1dc2c219e 100644 --- a/tests/runner/polymorphic_address/state_1.json +++ b/tests/runner/polymorphic_address/state_1.json @@ -16,6 +16,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint128", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/polymorphic_address/state_2.json b/tests/runner/polymorphic_address/state_2.json index 4e50a6596..f2efb3622 100644 --- a/tests/runner/polymorphic_address/state_2.json +++ b/tests/runner/polymorphic_address/state_2.json @@ -16,6 +16,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint128", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/remote_state_reads/init_address_type_state.json b/tests/runner/remote_state_reads/init_address_type_state.json index 2c68c5993..7f22f783c 100644 --- a/tests/runner/remote_state_reads/init_address_type_state.json +++ b/tests/runner/remote_state_reads/init_address_type_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/remote_state_reads/init_assignable_map_types_state.json b/tests/runner/remote_state_reads/init_assignable_map_types_state.json index d1fe1129f..3fc3798d7 100644 --- a/tests/runner/remote_state_reads/init_assignable_map_types_state.json +++ b/tests/runner/remote_state_reads/init_assignable_map_types_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/remote_state_reads/init_balance_and_nonce_state.json b/tests/runner/remote_state_reads/init_balance_and_nonce_state.json index c131d6889..9af7e5eb2 100644 --- a/tests/runner/remote_state_reads/init_balance_and_nonce_state.json +++ b/tests/runner/remote_state_reads/init_balance_and_nonce_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "3" }, { "vname": "_balance", "type": "Uint128", "value": "42" } @@ -13,6 +14,7 @@ }, { "address": "0x1234567890123456789012345678901234567889", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/remote_state_reads/init_balance_no_nonce_state.json b/tests/runner/remote_state_reads/init_balance_no_nonce_state.json index 6e46c5311..ea1f187b2 100644 --- a/tests/runner/remote_state_reads/init_balance_no_nonce_state.json +++ b/tests/runner/remote_state_reads/init_balance_no_nonce_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" } @@ -13,6 +14,7 @@ }, { "address": "0x1234567890123456789012345678901234567889", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/remote_state_reads/init_missing_field_state.json b/tests/runner/remote_state_reads/init_missing_field_state.json index b75f7c83c..a9d431556 100644 --- a/tests/runner/remote_state_reads/init_missing_field_state.json +++ b/tests/runner/remote_state_reads/init_missing_field_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/remote_state_reads/init_no_address_state.json b/tests/runner/remote_state_reads/init_no_address_state.json index 3be8b43e3..e59902cbe 100644 --- a/tests/runner/remote_state_reads/init_no_address_state.json +++ b/tests/runner/remote_state_reads/init_no_address_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" } @@ -13,6 +14,7 @@ }, { "address": "0x1234567890123456789012345678901234567889", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/remote_state_reads/init_nonce_no_balance_state.json b/tests/runner/remote_state_reads/init_nonce_no_balance_state.json index 733c0f0f3..5b5c40e2f 100644 --- a/tests/runner/remote_state_reads/init_nonce_no_balance_state.json +++ b/tests/runner/remote_state_reads/init_nonce_no_balance_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "0" } @@ -13,6 +14,7 @@ }, { "address": "0x1234567890123456789012345678901234567889", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/remote_state_reads/init_state.json b/tests/runner/remote_state_reads/init_state.json index 2c68c5993..7f22f783c 100644 --- a/tests/runner/remote_state_reads/init_state.json +++ b/tests/runner/remote_state_reads/init_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/remote_state_reads/init_wrong_address_field_type_state.json b/tests/runner/remote_state_reads/init_wrong_address_field_type_state.json index 173da9b48..48f58900e 100644 --- a/tests/runner/remote_state_reads/init_wrong_address_field_type_state.json +++ b/tests/runner/remote_state_reads/init_wrong_address_field_type_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/remote_state_reads/init_wrong_field_type_state.json b/tests/runner/remote_state_reads/init_wrong_field_type_state.json index f57bc2eb7..7c92a0add 100644 --- a/tests/runner/remote_state_reads/init_wrong_field_type_state.json +++ b/tests/runner/remote_state_reads/init_wrong_field_type_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/remote_state_reads/init_wrong_map_type_state.json b/tests/runner/remote_state_reads/init_wrong_map_type_state.json index 9e9c33511..00fb8b018 100644 --- a/tests/runner/remote_state_reads/init_wrong_map_type_state.json +++ b/tests/runner/remote_state_reads/init_wrong_map_type_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/remote_state_reads/state_1.json b/tests/runner/remote_state_reads/state_1.json index 4883f4216..4a4efa883 100644 --- a/tests/runner/remote_state_reads/state_1.json +++ b/tests/runner/remote_state_reads/state_1.json @@ -139,6 +139,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" } @@ -146,6 +147,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -154,6 +156,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -189,6 +192,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" } diff --git a/tests/runner/remote_state_reads/state_10.json b/tests/runner/remote_state_reads/state_10.json index 9c75b97a0..f397deaa5 100644 --- a/tests/runner/remote_state_reads/state_10.json +++ b/tests/runner/remote_state_reads/state_10.json @@ -139,6 +139,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "22" }, { "vname": "_balance", "type": "Uint128", "value": "0" } @@ -146,6 +147,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -154,6 +156,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -189,6 +192,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" } diff --git a/tests/runner/remote_state_reads/state_100.json b/tests/runner/remote_state_reads/state_100.json index 032f137e7..ad4da8d3a 100644 --- a/tests/runner/remote_state_reads/state_100.json +++ b/tests/runner/remote_state_reads/state_100.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "64" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" } @@ -106,6 +107,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "31" }, { "vname": "transactionCount", "type": "Uint32", "value": "5" }, @@ -139,6 +141,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "128" } ] diff --git a/tests/runner/remote_state_reads/state_101.json b/tests/runner/remote_state_reads/state_101.json index f0c663d87..0225f7cc3 100644 --- a/tests/runner/remote_state_reads/state_101.json +++ b/tests/runner/remote_state_reads/state_101.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -107,6 +108,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" } @@ -114,6 +116,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -149,6 +152,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" } diff --git a/tests/runner/remote_state_reads/state_102.json b/tests/runner/remote_state_reads/state_102.json index bc7333d51..91137e043 100644 --- a/tests/runner/remote_state_reads/state_102.json +++ b/tests/runner/remote_state_reads/state_102.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -107,6 +108,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -115,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -149,6 +152,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" } diff --git a/tests/runner/remote_state_reads/state_103.json b/tests/runner/remote_state_reads/state_103.json index b40faefe1..ba95ccb6f 100644 --- a/tests/runner/remote_state_reads/state_103.json +++ b/tests/runner/remote_state_reads/state_103.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -107,6 +108,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -115,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -150,6 +153,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" } diff --git a/tests/runner/remote_state_reads/state_104.json b/tests/runner/remote_state_reads/state_104.json index 4681716a0..a458d0585 100644 --- a/tests/runner/remote_state_reads/state_104.json +++ b/tests/runner/remote_state_reads/state_104.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -107,6 +108,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -115,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -150,6 +153,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" } diff --git a/tests/runner/remote_state_reads/state_105.json b/tests/runner/remote_state_reads/state_105.json index 48b60c2d3..cde8276e0 100644 --- a/tests/runner/remote_state_reads/state_105.json +++ b/tests/runner/remote_state_reads/state_105.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -107,6 +108,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -115,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -150,6 +153,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" } diff --git a/tests/runner/remote_state_reads/state_106.json b/tests/runner/remote_state_reads/state_106.json index fb3da1b3f..d74487fc3 100644 --- a/tests/runner/remote_state_reads/state_106.json +++ b/tests/runner/remote_state_reads/state_106.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -107,6 +108,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -115,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -150,6 +153,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" } diff --git a/tests/runner/remote_state_reads/state_107.json b/tests/runner/remote_state_reads/state_107.json index 3233dcb1d..f6639ab08 100644 --- a/tests/runner/remote_state_reads/state_107.json +++ b/tests/runner/remote_state_reads/state_107.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -107,6 +108,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -115,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -135,6 +138,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" } diff --git a/tests/runner/remote_state_reads/state_108.json b/tests/runner/remote_state_reads/state_108.json index 892c16b4b..6cda13be6 100644 --- a/tests/runner/remote_state_reads/state_108.json +++ b/tests/runner/remote_state_reads/state_108.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -107,6 +108,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -115,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -150,6 +153,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" } diff --git a/tests/runner/remote_state_reads/state_109.json b/tests/runner/remote_state_reads/state_109.json index 0123bdb07..d3c5464d4 100644 --- a/tests/runner/remote_state_reads/state_109.json +++ b/tests/runner/remote_state_reads/state_109.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -116,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -133,6 +135,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -161,6 +164,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, @@ -170,6 +174,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564327", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" } diff --git a/tests/runner/remote_state_reads/state_11.json b/tests/runner/remote_state_reads/state_11.json index 693c52028..ebf3b9db9 100644 --- a/tests/runner/remote_state_reads/state_11.json +++ b/tests/runner/remote_state_reads/state_11.json @@ -139,6 +139,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "22" }, { "vname": "_balance", "type": "Uint128", "value": "10" } @@ -146,6 +147,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -154,6 +156,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -189,6 +192,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" } diff --git a/tests/runner/remote_state_reads/state_110.json b/tests/runner/remote_state_reads/state_110.json index 396060e24..8653cf513 100644 --- a/tests/runner/remote_state_reads/state_110.json +++ b/tests/runner/remote_state_reads/state_110.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -116,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -133,6 +135,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -161,6 +164,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, diff --git a/tests/runner/remote_state_reads/state_111.json b/tests/runner/remote_state_reads/state_111.json index 657e7922c..a47d14622 100644 --- a/tests/runner/remote_state_reads/state_111.json +++ b/tests/runner/remote_state_reads/state_111.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -116,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -133,6 +135,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -161,6 +164,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, diff --git a/tests/runner/remote_state_reads/state_112.json b/tests/runner/remote_state_reads/state_112.json index 02325137c..c96928325 100644 --- a/tests/runner/remote_state_reads/state_112.json +++ b/tests/runner/remote_state_reads/state_112.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "42" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, @@ -115,6 +116,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "64" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" }, @@ -131,6 +133,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "31" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564325" }, @@ -158,6 +161,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "128" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564326" }, diff --git a/tests/runner/remote_state_reads/state_113.json b/tests/runner/remote_state_reads/state_113.json index 02325137c..c96928325 100644 --- a/tests/runner/remote_state_reads/state_113.json +++ b/tests/runner/remote_state_reads/state_113.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "42" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, @@ -115,6 +116,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "64" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" }, @@ -131,6 +133,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "31" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564325" }, @@ -158,6 +161,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "128" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564326" }, diff --git a/tests/runner/remote_state_reads/state_114.json b/tests/runner/remote_state_reads/state_114.json index 02325137c..c96928325 100644 --- a/tests/runner/remote_state_reads/state_114.json +++ b/tests/runner/remote_state_reads/state_114.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "42" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, @@ -115,6 +116,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "64" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" }, @@ -131,6 +133,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "31" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564325" }, @@ -158,6 +161,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "128" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564326" }, diff --git a/tests/runner/remote_state_reads/state_115.json b/tests/runner/remote_state_reads/state_115.json index 16b36b98c..add3665bd 100644 --- a/tests/runner/remote_state_reads/state_115.json +++ b/tests/runner/remote_state_reads/state_115.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -116,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -132,6 +134,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -160,6 +163,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, diff --git a/tests/runner/remote_state_reads/state_116.json b/tests/runner/remote_state_reads/state_116.json index cfc253ebc..382abc4f1 100644 --- a/tests/runner/remote_state_reads/state_116.json +++ b/tests/runner/remote_state_reads/state_116.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -116,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -133,6 +135,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -161,6 +164,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, diff --git a/tests/runner/remote_state_reads/state_117.json b/tests/runner/remote_state_reads/state_117.json index 0123bdb07..d3c5464d4 100644 --- a/tests/runner/remote_state_reads/state_117.json +++ b/tests/runner/remote_state_reads/state_117.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -116,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -133,6 +135,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -161,6 +164,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, @@ -170,6 +174,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564327", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" } diff --git a/tests/runner/remote_state_reads/state_118.json b/tests/runner/remote_state_reads/state_118.json index be7996979..c94611867 100644 --- a/tests/runner/remote_state_reads/state_118.json +++ b/tests/runner/remote_state_reads/state_118.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -116,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -125,6 +127,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -153,6 +156,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, diff --git a/tests/runner/remote_state_reads/state_119.json b/tests/runner/remote_state_reads/state_119.json index b22ab3dab..d378359a7 100644 --- a/tests/runner/remote_state_reads/state_119.json +++ b/tests/runner/remote_state_reads/state_119.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "42" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, @@ -115,6 +116,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "64" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" }, @@ -131,6 +133,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "31" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564325" }, @@ -158,6 +161,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "128" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564326" }, diff --git a/tests/runner/remote_state_reads/state_120.json b/tests/runner/remote_state_reads/state_120.json index fca88d57d..c86215130 100644 --- a/tests/runner/remote_state_reads/state_120.json +++ b/tests/runner/remote_state_reads/state_120.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "42" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, @@ -115,6 +116,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "64" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" }, @@ -131,6 +133,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "31" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564325" }, @@ -158,6 +161,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "128" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564326" }, diff --git a/tests/runner/remote_state_reads/state_121.json b/tests/runner/remote_state_reads/state_121.json index 0123bdb07..d3c5464d4 100644 --- a/tests/runner/remote_state_reads/state_121.json +++ b/tests/runner/remote_state_reads/state_121.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -116,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -133,6 +135,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -161,6 +164,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, @@ -170,6 +174,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564327", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" } diff --git a/tests/runner/remote_state_reads/state_122.json b/tests/runner/remote_state_reads/state_122.json index 0123bdb07..d3c5464d4 100644 --- a/tests/runner/remote_state_reads/state_122.json +++ b/tests/runner/remote_state_reads/state_122.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -116,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -133,6 +135,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -161,6 +164,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, @@ -170,6 +174,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564327", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" } diff --git a/tests/runner/remote_state_reads/state_123.json b/tests/runner/remote_state_reads/state_123.json index b5feea083..2f285e03e 100644 --- a/tests/runner/remote_state_reads/state_123.json +++ b/tests/runner/remote_state_reads/state_123.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -116,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -133,6 +135,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -161,6 +164,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, diff --git a/tests/runner/remote_state_reads/state_124.json b/tests/runner/remote_state_reads/state_124.json index 02537903f..b54fa2611 100644 --- a/tests/runner/remote_state_reads/state_124.json +++ b/tests/runner/remote_state_reads/state_124.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "42" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, @@ -115,6 +116,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "64" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" }, @@ -131,6 +133,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "31" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564325" }, @@ -158,6 +161,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "128" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564326" }, diff --git a/tests/runner/remote_state_reads/state_125.json b/tests/runner/remote_state_reads/state_125.json index d2a1d4bf5..afd4501d3 100644 --- a/tests/runner/remote_state_reads/state_125.json +++ b/tests/runner/remote_state_reads/state_125.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -116,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -133,6 +135,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -161,6 +164,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, diff --git a/tests/runner/remote_state_reads/state_126.json b/tests/runner/remote_state_reads/state_126.json index 47eb2202f..038b137aa 100644 --- a/tests/runner/remote_state_reads/state_126.json +++ b/tests/runner/remote_state_reads/state_126.json @@ -115,6 +115,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "42" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, @@ -131,6 +132,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "64" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" }, @@ -147,6 +149,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "31" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564325" }, @@ -174,6 +177,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "128" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564326" }, diff --git a/tests/runner/remote_state_reads/state_127.json b/tests/runner/remote_state_reads/state_127.json index d493e09cb..0219330dc 100644 --- a/tests/runner/remote_state_reads/state_127.json +++ b/tests/runner/remote_state_reads/state_127.json @@ -115,6 +115,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564322", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "50" } ] diff --git a/tests/runner/remote_state_reads/state_128.json b/tests/runner/remote_state_reads/state_128.json index 023a1aefa..e7ffe06ce 100644 --- a/tests/runner/remote_state_reads/state_128.json +++ b/tests/runner/remote_state_reads/state_128.json @@ -139,6 +139,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" } @@ -146,6 +147,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -154,6 +156,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -189,6 +192,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" } diff --git a/tests/runner/remote_state_reads/state_129.json b/tests/runner/remote_state_reads/state_129.json index d2a1d4bf5..afd4501d3 100644 --- a/tests/runner/remote_state_reads/state_129.json +++ b/tests/runner/remote_state_reads/state_129.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -116,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -133,6 +135,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -161,6 +164,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, diff --git a/tests/runner/remote_state_reads/state_130.json b/tests/runner/remote_state_reads/state_130.json index af127b23b..23a5b60c9 100644 --- a/tests/runner/remote_state_reads/state_130.json +++ b/tests/runner/remote_state_reads/state_130.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -116,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -133,6 +135,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -161,6 +164,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, @@ -170,6 +174,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564327", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "1" }, { "vname": "_balance", "type": "Uint128", "value": "0" } diff --git a/tests/runner/remote_state_reads/state_131.json b/tests/runner/remote_state_reads/state_131.json index 3b6610c60..b19714519 100644 --- a/tests/runner/remote_state_reads/state_131.json +++ b/tests/runner/remote_state_reads/state_131.json @@ -99,6 +99,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -116,6 +117,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -133,6 +135,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -161,6 +164,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, @@ -170,6 +174,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564327", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "1" } diff --git a/tests/runner/remote_state_reads/state_2.json b/tests/runner/remote_state_reads/state_2.json index dc0d61e7f..cb4a9612b 100644 --- a/tests/runner/remote_state_reads/state_2.json +++ b/tests/runner/remote_state_reads/state_2.json @@ -139,6 +139,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -147,6 +148,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -155,6 +157,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -191,6 +194,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" } diff --git a/tests/runner/remote_state_reads/state_3.json b/tests/runner/remote_state_reads/state_3.json index c79212e21..a82884e97 100644 --- a/tests/runner/remote_state_reads/state_3.json +++ b/tests/runner/remote_state_reads/state_3.json @@ -139,6 +139,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -147,6 +148,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -155,6 +157,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -190,6 +193,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, diff --git a/tests/runner/remote_state_reads/state_4.json b/tests/runner/remote_state_reads/state_4.json index c8ffc25f1..ac7b5f564 100644 --- a/tests/runner/remote_state_reads/state_4.json +++ b/tests/runner/remote_state_reads/state_4.json @@ -139,6 +139,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -147,6 +148,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -155,6 +157,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -190,6 +193,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, diff --git a/tests/runner/remote_state_reads/state_5.json b/tests/runner/remote_state_reads/state_5.json index c8ffc25f1..ac7b5f564 100644 --- a/tests/runner/remote_state_reads/state_5.json +++ b/tests/runner/remote_state_reads/state_5.json @@ -139,6 +139,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -147,6 +148,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -155,6 +157,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -190,6 +193,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, diff --git a/tests/runner/remote_state_reads/state_6.json b/tests/runner/remote_state_reads/state_6.json index 534874e6a..fb5ca2599 100644 --- a/tests/runner/remote_state_reads/state_6.json +++ b/tests/runner/remote_state_reads/state_6.json @@ -139,6 +139,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -156,6 +157,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -173,6 +175,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, @@ -201,6 +204,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "128" }, diff --git a/tests/runner/remote_state_reads/state_7.json b/tests/runner/remote_state_reads/state_7.json index 059c2cdda..27e086b69 100644 --- a/tests/runner/remote_state_reads/state_7.json +++ b/tests/runner/remote_state_reads/state_7.json @@ -139,6 +139,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "42" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, @@ -155,6 +156,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "64" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" }, @@ -171,6 +173,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "31" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564325" }, @@ -198,6 +201,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "128" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564326" }, diff --git a/tests/runner/remote_state_reads/state_8.json b/tests/runner/remote_state_reads/state_8.json index 059c2cdda..27e086b69 100644 --- a/tests/runner/remote_state_reads/state_8.json +++ b/tests/runner/remote_state_reads/state_8.json @@ -139,6 +139,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "42" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, @@ -155,6 +156,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "64" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" }, @@ -171,6 +173,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "31" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564325" }, @@ -198,6 +201,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "128" }, { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564326" }, diff --git a/tests/runner/remote_state_reads/state_9.json b/tests/runner/remote_state_reads/state_9.json index 0998c8aec..8e7fb1ff4 100644 --- a/tests/runner/remote_state_reads/state_9.json +++ b/tests/runner/remote_state_reads/state_9.json @@ -139,6 +139,7 @@ "value": [ { "address": "0x5c6712c8f3b049e98e733cfdb38a8e37a1c724c0", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "1000000" } ] diff --git a/tests/runner/remote_state_reads_2/init_state.json b/tests/runner/remote_state_reads_2/init_state.json index f29c97f1a..a4e383d77 100644 --- a/tests/runner/remote_state_reads_2/init_state.json +++ b/tests/runner/remote_state_reads_2/init_state.json @@ -6,6 +6,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "42" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -17,6 +18,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -28,6 +30,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, diff --git a/tests/runner/remote_state_reads_2/state_1.json b/tests/runner/remote_state_reads_2/state_1.json index 356cbbdc5..71e06e3e0 100644 --- a/tests/runner/remote_state_reads_2/state_1.json +++ b/tests/runner/remote_state_reads_2/state_1.json @@ -26,6 +26,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -37,6 +38,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -48,6 +50,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, diff --git a/tests/runner/remote_state_reads_2/state_2.json b/tests/runner/remote_state_reads_2/state_2.json index 1b3c106fe..3f332b688 100644 --- a/tests/runner/remote_state_reads_2/state_2.json +++ b/tests/runner/remote_state_reads_2/state_2.json @@ -26,6 +26,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -37,6 +38,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -48,6 +50,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, diff --git a/tests/runner/remote_state_reads_2/state_3.json b/tests/runner/remote_state_reads_2/state_3.json index 4df7cd50b..74a648d4d 100644 --- a/tests/runner/remote_state_reads_2/state_3.json +++ b/tests/runner/remote_state_reads_2/state_3.json @@ -26,6 +26,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -37,6 +38,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -48,6 +50,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, diff --git a/tests/runner/remote_state_reads_2/state_4.json b/tests/runner/remote_state_reads_2/state_4.json index 4df7cd50b..74a648d4d 100644 --- a/tests/runner/remote_state_reads_2/state_4.json +++ b/tests/runner/remote_state_reads_2/state_4.json @@ -26,6 +26,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -37,6 +38,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -48,6 +50,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, diff --git a/tests/runner/remote_state_reads_2/state_5.json b/tests/runner/remote_state_reads_2/state_5.json index 4df7cd50b..74a648d4d 100644 --- a/tests/runner/remote_state_reads_2/state_5.json +++ b/tests/runner/remote_state_reads_2/state_5.json @@ -26,6 +26,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, @@ -37,6 +38,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "64" }, @@ -48,6 +50,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "31" }, diff --git a/tests/runner/replicate/state_1.json b/tests/runner/replicate/state_1.json index 024e41f41..d15f172c1 100644 --- a/tests/runner/replicate/state_1.json +++ b/tests/runner/replicate/state_1.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x55345678901234567890123456789012345678ff", + "cparams": [], "state": [ { "vname": "_nonce", diff --git a/tests/runner/replicate/state_100.json b/tests/runner/replicate/state_100.json index 024e41f41..d15f172c1 100644 --- a/tests/runner/replicate/state_100.json +++ b/tests/runner/replicate/state_100.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x55345678901234567890123456789012345678ff", + "cparams": [], "state": [ { "vname": "_nonce", diff --git a/tests/runner/replicate/state_101.json b/tests/runner/replicate/state_101.json index 024e41f41..d15f172c1 100644 --- a/tests/runner/replicate/state_101.json +++ b/tests/runner/replicate/state_101.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x55345678901234567890123456789012345678ff", + "cparams": [], "state": [ { "vname": "_nonce", diff --git a/tests/runner/replicate/state_2.json b/tests/runner/replicate/state_2.json index 024e41f41..d15f172c1 100644 --- a/tests/runner/replicate/state_2.json +++ b/tests/runner/replicate/state_2.json @@ -10,6 +10,7 @@ "value": [ { "address": "0x55345678901234567890123456789012345678ff", + "cparams": [], "state": [ { "vname": "_nonce", diff --git a/tests/runner/salarybot/state_0.json b/tests/runner/salarybot/state_0.json index da09b8a0e..98e10b0cb 100644 --- a/tests/runner/salarybot/state_0.json +++ b/tests/runner/salarybot/state_0.json @@ -15,6 +15,7 @@ "value": [ { "address": "0x1234567890123456789012345678901234567890", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "100000242" } ] diff --git a/tests/runner/type_casts/state_1.json b/tests/runner/type_casts/state_1.json index ee6a60749..37ab7d327 100644 --- a/tests/runner/type_casts/state_1.json +++ b/tests/runner/type_casts/state_1.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/type_casts/state_10.json b/tests/runner/type_casts/state_10.json index e3adf85b7..99a2e61e0 100644 --- a/tests/runner/type_casts/state_10.json +++ b/tests/runner/type_casts/state_10.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/type_casts/state_11.json b/tests/runner/type_casts/state_11.json index d735d1114..5d1811d26 100644 --- a/tests/runner/type_casts/state_11.json +++ b/tests/runner/type_casts/state_11.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" } diff --git a/tests/runner/type_casts/state_12.json b/tests/runner/type_casts/state_12.json index 18181296a..f85cce72b 100644 --- a/tests/runner/type_casts/state_12.json +++ b/tests/runner/type_casts/state_12.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" } diff --git a/tests/runner/type_casts/state_13.json b/tests/runner/type_casts/state_13.json index ee6a60749..37ab7d327 100644 --- a/tests/runner/type_casts/state_13.json +++ b/tests/runner/type_casts/state_13.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/type_casts/state_14.json b/tests/runner/type_casts/state_14.json index d85b7920d..d7fc2198b 100644 --- a/tests/runner/type_casts/state_14.json +++ b/tests/runner/type_casts/state_14.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" }, diff --git a/tests/runner/type_casts/state_15.json b/tests/runner/type_casts/state_15.json index 18181296a..f85cce72b 100644 --- a/tests/runner/type_casts/state_15.json +++ b/tests/runner/type_casts/state_15.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" } diff --git a/tests/runner/type_casts/state_16.json b/tests/runner/type_casts/state_16.json index 9ddf1b421..ec71925cd 100644 --- a/tests/runner/type_casts/state_16.json +++ b/tests/runner/type_casts/state_16.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" }, diff --git a/tests/runner/type_casts/state_17.json b/tests/runner/type_casts/state_17.json index 6b4a45d00..ea72bffa1 100644 --- a/tests/runner/type_casts/state_17.json +++ b/tests/runner/type_casts/state_17.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" }, diff --git a/tests/runner/type_casts/state_18.json b/tests/runner/type_casts/state_18.json index d735d1114..5d1811d26 100644 --- a/tests/runner/type_casts/state_18.json +++ b/tests/runner/type_casts/state_18.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" } diff --git a/tests/runner/type_casts/state_19.json b/tests/runner/type_casts/state_19.json index 18181296a..f85cce72b 100644 --- a/tests/runner/type_casts/state_19.json +++ b/tests/runner/type_casts/state_19.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" } diff --git a/tests/runner/type_casts/state_2.json b/tests/runner/type_casts/state_2.json index e3adf85b7..99a2e61e0 100644 --- a/tests/runner/type_casts/state_2.json +++ b/tests/runner/type_casts/state_2.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/type_casts/state_20.json b/tests/runner/type_casts/state_20.json index 667ecce99..f8245d679 100644 --- a/tests/runner/type_casts/state_20.json +++ b/tests/runner/type_casts/state_20.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" }, diff --git a/tests/runner/type_casts/state_21.json b/tests/runner/type_casts/state_21.json index fd99c6e24..9edeac6e1 100644 --- a/tests/runner/type_casts/state_21.json +++ b/tests/runner/type_casts/state_21.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" }, diff --git a/tests/runner/type_casts/state_22.json b/tests/runner/type_casts/state_22.json index d85b7920d..d7fc2198b 100644 --- a/tests/runner/type_casts/state_22.json +++ b/tests/runner/type_casts/state_22.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" }, diff --git a/tests/runner/type_casts/state_23.json b/tests/runner/type_casts/state_23.json index e0d9951b1..a588e21cf 100644 --- a/tests/runner/type_casts/state_23.json +++ b/tests/runner/type_casts/state_23.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" }, diff --git a/tests/runner/type_casts/state_24.json b/tests/runner/type_casts/state_24.json index d33fc4dc8..70f5cfe16 100644 --- a/tests/runner/type_casts/state_24.json +++ b/tests/runner/type_casts/state_24.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" }, diff --git a/tests/runner/type_casts/state_25.json b/tests/runner/type_casts/state_25.json index ddcd674f6..239b60496 100644 --- a/tests/runner/type_casts/state_25.json +++ b/tests/runner/type_casts/state_25.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "2442" } diff --git a/tests/runner/type_casts/state_26.json b/tests/runner/type_casts/state_26.json index 92e41058c..6712b3cae 100644 --- a/tests/runner/type_casts/state_26.json +++ b/tests/runner/type_casts/state_26.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "242" }, diff --git a/tests/runner/type_casts/state_27.json b/tests/runner/type_casts/state_27.json index 759b04c62..cc416727c 100644 --- a/tests/runner/type_casts/state_27.json +++ b/tests/runner/type_casts/state_27.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "242" }, diff --git a/tests/runner/type_casts/state_28.json b/tests/runner/type_casts/state_28.json index b66c46d86..63a6575cd 100644 --- a/tests/runner/type_casts/state_28.json +++ b/tests/runner/type_casts/state_28.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "242" }, diff --git a/tests/runner/type_casts/state_29.json b/tests/runner/type_casts/state_29.json index e0472fdab..7b32ca20d 100644 --- a/tests/runner/type_casts/state_29.json +++ b/tests/runner/type_casts/state_29.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "242" }, diff --git a/tests/runner/type_casts/state_3.json b/tests/runner/type_casts/state_3.json index ee6a60749..37ab7d327 100644 --- a/tests/runner/type_casts/state_3.json +++ b/tests/runner/type_casts/state_3.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/type_casts/state_30.json b/tests/runner/type_casts/state_30.json index 2037832ca..9e4ca3ba2 100644 --- a/tests/runner/type_casts/state_30.json +++ b/tests/runner/type_casts/state_30.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "242" }, diff --git a/tests/runner/type_casts/state_31.json b/tests/runner/type_casts/state_31.json index 0ff0a0b24..4649943aa 100644 --- a/tests/runner/type_casts/state_31.json +++ b/tests/runner/type_casts/state_31.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "242" }, diff --git a/tests/runner/type_casts/state_32.json b/tests/runner/type_casts/state_32.json index 60219c97d..c8872ad40 100644 --- a/tests/runner/type_casts/state_32.json +++ b/tests/runner/type_casts/state_32.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "242" }, diff --git a/tests/runner/type_casts/state_33.json b/tests/runner/type_casts/state_33.json index b66c46d86..63a6575cd 100644 --- a/tests/runner/type_casts/state_33.json +++ b/tests/runner/type_casts/state_33.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "242" }, diff --git a/tests/runner/type_casts/state_34.json b/tests/runner/type_casts/state_34.json index c73872174..d8049b4ad 100644 --- a/tests/runner/type_casts/state_34.json +++ b/tests/runner/type_casts/state_34.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "242" }, diff --git a/tests/runner/type_casts/state_35.json b/tests/runner/type_casts/state_35.json index 8030d6be8..a45fd34c1 100644 --- a/tests/runner/type_casts/state_35.json +++ b/tests/runner/type_casts/state_35.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "242" }, diff --git a/tests/runner/type_casts/state_36.json b/tests/runner/type_casts/state_36.json index 60219c97d..c8872ad40 100644 --- a/tests/runner/type_casts/state_36.json +++ b/tests/runner/type_casts/state_36.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "242" }, diff --git a/tests/runner/type_casts/state_37.json b/tests/runner/type_casts/state_37.json index c9bc69887..7d3247798 100644 --- a/tests/runner/type_casts/state_37.json +++ b/tests/runner/type_casts/state_37.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "242" }, @@ -120,6 +121,7 @@ }, { "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "22" }, diff --git a/tests/runner/type_casts/state_4.json b/tests/runner/type_casts/state_4.json index e3adf85b7..99a2e61e0 100644 --- a/tests/runner/type_casts/state_4.json +++ b/tests/runner/type_casts/state_4.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/type_casts/state_5.json b/tests/runner/type_casts/state_5.json index ee6a60749..37ab7d327 100644 --- a/tests/runner/type_casts/state_5.json +++ b/tests/runner/type_casts/state_5.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/type_casts/state_6.json b/tests/runner/type_casts/state_6.json index e3adf85b7..99a2e61e0 100644 --- a/tests/runner/type_casts/state_6.json +++ b/tests/runner/type_casts/state_6.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/type_casts/state_7.json b/tests/runner/type_casts/state_7.json index d735d1114..5d1811d26 100644 --- a/tests/runner/type_casts/state_7.json +++ b/tests/runner/type_casts/state_7.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "0" } diff --git a/tests/runner/type_casts/state_8.json b/tests/runner/type_casts/state_8.json index 18181296a..f85cce72b 100644 --- a/tests/runner/type_casts/state_8.json +++ b/tests/runner/type_casts/state_8.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" } diff --git a/tests/runner/type_casts/state_9.json b/tests/runner/type_casts/state_9.json index ee6a60749..37ab7d327 100644 --- a/tests/runner/type_casts/state_9.json +++ b/tests/runner/type_casts/state_9.json @@ -111,6 +111,7 @@ "value": [ { "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [], "state": [ { "vname": "_nonce", "type": "Uint64", "value": "0" }, { "vname": "_balance", "type": "Uint128", "value": "42" }, diff --git a/tests/runner/wallet/state_1.json b/tests/runner/wallet/state_1.json index fde9abdcf..b70815b5b 100644 --- a/tests/runner/wallet/state_1.json +++ b/tests/runner/wallet/state_1.json @@ -34,6 +34,7 @@ "value": [ { "address": "0x1234567890123456789012345678906784567890", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/wallet/state_6.json b/tests/runner/wallet/state_6.json index 37041c6d1..001afe2e9 100644 --- a/tests/runner/wallet/state_6.json +++ b/tests/runner/wallet/state_6.json @@ -51,6 +51,7 @@ "value": [ { "address": "0x1234567890123456789012345678906784567890", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/wallet_2/state_1.json b/tests/runner/wallet_2/state_1.json index 133afd24e..1e7d12a09 100644 --- a/tests/runner/wallet_2/state_1.json +++ b/tests/runner/wallet_2/state_1.json @@ -41,6 +41,7 @@ "value": [ { "address": "0x1234567890123456789012345678906784567890", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] diff --git a/tests/runner/wallet_2/state_2.json b/tests/runner/wallet_2/state_2.json index d0204c548..c6459293f 100644 --- a/tests/runner/wallet_2/state_2.json +++ b/tests/runner/wallet_2/state_2.json @@ -41,6 +41,7 @@ "value": [ { "address": "0x1234567890123456789012345678906000000000", + "cparams": [], "state": [ { "vname": "_balance", "type": "Uint128", "value": "242" } ] From 437ab6f420436ce654b56318e8991811f0a2b453 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Thu, 19 Jan 2023 16:37:33 +0100 Subject: [PATCH 19/33] StateService should only keep track of cparams for external contracts --- src/eval/Disambiguator.ml | 6 +++--- src/eval/Runner.ml | 21 ++++++++++---------- src/eval/StateService.ml | 41 ++++++++++++++++++--------------------- 3 files changed, 32 insertions(+), 36 deletions(-) diff --git a/src/eval/Disambiguator.ml b/src/eval/Disambiguator.ml index 0a47ffd0e..12835f47d 100644 --- a/src/eval/Disambiguator.ml +++ b/src/eval/Disambiguator.ml @@ -928,7 +928,7 @@ let run_with_args args = (* Use the provided state json. *) (* We control the state files, so we can assume the type info is correct *) parse_json args.input_state this_address |> - List.map ~f:(fun (n, t, v) -> (n, true, t, v)) + List.map ~f:(fun (n, t, v) -> (n, t, v)) else (* Use IPC *) (* Fetch state from IPC server *) @@ -990,7 +990,7 @@ let run_with_args args = let outputfields = List.map state ~f:(fun (n, tp, v) -> let open StateService in - { fname = n; f_is_mutable = true; ftyp = tp; fval = Some v }) + { fname = n; ftyp = tp; fval = Some v }) in (* Initialise with the final values, then update, then finalise. *) (* ~ext_states not initialised, since they are not supported anyway *) @@ -1029,7 +1029,7 @@ let run_with_args args = (* state_to_json maps name * literal to a vname * type * value json, which is the format for both init and state jsons *) ( JSON.ContractState.state_to_json init, - JSON.ContractState.state_to_json (List.filter_map ~f:(fun (f, m, t, v) -> if m then Some (f, t, v) else None) state)) + JSON.ContractState.state_to_json state) let output_to_string = Yojson.Basic.pretty_to_string diff --git a/src/eval/Runner.ml b/src/eval/Runner.ml index 6fb8d4189..057dbbef6 100644 --- a/src/eval/Runner.ml +++ b/src/eval/Runner.ml @@ -519,7 +519,7 @@ let run_with_args args = let fields = List.filter_map cstate'.fields ~f:(fun (s, t) -> if [%equal: RunnerName.t] s balance_label then None - else Some { fname = s; f_is_mutable = true; ftyp = t; fval = None }) + else Some { fname = s; ftyp = t; fval = None }) in let sm = IPC args.ipc_address in let () = @@ -603,7 +603,7 @@ let run_with_args args = List.filter_map cstate.fields ~f:(fun (s, t) -> let open StateService in if [%equal: RunnerName.t] s balance_label then None - else Some { fname = s; f_is_mutable = true; ftyp = t; fval = None }) + else Some { fname = s; ftyp = t; fval = None }) in let () = StateService.initialize ~sm:(IPC args.ipc_address) ~fields @@ -655,16 +655,18 @@ let run_with_args args = let fields = List.map field_vals ~f:(fun (s, t, l) -> let open StateService in - { fname = s; f_is_mutable = true; ftyp = t; fval = Some l }) + { fname = s; ftyp = t; fval = Some l }) in let ext_states = let open StateService in List.map ext_states ~f:(fun (addr, fields) -> - let fields' = - List.map fields ~f:(fun (n, m, t, l) -> - { fname = n; f_is_mutable = is_mutable m; ftyp = t; fval = Some l }) + let cparams', fields' = + List.partition_map fields ~f:(fun (n, m, t, l) -> + if is_mutable m then + Second { fname = n; ftyp = t; fval = Some l } + else First { fname = n; ftyp = t; fval = Some l }) in - { caddr = addr; cstate = fields' }) + { caddr = addr; cparams = cparams'; cstate = fields' }) in let () = StateService.initialize ~sm:Local ~fields ~ext_states @@ -707,10 +709,7 @@ let run_with_args args = gas in - let osj = - (* get_full_state contains both mutables and immutables, so filter out the immutables *) - List.filter_map field_vals ~f:(fun (f, m, t, v) -> if m then Some (f, t, v) else None) |> - output_state_json cstate'.balance in + let osj = output_state_json cstate'.balance field_vals in let omj = output_message_json gas mlist in let oej = output_event_json elist in let gas' = Gas.finalize_remaining_gas args.gas_limit gas in diff --git a/src/eval/StateService.ml b/src/eval/StateService.ml index 741dd927b..ada0cd5bb 100644 --- a/src/eval/StateService.ml +++ b/src/eval/StateService.ml @@ -36,14 +36,13 @@ open SSIdentifier type ss_field = { fname : SSName.t; - f_is_mutable : bool; ftyp : SSType.t; fval : SSLiteral.t option; (* We may or may not have the value in memory. *) } (* The blockchain info is a map from (query_name, query_args) to some info. *) type bcinfo_state = (string, (string, string) Caml.Hashtbl.t) Caml.Hashtbl.t -type external_state = { caddr : SSLiteral.Bystrx.t; cstate : ss_field list } +type external_state = { caddr : SSLiteral.Bystrx.t; cparams: ss_field list; cstate : ss_field list } type service_mode = | IPC of string @@ -72,7 +71,7 @@ module MakeStateService () = struct let field_type fields fname is_mutable = match - List.find fields ~f:(fun z -> [%equal: SSName.t] z.fname (get_id fname) && ([%equal:bool] z.f_is_mutable is_mutable)) + List.find fields ~f:(fun z -> [%equal: SSName.t] z.fname (get_id fname)) with | Some f -> pure @@ f.ftyp | None -> @@ -87,9 +86,9 @@ module MakeStateService () = struct let fetch_local ~fname ~is_mutable ~keys fields = let s = fields in match - List.find s ~f:(fun z -> [%equal: SSName.t] z.fname (get_id fname) && ([%equal:bool] z.f_is_mutable is_mutable)) + List.find s ~f:(fun z -> [%equal: SSName.t] z.fname (get_id fname)) with - | Some { fname = _; f_is_mutable = _ ; ftyp = MapType _; fval = Some (Map ((kt, vt), mlit)) } + | Some { fname = _; ftyp = MapType _; fval = Some (Map ((kt, vt), mlit)) } when not @@ List.is_empty keys -> let%bind ret_val_type = SSTypeUtil.map_access_type (MapType (kt, vt)) (List.length keys) @@ -141,7 +140,7 @@ module MakeStateService () = struct (ER.get_loc (get_rep fname)) in recurser mlit keys vt - | Some { fname = _; f_is_mutable = _ ; ftyp = _; fval = Some l } -> pure @@ Some l + | Some { fname = _; ftyp = _; fval = Some l } -> pure @@ Some l | _ -> fail1 ~kind: @@ -208,18 +207,18 @@ module MakeStateService () = struct match List.find_map estates ~f:(fun estate -> if SSLiteral.Bystrx.equal caddr estate.caddr then - Some estate.cstate + if is_mutable then Some estate.cstate else Some estate.cparams else None) with - | Some fields -> ( + | Some cparams_or_fields -> ( match - List.find_map fields ~f:(fun field -> - if SSName.equal field.fname (get_id fname) && ([%equal:bool] field.f_is_mutable is_mutable) then + List.find_map cparams_or_fields ~f:(fun field -> + if SSName.equal field.fname (get_id fname) then Some field.ftyp else None) with | Some stored_tp -> - let%bind res = fetch_local ~fname ~is_mutable ~keys fields in + let%bind res = fetch_local ~fname ~is_mutable ~keys cparams_or_fields in pure (res, Option.map res ~f:(fun _ -> stored_tp)) | None -> pure (None, None)) | None -> pure (None, None)) @@ -227,9 +226,9 @@ module MakeStateService () = struct let update_local ~fname ~keys vopt fields = let s = fields in match - List.find s ~f:(fun z -> [%equal: SSName.t] z.fname (get_id fname) && z.f_is_mutable) + List.find s ~f:(fun z -> [%equal: SSName.t] z.fname (get_id fname)) with - | Some { fname = _; f_is_mutable = true ; ftyp = _; fval = Some (Map ((_, vt), mlit)) } + | Some { fname = _; ftyp = _; fval = Some (Map ((_, vt), mlit)) } when not @@ List.is_empty keys -> let rec recurser mlit' klist' vt' = match klist' with @@ -292,14 +291,14 @@ module MakeStateService () = struct (ER.get_loc (get_rep fname)) in recurser mlit keys vt - | Some { fname = f; f_is_mutable = true; ftyp = t; fval = Some _ } -> ( + | Some { fname = f; ftyp = t; fval = Some _ } -> ( match vopt with | Some fval' -> let fields' = List.filter fields ~f:(fun f -> - not ([%equal: SSName.t] f.fname (get_id fname) && f.f_is_mutable)) + not ([%equal: SSName.t] f.fname (get_id fname))) in - pure ({ fname = f; f_is_mutable = true; ftyp = t; fval = Some fval' } :: fields') + pure ({ fname = f; ftyp = t; fval = Some fval' } :: fields') | None -> fail1 ~kind: @@ -361,23 +360,21 @@ module MakeStateService () = struct | None -> fail0 ~kind: - (sprintf "StateService: %s %s's value is not known" - (if f.f_is_mutable then "Field" else "Contract parameter") + (sprintf "StateService: Field %s's value is not known" (SSName.as_error_string f.fname)) ?inst:None - | Some l -> pure (f.fname, f.f_is_mutable, f.ftyp, l)) + | Some l -> pure (f.fname, f.ftyp, l)) | SS (IPC _, fl, _estates, _bcstate) -> let%bind sl = mapM fl ~f:(fun f -> let%bind vopt = fetch ~fname:(mk_loc_id f.fname) ~keys:[] in match vopt with - | Some v -> pure (f.fname, f.f_is_mutable, f.ftyp, v) + | Some v -> pure (f.fname, f.ftyp, v) | None -> fail0 ~kind: (sprintf - "StateService: %s %s's value not found on server" - (if f.f_is_mutable then "Field" else "Contract parameter") + "StateService: Field %s's value not found on server" (SSName.as_error_string f.fname)) ?inst:None) in From a87d7b860ce5329b35f0bb5e807fe6d2fcf9fd82 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Fri, 20 Jan 2023 10:01:09 +0100 Subject: [PATCH 20/33] Change fold to map in jobj_to_statevar --- src/base/JSON.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/JSON.ml b/src/base/JSON.ml index 061e5ca07..188e3c4a7 100644 --- a/src/base/JSON.ml +++ b/src/base/JSON.ml @@ -254,7 +254,7 @@ let jobj_to_statevar json = (* We have a list of external addresses, each with their own fields. *) let exts = v |> to_list_exn in let exts' = - List.fold exts ~init:[] ~f:(fun acc ext -> + List.map exts ~f:(fun ext -> let addr = member_exn "address" ext |> to_string_exn |> Bystrx.parse_hex in @@ -263,7 +263,7 @@ let jobj_to_statevar json = let state = member_exn "state" ext |> to_list_exn in let all_fields = List.rev_map_append state cparams' ~f:(recurser_mapper Mutable) in - (addr, all_fields) :: acc) + (addr, all_fields)) in ExtrContrs exts' else From 4d85d8f3b21d3fd27f70854a8366d5e8cb75aa60 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Fri, 20 Jan 2023 15:57:33 +0100 Subject: [PATCH 21/33] Fix incorrect comment --- src/base/JSON.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/JSON.ml b/src/base/JSON.ml index 188e3c4a7..b3c582f45 100644 --- a/src/base/JSON.ml +++ b/src/base/JSON.ml @@ -42,7 +42,7 @@ open JSONType open JSONLiteral type json_parsed_field = - (* A field (mutable or immutable) belonging to this contract. *) + (* A mutable field belonging to this contract. *) | ThisContr of string * JSONType.t * JSONLiteral.t (* External contracts and their fields. *) | ExtrContrs of (Bystrx.t * (string * field_mutability * JSONType.t * JSONLiteral.t) list) list From 82d1389136e281918c96778f06b085c3c30695e0 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Fri, 20 Jan 2023 15:58:15 +0100 Subject: [PATCH 22/33] Make StateIPCTest.ml recognise cparams entry in state jsons --- tests/ipc/StateIPCTest.ml | 101 +++++++++++++++++++++----------------- 1 file changed, 56 insertions(+), 45 deletions(-) diff --git a/tests/ipc/StateIPCTest.ml b/tests/ipc/StateIPCTest.ml index 4ee759a30..7dcf777cd 100644 --- a/tests/ipc/StateIPCTest.ml +++ b/tests/ipc/StateIPCTest.ml @@ -93,38 +93,47 @@ let rec pb_to_json pb = | Ipcmessage_types.Bval s -> json_from_string (Bytes.to_string s) (* Parse a state JSON file into (fname, ftyp, fval) where fval is protobuf encoded. *) +type json_parsed_field = + (* A field mutable belonging to this contract. *) + | ThisContr of string * IPCTestType.t * Ipcmessage_types.proto_scilla_val + (* External contracts and their mutable or immutable fields. *) + | ExtrContrs of (string * (string * bool * IPCTestType.t * Ipcmessage_types.proto_scilla_val) list) list + let json_file_to_state path = - let j = json_from_file path in + let j = json_from_file path |> json_to_list in - let rec jlist_to_states js = - List.map js ~f:(fun sv -> - let fname = json_member "vname" sv |> json_to_string in - let jval = json_member "value" sv in - if String.equal fname "_external" then - let exts = json_to_list jval in - let addr_states = - List.map exts ~f:(fun addr_states -> - let addr = - json_member "address" addr_states |> json_to_string - in - let state = json_member "state" addr_states |> json_to_list in - let state' = jlist_to_states state in - List.map state' ~f:(function - | [ (None, s) ] -> (Some addr, s) - | _ -> - assert_failure - "External state cannot contain nested external states")) - in - List.concat addr_states - else - let ftyp = - json_member "type" sv |> json_to_string |> parse_typ_wrapper - in - let fval = json_to_pb ftyp jval in - [ (None, (fname, ftyp, fval)) ]) + let rec recurser js = + let fname = json_member "vname" js |> json_to_string in + let jval = json_member "value" js in + if String.equal fname "_external" then + let exts = json_to_list jval in + let addr_states = + List.map exts ~f:(fun addr_states -> + let addr = + json_member "address" addr_states |> json_to_string + in + let cparams = json_member "cparams" addr_states |> json_to_list in + let cparams' = List.map cparams ~f:(recurser_mapper false) in + let state = json_member "state" addr_states |> json_to_list in + let all_fields = List.rev_map_append state cparams' ~f:(recurser_mapper true) in + (addr, all_fields)) + in + ExtrContrs addr_states + else + let ftyp = + json_member "type" js |> json_to_string |> parse_typ_wrapper + in + let fval = json_to_pb ftyp jval in + ThisContr (fname, ftyp, fval) + and recurser_mapper is_mutable json = + match recurser json with + | ThisContr (n, t, l) -> (n, is_mutable, t, l) + | _ -> + assert_failure + "External state cannot contain nested external states" in - List.concat @@ jlist_to_states (json_to_list j) - + List.map j ~f:recurser + let state_to_json s = let open IPCTestType in `List @@ -249,11 +258,10 @@ let setup_and_initialize ~start_mock_server ~sock_addr ~state_json_path if start_mock_server then StateIPCTestServer.start_server ~sock_addr; let fields = - List.filter_map state ~f:(fun (addr_opt, (s, t, _)) -> - if - Option.is_some addr_opt || String.(s = CUName.as_string balance_label) - then None - else Some (s, t)) + List.filter_map state ~f:(function + | ThisContr (s, t, _) when not String.(s = CUName.as_string balance_label) -> + Some (s, t) + | _ -> None) in let () = StateIPCTestClient.initialize ~fields ~sock_addr in @@ -267,19 +275,22 @@ let setup_and_initialize ~start_mock_server ~sock_addr ~state_json_path bcinfo; (* Update the server (via the test client) with the state values we want. *) - List.iter state ~f:(fun (addr_opt, (fname, tp, value)) -> - match addr_opt with - | Some caddr -> StateIPCTestClient.update_ext ~caddr ~fname ~is_mutable:true ~value ~tp - | None -> - if String.(fname <> CUName.as_string balance_label) then - StateIPCTestClient.update ~fname ~value); + List.iter state ~f:(function + | ThisContr (fname, _tp, value) when String.(fname <> CUName.as_string balance_label) -> + StateIPCTestClient.update ~fname ~value + | ExtrContrs extrs -> + List.iter extrs ~f:(fun (caddr, fields) -> + List.iter fields ~f:(function + | (fname, is_mutable, tp, value) -> + StateIPCTestClient.update_ext ~caddr ~fname ~is_mutable ~value ~tp)) + | _ -> ()); (* Find the balance from state and return it. *) match - List.find state ~f:(fun (addr_opt, (fname, _, _)) -> - Option.is_none addr_opt - && String.(fname = CUName.as_string balance_label)) + List.find state ~f:(function + | ThisContr (fname, _, _) when String.(fname = CUName.as_string balance_label) -> true + | _ -> false) with - | Some (_, (_, _, balpb)) -> ( + | Some (ThisContr (_, _, balpb)) -> ( match balpb with | Ipcmessage_types.Bval bal -> json_from_string (Bytes.to_string bal) |> json_to_string @@ -288,7 +299,7 @@ let setup_and_initialize ~start_mock_server ~sock_addr ~state_json_path ("Incorrect type of " ^ CUName.as_error_string balance_label ^ " in state.json")) - | None -> + | _ -> assert_failure ("Unable to find " ^ CUName.as_error_string balance_label From f3365627d6b897bc8e0e9d12f902c271172b5796 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Tue, 24 Jan 2023 08:43:39 +0100 Subject: [PATCH 23/33] Deployment tests of remote_state_reads_cparam.scilla --- .../remote_state_reads_cparam.scilla.gold | 124 +++++++++++++++--- .../remote_state_reads_cparam.scilla | 42 +++++- tests/runner/Testcontracts.ml | 13 ++ .../blockchain_1.json | 1 + .../remote_state_reads_cparam/init.json | 22 ++++ .../init_extra_cparam.json | 22 ++++ .../init_extra_cparam_ipc_output.json | 10 ++ .../init_extra_cparam_state.json | 21 +++ .../init_ipc_output.json | 10 ++ .../init_missing_cparam.json | 22 ++++ .../init_missing_cparam_ipc_output.json | 12 ++ .../init_missing_cparam_state.json | 18 +++ .../remote_state_reads_cparam/init_state.json | 20 +++ .../init_wrong_field_type.json | 22 ++++ .../init_wrong_field_type_ipc_output.json | 12 ++ .../init_wrong_field_type_state.json | 20 +++ 16 files changed, 374 insertions(+), 17 deletions(-) create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_1.json create mode 100644 tests/runner/remote_state_reads_cparam/init.json create mode 100644 tests/runner/remote_state_reads_cparam/init_extra_cparam.json create mode 100644 tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json create mode 100644 tests/runner/remote_state_reads_cparam/init_extra_cparam_state.json create mode 100644 tests/runner/remote_state_reads_cparam/init_ipc_output.json create mode 100644 tests/runner/remote_state_reads_cparam/init_missing_cparam.json create mode 100644 tests/runner/remote_state_reads_cparam/init_missing_cparam_ipc_output.json create mode 100644 tests/runner/remote_state_reads_cparam/init_missing_cparam_state.json create mode 100644 tests/runner/remote_state_reads_cparam/init_state.json create mode 100644 tests/runner/remote_state_reads_cparam/init_wrong_field_type.json create mode 100644 tests/runner/remote_state_reads_cparam/init_wrong_field_type_ipc_output.json create mode 100644 tests/runner/remote_state_reads_cparam/init_wrong_field_type_state.json diff --git a/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold b/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold index 1aba16d60..43a933236 100644 --- a/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold +++ b/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold @@ -14,14 +14,23 @@ { "field": "remote_reads_test_res_6_1", "tag": "NoInfo" }, { "field": "remote_reads_test_res_6_2", "tag": "NoInfo" }, { "field": "remote_reads_test_res_7_3", "tag": "(Option NotMoney)" }, - { "field": "remote_reads_test_res_7_6", "tag": "(Option NotMoney)" } + { "field": "remote_reads_test_res_7_6", "tag": "(Option NotMoney)" }, + { "field": "remote_read_remote_read_res_1", "tag": "NoInfo" }, + { "field": "remote_read_remote_read_res_2", "tag": "(Option NoInfo)" }, + { "field": "remote_read_remote_read_res_3", "tag": "NoInfo" }, + { "field": "address_type_erasure_test_res_1", "tag": "(Map NoInfo)" } ], "ADT constructors": [] }, "contract_info": { "scilla_major_version": "0", "vname": "RRCPContract", - "params": [ { "vname": "cparam1", "type": "ByStr20 with end" } ], + "params": [ + { + "vname": "cparam1", + "type": "ByStr20 with contract (admin : ByStr20) end" + } + ], "fields": [ { "vname": "remote_reads_test_res_1", "type": "Uint128", "depth": 0 }, { @@ -59,6 +68,26 @@ "vname": "remote_reads_test_res_7_6", "type": "Option (Bool)", "depth": 0 + }, + { + "vname": "remote_read_remote_read_res_1", + "type": "Uint128", + "depth": 0 + }, + { + "vname": "remote_read_remote_read_res_2", + "type": "Option (Uint128)", + "depth": 0 + }, + { + "vname": "remote_read_remote_read_res_3", + "type": "ByStr20", + "depth": 0 + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "depth": 1 } ], "transitions": [ @@ -128,7 +157,30 @@ "ByStr20 with contract (x : Uint128, y : Uint64) field x : Uint128, field y : Uint64 end" } ] - } + }, + { + "vname": "RemoteReadsOfRemoteRead", + "params": [ + { + "vname": "remote", + "type": + "ByStr20 with contract (admin : ByStr20 with contract (f : ByStr20 with contract (g : Uint128) end) end) end" + } + ] + }, + { + "vname": "RemoteReadsOfRemoteMap", + "params": [ + { + "vname": "remote", + "type": + "ByStr20 with contract (admin : ByStr20 with contract (f : ByStr20 with contract (g : Map (Uint128) (Uint128)) end) end) end" + } + ] + }, + { "vname": "RemoteReadsContractParam", "params": [] }, + { "vname": "AddressTypeErasureTest1", "params": [] }, + { "vname": "AddressTypeErasureTest2", "params": [] } ], "procedures": [], "events": [], @@ -193,7 +245,7 @@ "warning_message": "Write only field: remote_reads_test_res_7_6", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", - "line": 93, + "line": 99, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -203,7 +255,7 @@ "warning_message": "Write only field: remote_reads_test_res_7_3", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", - "line": 89, + "line": 95, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -213,7 +265,7 @@ "warning_message": "Write only field: remote_reads_test_res_6_2", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", - "line": 80, + "line": 86, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -223,7 +275,7 @@ "warning_message": "Write only field: remote_reads_test_res_6_1", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", - "line": 78, + "line": 84, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -233,7 +285,7 @@ "warning_message": "Write only field: remote_reads_test_res_5_5", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", - "line": 71, + "line": 77, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -243,7 +295,7 @@ "warning_message": "Write only field: remote_reads_test_res_5_3", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", - "line": 68, + "line": 74, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -253,7 +305,7 @@ "warning_message": "Write only field: remote_reads_test_res_5_1", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", - "line": 64, + "line": 70, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -263,7 +315,7 @@ "warning_message": "Write only field: remote_reads_test_res_4_2", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", - "line": 57, + "line": 63, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -273,7 +325,7 @@ "warning_message": "Write only field: remote_reads_test_res_4_1", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", - "line": 56, + "line": 62, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -283,7 +335,7 @@ "warning_message": "Write only field: remote_reads_test_res_3_3", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", - "line": 48, + "line": 54, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -293,7 +345,7 @@ "warning_message": "Write only field: remote_reads_test_res_3_2", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", - "line": 46, + "line": 52, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -303,7 +355,7 @@ "warning_message": "Write only field: remote_reads_test_res_2", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", - "line": 38, + "line": 44, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -313,7 +365,37 @@ "warning_message": "Write only field: remote_reads_test_res_1", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", - "line": 31, + "line": 37, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_read_remote_read_res_3", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 121, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_read_remote_read_res_2", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 116, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_read_remote_read_res_1", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 107, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -329,6 +411,16 @@ "end_location": { "file": "", "line": 0, "column": 0 }, "warning_id": 3 }, + { + "warning_message": "Consider using in-place Map access", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 131, + "column": 14 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 1 + }, { "warning_message": "No transition in contract RRCPContract contains an accept statement\n", diff --git a/tests/contracts/remote_state_reads_cparam.scilla b/tests/contracts/remote_state_reads_cparam.scilla index 5e70b3680..8a2cd3375 100644 --- a/tests/contracts/remote_state_reads_cparam.scilla +++ b/tests/contracts/remote_state_reads_cparam.scilla @@ -8,7 +8,7 @@ type AddressADT = | Address2 of ByStr20 with contract (param : ByStr20 with contract (x : Uint128) end) field admin : ByStr20 with end end contract RRCPContract ( - cparam1: ByStr20 with end) + cparam1: ByStr20 with contract (admin : ByStr20) end) field remote_reads_test_res_1 : Uint128 = Uint128 0 (* (x) of remote1 *) field remote_reads_test_res_2 : AddressADT = Address1 cparam1 (* (x) of remote2 *) @@ -23,6 +23,12 @@ field remote_reads_test_res_6_1 : Uint128 = Uint128 0 (* (x) of remote6 *) field remote_reads_test_res_6_2 : Uint64 = Uint64 0 (* x of remote6 *) field remote_reads_test_res_7_3 : Option Bool = None { Bool } (* (x) = x in remote7 *) field remote_reads_test_res_7_6 : Option Bool = None { Bool } (* (y) = y in remote7 *) +field remote_read_remote_read_res_1 : Uint128 = Uint128 0 (* remote.(admin).(f).(g) *) +field remote_read_remote_read_res_2 : Option Uint128 = None {Uint128} (* remote.(admin).(f).(g)[0] *) +field remote_read_remote_read_res_3 : ByStr20 = _this_address (* cparam1.(admin) *) +field address_type_erasure_test_res_1 : Map Uint128 (ByStr20 with end) = Emp Uint128 (ByStr20 with end) (* field[0] := cparam1 *) + + transition RemoteReadContractParameterTest1( remote1: ByStr20 with contract (x : Uint128) end @@ -93,3 +99,37 @@ transition RemoteReadContractParameterTest7( remote_reads_test_res_7_6 := tmp_7_6 end +transition RemoteReadsOfRemoteRead( + remote: ByStr20 with contract (admin : ByStr20 with contract (f : ByStr20 with contract (g : Uint128) end) end) end) + ad <-& remote.(admin); + this_f <-& ad.(f); + this_g <-& this_f.(g); + remote_read_remote_read_res_1 := this_g +end + +transition RemoteReadsOfRemoteMap( + remote: ByStr20 with contract (admin : ByStr20 with contract (f : ByStr20 with contract (g : Map Uint128 Uint128) end) end) end) + ad <-& remote.(admin); + this_f <-& ad.(f); + remote_key = Uint128 0; + this_g <-& this_f.(g)[remote_key]; + remote_read_remote_read_res_2 := this_g +end + +transition RemoteReadsContractParam() + ad <-& cparam1.(admin); + remote_read_remote_read_res_3 := ad +end + +transition AddressTypeErasureTest1() + zero = Uint128 0; + address_type_erasure_test_res_1[zero] := cparam1 +end + +transition AddressTypeErasureTest2() + zero = Uint128 0; + emp_map <- address_type_erasure_test_res_1; + new_map = builtin put emp_map zero cparam1; + address_type_erasure_test_res_1 := new_map +end + diff --git a/tests/runner/Testcontracts.ml b/tests/runner/Testcontracts.ml index b91455c13..d521df6dc 100644 --- a/tests/runner/Testcontracts.ml +++ b/tests/runner/Testcontracts.ml @@ -460,6 +460,12 @@ let contract_tests env = "remote_state_reads" >: build_contract_init_test env succ_code "remote_state_reads" "init_balance_and_nonce" ~is_library:false ~ipc_mode:true; + "remote_state_reads_cparam" + >: build_contract_init_test env succ_code "remote_state_reads_cparam" + "init" ~is_library:false ~ipc_mode:true; + "remote_state_reads_cparam" + >: build_contract_init_test env succ_code "remote_state_reads_cparam" + "init_extra_cparam" ~is_library:false ~ipc_mode:true; "address_eq_test" >::: build_contract_tests ~pplit:false env "address_eq_test" succ_code 1 11 []; @@ -570,6 +576,13 @@ let contract_tests env = "remote_state_reads" >::: build_contract_tests env "remote_state_reads" fail_code 101 131 []; + "remote_state_reads_cparam" + >: build_contract_init_test env fail_code "remote_state_reads_cparam" + "init_missing_cparam" ~is_library:false + ~ipc_mode:true; + "remote_state_reads_cparam" + >: build_contract_init_test env fail_code "remote_state_reads_cparam" + "init_wrong_field_type" ~is_library:false ~ipc_mode:true; "map_as_cparam" >: build_contract_init_test env fail_code "map_as_cparam" "init_illegal_key" ~is_library:false ~ipc_mode:true; diff --git a/tests/runner/remote_state_reads_cparam/blockchain_1.json b/tests/runner/remote_state_reads_cparam/blockchain_1.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_1.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/init.json b/tests/runner/remote_state_reads_cparam/init.json new file mode 100644 index 000000000..ccabc1956 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/init.json @@ -0,0 +1,22 @@ +[ + { + "vname" : "_scilla_version", + "type" : "Uint32", + "value" : "0" + }, + { + "vname" : "_this_address", + "type" : "ByStr20", + "value" : "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname" : "_creation_block", + "type" : "BNum", + "value" : "1" + }, + { + "vname" : "cparam1", + "type" : "ByStr20", + "value" : "0x1234567890123456789012345678901234567890" + } +] diff --git a/tests/runner/remote_state_reads_cparam/init_extra_cparam.json b/tests/runner/remote_state_reads_cparam/init_extra_cparam.json new file mode 100644 index 000000000..ccabc1956 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/init_extra_cparam.json @@ -0,0 +1,22 @@ +[ + { + "vname" : "_scilla_version", + "type" : "Uint32", + "value" : "0" + }, + { + "vname" : "_this_address", + "type" : "ByStr20", + "value" : "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname" : "_creation_block", + "type" : "BNum", + "value" : "1" + }, + { + "vname" : "cparam1", + "type" : "ByStr20", + "value" : "0x1234567890123456789012345678901234567890" + } +] diff --git a/tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json b/tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json new file mode 100644 index 000000000..e4bf0acfd --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json @@ -0,0 +1,10 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "58573", + "_accepted": "false", + "messages": null, + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" } + ], + "events": [] +} diff --git a/tests/runner/remote_state_reads_cparam/init_extra_cparam_state.json b/tests/runner/remote_state_reads_cparam/init_extra_cparam_state.json new file mode 100644 index 000000000..992b7a8d4 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/init_extra_cparam_state.json @@ -0,0 +1,21 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "x", "type": "String", "value": "Hello World!" }, + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567123" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "42" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/init_ipc_output.json b/tests/runner/remote_state_reads_cparam/init_ipc_output.json new file mode 100644 index 000000000..e4bf0acfd --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/init_ipc_output.json @@ -0,0 +1,10 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "58573", + "_accepted": "false", + "messages": null, + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" } + ], + "events": [] +} diff --git a/tests/runner/remote_state_reads_cparam/init_missing_cparam.json b/tests/runner/remote_state_reads_cparam/init_missing_cparam.json new file mode 100644 index 000000000..ccabc1956 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/init_missing_cparam.json @@ -0,0 +1,22 @@ +[ + { + "vname" : "_scilla_version", + "type" : "Uint32", + "value" : "0" + }, + { + "vname" : "_this_address", + "type" : "ByStr20", + "value" : "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname" : "_creation_block", + "type" : "BNum", + "value" : "1" + }, + { + "vname" : "cparam1", + "type" : "ByStr20", + "value" : "0x1234567890123456789012345678901234567890" + } +] diff --git a/tests/runner/remote_state_reads_cparam/init_missing_cparam_ipc_output.json b/tests/runner/remote_state_reads_cparam/init_missing_cparam_ipc_output.json new file mode 100644 index 000000000..5ea745028 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/init_missing_cparam_ipc_output.json @@ -0,0 +1,12 @@ +{ + "gas_remaining": "7321", + "errors": [ + { + "error_message": + "Address does not satisfy type: address is 0x1234567890123456789012345678901234567890, expected type is ByStr20 with contract (admin : ByStr20) end", + "start_location": { "file": "", "line": 0, "column": 0 }, + "end_location": { "file": "", "line": 0, "column": 0 } + } + ], + "warnings": [] +} diff --git a/tests/runner/remote_state_reads_cparam/init_missing_cparam_state.json b/tests/runner/remote_state_reads_cparam/init_missing_cparam_state.json new file mode 100644 index 000000000..14ed831cb --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/init_missing_cparam_state.json @@ -0,0 +1,18 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "42" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/init_state.json b/tests/runner/remote_state_reads_cparam/init_state.json new file mode 100644 index 000000000..6e774313a --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/init_state.json @@ -0,0 +1,20 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567123" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "42" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/init_wrong_field_type.json b/tests/runner/remote_state_reads_cparam/init_wrong_field_type.json new file mode 100644 index 000000000..ccabc1956 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/init_wrong_field_type.json @@ -0,0 +1,22 @@ +[ + { + "vname" : "_scilla_version", + "type" : "Uint32", + "value" : "0" + }, + { + "vname" : "_this_address", + "type" : "ByStr20", + "value" : "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname" : "_creation_block", + "type" : "BNum", + "value" : "1" + }, + { + "vname" : "cparam1", + "type" : "ByStr20", + "value" : "0x1234567890123456789012345678901234567890" + } +] diff --git a/tests/runner/remote_state_reads_cparam/init_wrong_field_type_ipc_output.json b/tests/runner/remote_state_reads_cparam/init_wrong_field_type_ipc_output.json new file mode 100644 index 000000000..5ea745028 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/init_wrong_field_type_ipc_output.json @@ -0,0 +1,12 @@ +{ + "gas_remaining": "7321", + "errors": [ + { + "error_message": + "Address does not satisfy type: address is 0x1234567890123456789012345678901234567890, expected type is ByStr20 with contract (admin : ByStr20) end", + "start_location": { "file": "", "line": 0, "column": 0 }, + "end_location": { "file": "", "line": 0, "column": 0 } + } + ], + "warnings": [] +} diff --git a/tests/runner/remote_state_reads_cparam/init_wrong_field_type_state.json b/tests/runner/remote_state_reads_cparam/init_wrong_field_type_state.json new file mode 100644 index 000000000..fd5320fa6 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/init_wrong_field_type_state.json @@ -0,0 +1,20 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "String", "value": "0x1234567890123456789012345678901234567123" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "42" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + } + ] + } +] From 0f789d8dc951f7be5b149b71355cc95b5cae2620 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Tue, 24 Jan 2023 16:53:26 +0100 Subject: [PATCH 24/33] First couple of positive tests --- .../remote_state_reads_cparam.scilla.gold | 72 +++---- .../remote_state_reads_cparam.scilla | 18 +- tests/runner/Testcontracts.ml | 3 + .../blockchain_2.json | 1 + .../init_extra_cparam_ipc_output.json | 2 +- .../init_ipc_output.json | 2 +- .../remote_state_reads_cparam/message_1.json | 13 ++ .../remote_state_reads_cparam/message_2.json | 13 ++ .../remote_state_reads_cparam/output_1.json | 87 ++++++++ .../remote_state_reads_cparam/output_2.json | 87 ++++++++ .../remote_state_reads_cparam/state_1.json | 140 +++++++++++++ .../remote_state_reads_cparam/state_2.json | 187 ++++++++++++++++++ 12 files changed, 574 insertions(+), 51 deletions(-) create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_2.json create mode 100644 tests/runner/remote_state_reads_cparam/message_1.json create mode 100644 tests/runner/remote_state_reads_cparam/message_2.json create mode 100644 tests/runner/remote_state_reads_cparam/output_1.json create mode 100644 tests/runner/remote_state_reads_cparam/output_2.json create mode 100644 tests/runner/remote_state_reads_cparam/state_1.json create mode 100644 tests/runner/remote_state_reads_cparam/state_2.json diff --git a/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold b/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold index 43a933236..379e14f77 100644 --- a/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold +++ b/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold @@ -15,9 +15,9 @@ { "field": "remote_reads_test_res_6_2", "tag": "NoInfo" }, { "field": "remote_reads_test_res_7_3", "tag": "(Option NotMoney)" }, { "field": "remote_reads_test_res_7_6", "tag": "(Option NotMoney)" }, - { "field": "remote_read_remote_read_res_1", "tag": "NoInfo" }, - { "field": "remote_read_remote_read_res_2", "tag": "(Option NoInfo)" }, - { "field": "remote_read_remote_read_res_3", "tag": "NoInfo" }, + { "field": "remote_reads_test_res_8", "tag": "NoInfo" }, + { "field": "remote_reads_test_res_9", "tag": "(Option NoInfo)" }, + { "field": "remote_reads_test_res_10", "tag": "NoInfo" }, { "field": "address_type_erasure_test_res_1", "tag": "(Map NoInfo)" } ], "ADT constructors": [] @@ -69,21 +69,13 @@ "type": "Option (Bool)", "depth": 0 }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "depth": 0 }, { - "vname": "remote_read_remote_read_res_1", - "type": "Uint128", - "depth": 0 - }, - { - "vname": "remote_read_remote_read_res_2", + "vname": "remote_reads_test_res_9", "type": "Option (Uint128)", "depth": 0 }, - { - "vname": "remote_read_remote_read_res_3", - "type": "ByStr20", - "depth": 0 - }, + { "vname": "remote_reads_test_res_10", "type": "ByStr20", "depth": 0 }, { "vname": "address_type_erasure_test_res_1", "type": "Map (Uint128) (ByStr20 with end)", @@ -159,7 +151,7 @@ ] }, { - "vname": "RemoteReadsOfRemoteRead", + "vname": "RemoteReadContractParameterTest8", "params": [ { "vname": "remote", @@ -169,7 +161,7 @@ ] }, { - "vname": "RemoteReadsOfRemoteMap", + "vname": "RemoteReadContractParameterTest9", "params": [ { "vname": "remote", @@ -178,7 +170,7 @@ } ] }, - { "vname": "RemoteReadsContractParam", "params": [] }, + { "vname": "RemoteReadContractParameterTest10", "params": [] }, { "vname": "AddressTypeErasureTest1", "params": [] }, { "vname": "AddressTypeErasureTest2", "params": [] } ], @@ -241,6 +233,26 @@ ] }, "warnings": [ + { + "warning_message": "Write only field: remote_reads_test_res_9", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 116, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: remote_reads_test_res_8", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 107, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, { "warning_message": "Write only field: remote_reads_test_res_7_6", "start_location": { @@ -362,17 +374,7 @@ "warning_id": 3 }, { - "warning_message": "Write only field: remote_reads_test_res_1", - "start_location": { - "file": "contracts/remote_state_reads_cparam.scilla", - "line": 37, - "column": 3 - }, - "end_location": { "file": "", "line": 0, "column": 0 }, - "warning_id": 3 - }, - { - "warning_message": "Write only field: remote_read_remote_read_res_3", + "warning_message": "Write only field: remote_reads_test_res_10", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", "line": 121, @@ -382,20 +384,10 @@ "warning_id": 3 }, { - "warning_message": "Write only field: remote_read_remote_read_res_2", - "start_location": { - "file": "contracts/remote_state_reads_cparam.scilla", - "line": 116, - "column": 3 - }, - "end_location": { "file": "", "line": 0, "column": 0 }, - "warning_id": 3 - }, - { - "warning_message": "Write only field: remote_read_remote_read_res_1", + "warning_message": "Write only field: remote_reads_test_res_1", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", - "line": 107, + "line": 37, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, diff --git a/tests/contracts/remote_state_reads_cparam.scilla b/tests/contracts/remote_state_reads_cparam.scilla index 8a2cd3375..4e5c58684 100644 --- a/tests/contracts/remote_state_reads_cparam.scilla +++ b/tests/contracts/remote_state_reads_cparam.scilla @@ -23,9 +23,9 @@ field remote_reads_test_res_6_1 : Uint128 = Uint128 0 (* (x) of remote6 *) field remote_reads_test_res_6_2 : Uint64 = Uint64 0 (* x of remote6 *) field remote_reads_test_res_7_3 : Option Bool = None { Bool } (* (x) = x in remote7 *) field remote_reads_test_res_7_6 : Option Bool = None { Bool } (* (y) = y in remote7 *) -field remote_read_remote_read_res_1 : Uint128 = Uint128 0 (* remote.(admin).(f).(g) *) -field remote_read_remote_read_res_2 : Option Uint128 = None {Uint128} (* remote.(admin).(f).(g)[0] *) -field remote_read_remote_read_res_3 : ByStr20 = _this_address (* cparam1.(admin) *) +field remote_reads_test_res_8 : Uint128 = Uint128 0 (* remote.(admin).(f).(g) *) +field remote_reads_test_res_9 : Option Uint128 = None {Uint128} (* remote.(admin).(f).(g)[0] *) +field remote_reads_test_res_10 : ByStr20 = _this_address (* cparam1.(admin) *) field address_type_erasure_test_res_1 : Map Uint128 (ByStr20 with end) = Emp Uint128 (ByStr20 with end) (* field[0] := cparam1 *) @@ -99,26 +99,26 @@ transition RemoteReadContractParameterTest7( remote_reads_test_res_7_6 := tmp_7_6 end -transition RemoteReadsOfRemoteRead( +transition RemoteReadContractParameterTest8( remote: ByStr20 with contract (admin : ByStr20 with contract (f : ByStr20 with contract (g : Uint128) end) end) end) ad <-& remote.(admin); this_f <-& ad.(f); this_g <-& this_f.(g); - remote_read_remote_read_res_1 := this_g + remote_reads_test_res_8 := this_g end -transition RemoteReadsOfRemoteMap( +transition RemoteReadContractParameterTest9( remote: ByStr20 with contract (admin : ByStr20 with contract (f : ByStr20 with contract (g : Map Uint128 Uint128) end) end) end) ad <-& remote.(admin); this_f <-& ad.(f); remote_key = Uint128 0; this_g <-& this_f.(g)[remote_key]; - remote_read_remote_read_res_2 := this_g + remote_reads_test_res_9 := this_g end -transition RemoteReadsContractParam() +transition RemoteReadContractParameterTest10() ad <-& cparam1.(admin); - remote_read_remote_read_res_3 := ad + remote_reads_test_res_10 := ad end transition AddressTypeErasureTest1() diff --git a/tests/runner/Testcontracts.ml b/tests/runner/Testcontracts.ml index d521df6dc..20fd24e30 100644 --- a/tests/runner/Testcontracts.ml +++ b/tests/runner/Testcontracts.ml @@ -466,6 +466,9 @@ let contract_tests env = "remote_state_reads_cparam" >: build_contract_init_test env succ_code "remote_state_reads_cparam" "init_extra_cparam" ~is_library:false ~ipc_mode:true; + "remote_state_reads_cparam" + >::: build_contract_tests ~pplit:false env "remote_state_reads_cparam" + succ_code 1 2 []; "address_eq_test" >::: build_contract_tests ~pplit:false env "address_eq_test" succ_code 1 11 []; diff --git a/tests/runner/remote_state_reads_cparam/blockchain_2.json b/tests/runner/remote_state_reads_cparam/blockchain_2.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_2.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json b/tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json index e4bf0acfd..66e4c7611 100644 --- a/tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json +++ b/tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json @@ -1,6 +1,6 @@ { "scilla_major_version": "0", - "gas_remaining": "58573", + "gas_remaining": "58579", "_accepted": "false", "messages": null, "states": [ diff --git a/tests/runner/remote_state_reads_cparam/init_ipc_output.json b/tests/runner/remote_state_reads_cparam/init_ipc_output.json index e4bf0acfd..66e4c7611 100644 --- a/tests/runner/remote_state_reads_cparam/init_ipc_output.json +++ b/tests/runner/remote_state_reads_cparam/init_ipc_output.json @@ -1,6 +1,6 @@ { "scilla_major_version": "0", - "gas_remaining": "58573", + "gas_remaining": "58579", "_accepted": "false", "messages": null, "states": [ diff --git a/tests/runner/remote_state_reads_cparam/message_1.json b/tests/runner/remote_state_reads_cparam/message_1.json new file mode 100644 index 000000000..697d9d5cd --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_1.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest1", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote1", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_2.json b/tests/runner/remote_state_reads_cparam/message_2.json new file mode 100644 index 000000000..f02ed3638 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_2.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest2", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote2", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/output_1.json b/tests/runner/remote_state_reads_cparam/output_1.json new file mode 100644 index 000000000..a28c73c3b --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_1.json @@ -0,0 +1,87 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7948", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "42" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "Uint64", "value": "0" }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_2.json b/tests/runner/remote_state_reads_cparam/output_2.json new file mode 100644 index 000000000..5ed428072 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_2.json @@ -0,0 +1,87 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7947", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address2", + "argtypes": [], + "arguments": [ "0xabfeccdc9012345678901234567890f777564324" ] + } + }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "Uint64", "value": "0" }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/state_1.json b/tests/runner/remote_state_reads_cparam/state_1.json new file mode 100644 index 000000000..e659d5e38 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_1.json @@ -0,0 +1,140 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { "vname": "x", "type": "Uint128", "value": "42" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_2.json b/tests/runner/remote_state_reads_cparam/state_2.json new file mode 100644 index 000000000..bafdf5b7c --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_2.json @@ -0,0 +1,187 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { + "vname": "x", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address2", + "argtypes": [], + "arguments": [ "0xabfeccdc9012345678901234567890f777564324" ] + } + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [ + { + "vname": "param", + "type": "ByStr20", + "value": "0xabfeccdc9012345678901234567890f777564325" + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" }, + { "vname": "admin", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564326" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [ + { + "vname": "x", + "type": "Uint128", + "value": "100" + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564326", + "cparams": [], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "10" }, + { "vname": "_balance", "type": "Uint128", "value": "64" } + ] + } + ] + } +] From 2c6f275b920cc36c82a15ed1c4971d73a8a51a11 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Thu, 26 Jan 2023 14:58:24 +0100 Subject: [PATCH 25/33] Most of the positive test cases added. Still need a few more, and need negative tests --- src/eval/Ipcmessage_pb.ml | 20 +- .../remote_state_reads_cparam.scilla.gold | 4 +- .../remote_state_reads_cparam.scilla | 4 +- tests/ipc/StateIPCTestServer.ml | 59 +++--- tests/runner/Testcontracts.ml | 2 +- .../blockchain_10.json | 1 + .../blockchain_11.json | 1 + .../blockchain_12.json | 1 + .../blockchain_13.json | 1 + .../blockchain_14.json | 1 + .../blockchain_15.json | 1 + .../blockchain_16.json | 1 + .../blockchain_3.json | 1 + .../blockchain_4.json | 1 + .../blockchain_5.json | 1 + .../blockchain_6.json | 1 + .../blockchain_7.json | 1 + .../blockchain_8.json | 1 + .../blockchain_9.json | 1 + .../init_extra_cparam_ipc_output.json | 2 +- .../init_ipc_output.json | 2 +- .../init_missing_cparam_ipc_output.json | 2 +- .../init_wrong_field_type_ipc_output.json | 2 +- .../remote_state_reads_cparam/message_10.json | 13 ++ .../remote_state_reads_cparam/message_11.json | 13 ++ .../remote_state_reads_cparam/message_12.json | 13 ++ .../remote_state_reads_cparam/message_13.json | 13 ++ .../remote_state_reads_cparam/message_14.json | 7 + .../remote_state_reads_cparam/message_15.json | 7 + .../remote_state_reads_cparam/message_16.json | 7 + .../remote_state_reads_cparam/message_3.json | 13 ++ .../remote_state_reads_cparam/message_4.json | 13 ++ .../remote_state_reads_cparam/message_5.json | 13 ++ .../remote_state_reads_cparam/message_6.json | 13 ++ .../remote_state_reads_cparam/message_7.json | 13 ++ .../remote_state_reads_cparam/message_8.json | 13 ++ .../remote_state_reads_cparam/message_9.json | 13 ++ .../remote_state_reads_cparam/output_1.json | 2 +- .../remote_state_reads_cparam/output_10.json | 91 ++++++++ .../remote_state_reads_cparam/output_11.json | 87 ++++++++ .../remote_state_reads_cparam/output_12.json | 87 ++++++++ .../remote_state_reads_cparam/output_13.json | 87 ++++++++ .../remote_state_reads_cparam/output_14.json | 87 ++++++++ .../remote_state_reads_cparam/output_15.json | 89 ++++++++ .../remote_state_reads_cparam/output_16.json | 89 ++++++++ .../remote_state_reads_cparam/output_2.json | 2 +- .../remote_state_reads_cparam/output_3.json | 95 +++++++++ .../remote_state_reads_cparam/output_4.json | 95 +++++++++ .../remote_state_reads_cparam/output_5.json | 91 ++++++++ .../remote_state_reads_cparam/output_6.json | 102 +++++++++ .../remote_state_reads_cparam/output_7.json | 95 +++++++++ .../remote_state_reads_cparam/output_8.json | 91 ++++++++ .../remote_state_reads_cparam/output_9.json | 91 ++++++++ .../remote_state_reads_cparam/state_1.json | 4 +- .../remote_state_reads_cparam/state_10.json | 143 +++++++++++++ .../remote_state_reads_cparam/state_11.json | 179 ++++++++++++++++ .../remote_state_reads_cparam/state_12.json | 174 ++++++++++++++++ .../remote_state_reads_cparam/state_13.json | 194 ++++++++++++++++++ .../remote_state_reads_cparam/state_14.json | 129 ++++++++++++ .../remote_state_reads_cparam/state_15.json | 129 ++++++++++++ .../remote_state_reads_cparam/state_16.json | 129 ++++++++++++ .../remote_state_reads_cparam/state_2.json | 4 +- .../remote_state_reads_cparam/state_3.json | 152 ++++++++++++++ .../remote_state_reads_cparam/state_4.json | 141 +++++++++++++ .../remote_state_reads_cparam/state_5.json | 144 +++++++++++++ .../remote_state_reads_cparam/state_6.json | 149 ++++++++++++++ .../remote_state_reads_cparam/state_7.json | 141 +++++++++++++ .../remote_state_reads_cparam/state_8.json | 143 +++++++++++++ .../remote_state_reads_cparam/state_9.json | 143 +++++++++++++ 69 files changed, 3609 insertions(+), 45 deletions(-) create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_10.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_11.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_12.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_13.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_14.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_15.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_16.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_3.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_4.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_5.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_6.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_7.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_8.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_9.json create mode 100644 tests/runner/remote_state_reads_cparam/message_10.json create mode 100644 tests/runner/remote_state_reads_cparam/message_11.json create mode 100644 tests/runner/remote_state_reads_cparam/message_12.json create mode 100644 tests/runner/remote_state_reads_cparam/message_13.json create mode 100644 tests/runner/remote_state_reads_cparam/message_14.json create mode 100644 tests/runner/remote_state_reads_cparam/message_15.json create mode 100644 tests/runner/remote_state_reads_cparam/message_16.json create mode 100644 tests/runner/remote_state_reads_cparam/message_3.json create mode 100644 tests/runner/remote_state_reads_cparam/message_4.json create mode 100644 tests/runner/remote_state_reads_cparam/message_5.json create mode 100644 tests/runner/remote_state_reads_cparam/message_6.json create mode 100644 tests/runner/remote_state_reads_cparam/message_7.json create mode 100644 tests/runner/remote_state_reads_cparam/message_8.json create mode 100644 tests/runner/remote_state_reads_cparam/message_9.json create mode 100644 tests/runner/remote_state_reads_cparam/output_10.json create mode 100644 tests/runner/remote_state_reads_cparam/output_11.json create mode 100644 tests/runner/remote_state_reads_cparam/output_12.json create mode 100644 tests/runner/remote_state_reads_cparam/output_13.json create mode 100644 tests/runner/remote_state_reads_cparam/output_14.json create mode 100644 tests/runner/remote_state_reads_cparam/output_15.json create mode 100644 tests/runner/remote_state_reads_cparam/output_16.json create mode 100644 tests/runner/remote_state_reads_cparam/output_3.json create mode 100644 tests/runner/remote_state_reads_cparam/output_4.json create mode 100644 tests/runner/remote_state_reads_cparam/output_5.json create mode 100644 tests/runner/remote_state_reads_cparam/output_6.json create mode 100644 tests/runner/remote_state_reads_cparam/output_7.json create mode 100644 tests/runner/remote_state_reads_cparam/output_8.json create mode 100644 tests/runner/remote_state_reads_cparam/output_9.json create mode 100644 tests/runner/remote_state_reads_cparam/state_10.json create mode 100644 tests/runner/remote_state_reads_cparam/state_11.json create mode 100644 tests/runner/remote_state_reads_cparam/state_12.json create mode 100644 tests/runner/remote_state_reads_cparam/state_13.json create mode 100644 tests/runner/remote_state_reads_cparam/state_14.json create mode 100644 tests/runner/remote_state_reads_cparam/state_15.json create mode 100644 tests/runner/remote_state_reads_cparam/state_16.json create mode 100644 tests/runner/remote_state_reads_cparam/state_3.json create mode 100644 tests/runner/remote_state_reads_cparam/state_4.json create mode 100644 tests/runner/remote_state_reads_cparam/state_5.json create mode 100644 tests/runner/remote_state_reads_cparam/state_6.json create mode 100644 tests/runner/remote_state_reads_cparam/state_7.json create mode 100644 tests/runner/remote_state_reads_cparam/state_8.json create mode 100644 tests/runner/remote_state_reads_cparam/state_9.json diff --git a/src/eval/Ipcmessage_pb.ml b/src/eval/Ipcmessage_pb.ml index 64b783aba..e485943c3 100644 --- a/src/eval/Ipcmessage_pb.ml +++ b/src/eval/Ipcmessage_pb.ml @@ -86,18 +86,22 @@ let rec decode_proto_scilla_query d = | Some (1, pk) -> Pbrt.Decoder.unexpected_payload "Message(proto_scilla_query), field(1)" pk - | Some (2, Pbrt.Varint) -> v.mapdepth <- Pbrt.Decoder.int_as_varint d - | Some (2, pk) -> + | Some (2, Pbrt.Bits32) -> v.is_mutable <- Pbrt.Decoder.bool d + | Some (2, pk) -> Pbrt.Decoder.unexpected_payload "Message(proto_scilla_query), field(2)" pk - | Some (3, Pbrt.Bytes) -> v.indices <- Pbrt.Decoder.bytes d :: v.indices + | Some (3, Pbrt.Varint) -> v.mapdepth <- Pbrt.Decoder.int_as_varint d | Some (3, pk) -> Pbrt.Decoder.unexpected_payload "Message(proto_scilla_query), field(3)" pk - | Some (4, Pbrt.Varint) -> v.ignoreval <- Pbrt.Decoder.bool d + | Some (4, Pbrt.Bytes) -> v.indices <- Pbrt.Decoder.bytes d :: v.indices | Some (4, pk) -> Pbrt.Decoder.unexpected_payload "Message(proto_scilla_query), field(4)" pk + | Some (5, Pbrt.Varint) -> v.ignoreval <- Pbrt.Decoder.bool d + | Some (5, pk) -> + Pbrt.Decoder.unexpected_payload "Message(proto_scilla_query), field(5)" + pk | Some (_, payload_kind) -> Pbrt.Decoder.skip d payload_kind done; ({ @@ -133,11 +137,13 @@ let rec encode_proto_scilla_query (v : Ipcmessage_types.proto_scilla_query) encoder = Pbrt.Encoder.key (1, Pbrt.Bytes) encoder; Pbrt.Encoder.string v.Ipcmessage_types.name encoder; - Pbrt.Encoder.key (2, Pbrt.Varint) encoder; + Pbrt.Encoder.key (2, Pbrt.Bits32) encoder; + Pbrt.Encoder.bool v.Ipcmessage_types.is_mutable encoder; + Pbrt.Encoder.key (3, Pbrt.Varint) encoder; Pbrt.Encoder.int_as_varint v.Ipcmessage_types.mapdepth encoder; List.iter v.Ipcmessage_types.indices ~f:(fun x -> - Pbrt.Encoder.key (3, Pbrt.Bytes) encoder; + Pbrt.Encoder.key (4, Pbrt.Bytes) encoder; Pbrt.Encoder.bytes x encoder); - Pbrt.Encoder.key (4, Pbrt.Varint) encoder; + Pbrt.Encoder.key (5, Pbrt.Varint) encoder; Pbrt.Encoder.bool v.Ipcmessage_types.ignoreval encoder; () diff --git a/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold b/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold index 379e14f77..b7410772c 100644 --- a/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold +++ b/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold @@ -58,7 +58,7 @@ "depth": 0 }, { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "depth": 0 }, - { "vname": "remote_reads_test_res_6_2", "type": "Uint64", "depth": 0 }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "depth": 0 }, { "vname": "remote_reads_test_res_7_3", "type": "Option (Bool)", @@ -136,7 +136,7 @@ { "vname": "remote6", "type": - "ByStr20 with contract (x : Uint128) field x : Uint64 end" + "ByStr20 with contract (x : Uint128) field x : String end" } ] }, diff --git a/tests/contracts/remote_state_reads_cparam.scilla b/tests/contracts/remote_state_reads_cparam.scilla index 4e5c58684..9d982c465 100644 --- a/tests/contracts/remote_state_reads_cparam.scilla +++ b/tests/contracts/remote_state_reads_cparam.scilla @@ -20,7 +20,7 @@ field remote_reads_test_res_5_1 : Map Uint128 Bool = Emp Uint128 Bool (* (x) of field remote_reads_test_res_5_3 : Option Bool = None { Bool } (* exists (x)[0] of remote5 *) field remote_reads_test_res_5_5 : Option (Option Bool) = None { (Option Bool) } (* (x)[0] of remote5 *) field remote_reads_test_res_6_1 : Uint128 = Uint128 0 (* (x) of remote6 *) -field remote_reads_test_res_6_2 : Uint64 = Uint64 0 (* x of remote6 *) +field remote_reads_test_res_6_2 : String = "" (* x of remote6 *) field remote_reads_test_res_7_3 : Option Bool = None { Bool } (* (x) = x in remote7 *) field remote_reads_test_res_7_6 : Option Bool = None { Bool } (* (y) = y in remote7 *) field remote_reads_test_res_8 : Uint128 = Uint128 0 (* remote.(admin).(f).(g) *) @@ -78,7 +78,7 @@ transition RemoteReadContractParameterTest5( end transition RemoteReadContractParameterTest6( - remote6: ByStr20 with contract (x : Uint128) field x : Uint64 end + remote6: ByStr20 with contract (x : Uint128) field x : String end ) tmp_6_1 <-& remote6.(x); remote_reads_test_res_6_1 := tmp_6_1; diff --git a/tests/ipc/StateIPCTestServer.ml b/tests/ipc/StateIPCTestServer.ml index 7d9275487..7f260c22c 100644 --- a/tests/ipc/StateIPCTestServer.ml +++ b/tests/ipc/StateIPCTestServer.ml @@ -30,10 +30,11 @@ open StateIPCIdl open IPCUtil module Hashtbl = Caml.Hashtbl -type value_table = (string, value_type) Hashtbl.t -and value_type = NonMapVal of string | MapVal of value_table +type map_value_table = (string, value_type) Hashtbl.t +and value_type = NonMapVal of string | MapVal of map_value_table -type type_table = (string, string) Hashtbl.t +type value_table = (string * bool, value_type) Hashtbl.t +type type_table = (string * bool, string) Hashtbl.t (* State of the full blockchain, i.e., for all addresses. * None indicates *this* address and Some indicates "external state". @@ -130,18 +131,19 @@ module MakeServer () = struct match contr_state with | Some (vt, tt, _bcinfo) -> ( let query = decode_serialized_query query in - let t = Hashtbl.find_opt tt query.name in match query with - | { name; indices; ignoreval; _ } -> ( - let string_indices_list = - name :: List.map indices ~f:Bytes.to_string - in - let%bind vopt = recurser (MapVal vt) string_indices_list in - match vopt with - | Some v -> - if ignoreval then pure @@ (true, "", t) - else - pure @@ (true, encode_serialized_value (serialize_value v), t) + | { name; is_mutable; indices; ignoreval; _ } -> ( + let t = Hashtbl.find_opt tt (name, is_mutable) in + let string_indices_list = List.map indices ~f:Bytes.to_string in + match Hashtbl.find_opt vt (name, is_mutable) with + | Some mvt -> ( + let%bind vopt = recurser mvt string_indices_list in + match vopt with + | Some v -> + if ignoreval then pure @@ (true, "", t) + else + pure @@ (true, encode_serialized_value (serialize_value v), t) + | None -> pure @@ (false, "", t)) | None -> pure @@ (false, "", t))) | None -> pure (false, "", None) @@ -175,7 +177,7 @@ module MakeServer () = struct let query = decode_serialized_query query in let vt, tt, _bcinfo = match Hashtbl.find_opt table addr_opt with - | Some (vt, tt, bcinfo) -> (vt, tt, bcinfo) + | Some (tvt, tt, bcinfo) -> (tvt, tt, bcinfo) | None -> let vt, tt, bcinfo = (Hashtbl.create 8, Hashtbl.create 8, Hashtbl.create 1) @@ -186,19 +188,30 @@ module MakeServer () = struct (* Update type if provided *) let () = match ty_opt with - | Some ty -> Hashtbl.replace tt query.name ty + | Some ty -> Hashtbl.replace tt (query.name, query.is_mutable) ty | None -> () in (* Update value *) match query with - | { name; indices; ignoreval; _ } -> ( + | { name; is_mutable; indices; ignoreval; _ } -> let string_indices_list = List.map indices ~f:Bytes.to_string in - match ignoreval with - | true -> recurser_update vt (name :: string_indices_list) - | false -> - let new_val = deserialize_value (decode_serialized_value value) in - recurser_update ~new_val:(Some new_val) vt - (name :: string_indices_list)) + if ignoreval then + if List.is_empty string_indices_list then + pure @@ Hashtbl.remove vt (name, is_mutable) + else + match Hashtbl.find_opt vt (name, is_mutable) with + | Some (MapVal m) -> recurser_update m string_indices_list + | Some (NonMapVal _) -> fail RPCError.{ code = 0; message = update_message } + | None -> pure () + else + let new_val = deserialize_value (decode_serialized_value value) in + if List.is_empty string_indices_list then + pure @@ Hashtbl.replace vt (name, is_mutable) new_val + else + match Hashtbl.find_opt vt (name, is_mutable) with + | Some (MapVal m) -> recurser_update ~new_val:(Some new_val) m string_indices_list + | Some (NonMapVal _) + | None -> fail RPCError.{ code = 0; message = update_message } let fetch_state_value query = let%bind f, v, _t = fetch_state_value_helper None query in diff --git a/tests/runner/Testcontracts.ml b/tests/runner/Testcontracts.ml index 20fd24e30..8db6efe0c 100644 --- a/tests/runner/Testcontracts.ml +++ b/tests/runner/Testcontracts.ml @@ -468,7 +468,7 @@ let contract_tests env = "init_extra_cparam" ~is_library:false ~ipc_mode:true; "remote_state_reads_cparam" >::: build_contract_tests ~pplit:false env "remote_state_reads_cparam" - succ_code 1 2 []; + succ_code 1 16 []; "address_eq_test" >::: build_contract_tests ~pplit:false env "address_eq_test" succ_code 1 11 []; diff --git a/tests/runner/remote_state_reads_cparam/blockchain_10.json b/tests/runner/remote_state_reads_cparam/blockchain_10.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_10.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_11.json b/tests/runner/remote_state_reads_cparam/blockchain_11.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_11.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_12.json b/tests/runner/remote_state_reads_cparam/blockchain_12.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_12.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_13.json b/tests/runner/remote_state_reads_cparam/blockchain_13.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_13.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_14.json b/tests/runner/remote_state_reads_cparam/blockchain_14.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_14.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_15.json b/tests/runner/remote_state_reads_cparam/blockchain_15.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_15.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_16.json b/tests/runner/remote_state_reads_cparam/blockchain_16.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_16.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_3.json b/tests/runner/remote_state_reads_cparam/blockchain_3.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_3.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_4.json b/tests/runner/remote_state_reads_cparam/blockchain_4.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_4.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_5.json b/tests/runner/remote_state_reads_cparam/blockchain_5.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_5.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_6.json b/tests/runner/remote_state_reads_cparam/blockchain_6.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_6.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_7.json b/tests/runner/remote_state_reads_cparam/blockchain_7.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_7.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_8.json b/tests/runner/remote_state_reads_cparam/blockchain_8.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_8.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_9.json b/tests/runner/remote_state_reads_cparam/blockchain_9.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_9.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json b/tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json index 66e4c7611..1a219722d 100644 --- a/tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json +++ b/tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json @@ -1,6 +1,6 @@ { "scilla_major_version": "0", - "gas_remaining": "58579", + "gas_remaining": "58585", "_accepted": "false", "messages": null, "states": [ diff --git a/tests/runner/remote_state_reads_cparam/init_ipc_output.json b/tests/runner/remote_state_reads_cparam/init_ipc_output.json index 66e4c7611..1a219722d 100644 --- a/tests/runner/remote_state_reads_cparam/init_ipc_output.json +++ b/tests/runner/remote_state_reads_cparam/init_ipc_output.json @@ -1,6 +1,6 @@ { "scilla_major_version": "0", - "gas_remaining": "58579", + "gas_remaining": "58585", "_accepted": "false", "messages": null, "states": [ diff --git a/tests/runner/remote_state_reads_cparam/init_missing_cparam_ipc_output.json b/tests/runner/remote_state_reads_cparam/init_missing_cparam_ipc_output.json index 5ea745028..064907f05 100644 --- a/tests/runner/remote_state_reads_cparam/init_missing_cparam_ipc_output.json +++ b/tests/runner/remote_state_reads_cparam/init_missing_cparam_ipc_output.json @@ -1,5 +1,5 @@ { - "gas_remaining": "7321", + "gas_remaining": "7322", "errors": [ { "error_message": diff --git a/tests/runner/remote_state_reads_cparam/init_wrong_field_type_ipc_output.json b/tests/runner/remote_state_reads_cparam/init_wrong_field_type_ipc_output.json index 5ea745028..064907f05 100644 --- a/tests/runner/remote_state_reads_cparam/init_wrong_field_type_ipc_output.json +++ b/tests/runner/remote_state_reads_cparam/init_wrong_field_type_ipc_output.json @@ -1,5 +1,5 @@ { - "gas_remaining": "7321", + "gas_remaining": "7322", "errors": [ { "error_message": diff --git a/tests/runner/remote_state_reads_cparam/message_10.json b/tests/runner/remote_state_reads_cparam/message_10.json new file mode 100644 index 000000000..4421b0fe1 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_10.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest7", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote7", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_11.json b/tests/runner/remote_state_reads_cparam/message_11.json new file mode 100644 index 000000000..5861ec618 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_11.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest9", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_12.json b/tests/runner/remote_state_reads_cparam/message_12.json new file mode 100644 index 000000000..5861ec618 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_12.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest9", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_13.json b/tests/runner/remote_state_reads_cparam/message_13.json new file mode 100644 index 000000000..5861ec618 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_13.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest9", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_14.json b/tests/runner/remote_state_reads_cparam/message_14.json new file mode 100644 index 000000000..f25912b3d --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_14.json @@ -0,0 +1,7 @@ +{ + "_tag": "RemoteReadContractParameterTest10", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_15.json b/tests/runner/remote_state_reads_cparam/message_15.json new file mode 100644 index 000000000..99486aa3a --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_15.json @@ -0,0 +1,7 @@ +{ + "_tag": "AddressTypeErasureTest1", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_16.json b/tests/runner/remote_state_reads_cparam/message_16.json new file mode 100644 index 000000000..a5fe86d25 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_16.json @@ -0,0 +1,7 @@ +{ + "_tag": "AddressTypeErasureTest2", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_3.json b/tests/runner/remote_state_reads_cparam/message_3.json new file mode 100644 index 000000000..a92f9a04e --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_3.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest3", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote3", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_4.json b/tests/runner/remote_state_reads_cparam/message_4.json new file mode 100644 index 000000000..a47aff9ad --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_4.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest4", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote4", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_5.json b/tests/runner/remote_state_reads_cparam/message_5.json new file mode 100644 index 000000000..685882ad3 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_5.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest5", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote5", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_6.json b/tests/runner/remote_state_reads_cparam/message_6.json new file mode 100644 index 000000000..685882ad3 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_6.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest5", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote5", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_7.json b/tests/runner/remote_state_reads_cparam/message_7.json new file mode 100644 index 000000000..0437f84c3 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_7.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest6", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote6", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_8.json b/tests/runner/remote_state_reads_cparam/message_8.json new file mode 100644 index 000000000..4421b0fe1 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_8.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest7", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote7", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_9.json b/tests/runner/remote_state_reads_cparam/message_9.json new file mode 100644 index 000000000..4421b0fe1 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_9.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest7", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote7", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/output_1.json b/tests/runner/remote_state_reads_cparam/output_1.json index a28c73c3b..30f90b580 100644 --- a/tests/runner/remote_state_reads_cparam/output_1.json +++ b/tests/runner/remote_state_reads_cparam/output_1.json @@ -43,7 +43,7 @@ } }, { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, - { "vname": "remote_reads_test_res_6_2", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, { "vname": "remote_reads_test_res_7_3", "type": "Option (Bool)", diff --git a/tests/runner/remote_state_reads_cparam/output_10.json b/tests/runner/remote_state_reads_cparam/output_10.json new file mode 100644 index 000000000..cc37842e6 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_10.json @@ -0,0 +1,91 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7944", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "Some", + "argtypes": [ "Bool" ], + "arguments": [ + { "constructor": "True", "argtypes": [], "arguments": [] } + ] + } + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "Some", + "argtypes": [ "Bool" ], + "arguments": [ + { "constructor": "False", "argtypes": [], "arguments": [] } + ] + } + }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_11.json b/tests/runner/remote_state_reads_cparam/output_11.json new file mode 100644 index 000000000..ab922e6b2 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_11.json @@ -0,0 +1,87 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7943", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "Some", + "argtypes": [ "Uint128" ], + "arguments": [ "1982" ] + } + }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_12.json b/tests/runner/remote_state_reads_cparam/output_12.json new file mode 100644 index 000000000..24579a69e --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_12.json @@ -0,0 +1,87 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7947", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_13.json b/tests/runner/remote_state_reads_cparam/output_13.json new file mode 100644 index 000000000..ab922e6b2 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_13.json @@ -0,0 +1,87 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7943", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "Some", + "argtypes": [ "Uint128" ], + "arguments": [ "1982" ] + } + }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_14.json b/tests/runner/remote_state_reads_cparam/output_14.json new file mode 100644 index 000000000..dbf538f8e --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_14.json @@ -0,0 +1,87 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7967", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x1234567890123456789012345678901234567891" + }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_15.json b/tests/runner/remote_state_reads_cparam/output_15.json new file mode 100644 index 000000000..f96a72816 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_15.json @@ -0,0 +1,89 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7971", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [ + { "key": "0", "val": "0x1234567890123456789012345678901234567890" } + ] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_16.json b/tests/runner/remote_state_reads_cparam/output_16.json new file mode 100644 index 000000000..196651ab7 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_16.json @@ -0,0 +1,89 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7969", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [ + { "key": "0", "val": "0x1234567890123456789012345678901234567890" } + ] + }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_2.json b/tests/runner/remote_state_reads_cparam/output_2.json index 5ed428072..44e936610 100644 --- a/tests/runner/remote_state_reads_cparam/output_2.json +++ b/tests/runner/remote_state_reads_cparam/output_2.json @@ -43,7 +43,7 @@ } }, { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, - { "vname": "remote_reads_test_res_6_2", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, { "vname": "remote_reads_test_res_7_3", "type": "Option (Bool)", diff --git a/tests/runner/remote_state_reads_cparam/output_3.json b/tests/runner/remote_state_reads_cparam/output_3.json new file mode 100644 index 000000000..0db5ea89c --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_3.json @@ -0,0 +1,95 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7944", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "381" + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "523" + }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_4.json b/tests/runner/remote_state_reads_cparam/output_4.json new file mode 100644 index 000000000..f4b590146 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_4.json @@ -0,0 +1,95 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7943", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "dnineopro" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "4819" + }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_5.json b/tests/runner/remote_state_reads_cparam/output_5.json new file mode 100644 index 000000000..be9887e99 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_5.json @@ -0,0 +1,91 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7951", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "Some", + "argtypes": [ "Option (Bool)" ], + "arguments": [ + { "constructor": "None", "argtypes": [ "Bool" ], "arguments": [] } + ] + } + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "Some", + "argtypes": [ "Bool" ], + "arguments": [ + { "constructor": "False", "argtypes": [], "arguments": [] } + ] + } + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_6.json b/tests/runner/remote_state_reads_cparam/output_6.json new file mode 100644 index 000000000..38b8db618 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_6.json @@ -0,0 +1,102 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7947", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "Some", + "argtypes": [ "Option (Bool)" ], + "arguments": [ + { + "constructor": "Some", + "argtypes": [ "Bool" ], + "arguments": [ + { "constructor": "True", "argtypes": [], "arguments": [] } + ] + } + ] + } + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "Some", + "argtypes": [ "Bool" ], + "arguments": [ + { "constructor": "True", "argtypes": [], "arguments": [] } + ] + } + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [ + { + "key": "0", + "val": { "constructor": "True", "argtypes": [], "arguments": [] } + } + ] + }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_7.json b/tests/runner/remote_state_reads_cparam/output_7.json new file mode 100644 index 000000000..17af5146a --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_7.json @@ -0,0 +1,95 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7943", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "Incongruentially" + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "2801" + }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_8.json b/tests/runner/remote_state_reads_cparam/output_8.json new file mode 100644 index 000000000..6c00992d4 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_8.json @@ -0,0 +1,91 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7944", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "Some", + "argtypes": [ "Bool" ], + "arguments": [ + { "constructor": "False", "argtypes": [], "arguments": [] } + ] + } + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "Some", + "argtypes": [ "Bool" ], + "arguments": [ + { "constructor": "False", "argtypes": [], "arguments": [] } + ] + } + }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_9.json b/tests/runner/remote_state_reads_cparam/output_9.json new file mode 100644 index 000000000..89ca48a69 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_9.json @@ -0,0 +1,91 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7944", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "Some", + "argtypes": [ "Bool" ], + "arguments": [ + { "constructor": "False", "argtypes": [], "arguments": [] } + ] + } + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "Some", + "argtypes": [ "Bool" ], + "arguments": [ + { "constructor": "True", "argtypes": [], "arguments": [] } + ] + } + }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/state_1.json b/tests/runner/remote_state_reads_cparam/state_1.json index e659d5e38..6cd4f3861 100644 --- a/tests/runner/remote_state_reads_cparam/state_1.json +++ b/tests/runner/remote_state_reads_cparam/state_1.json @@ -64,8 +64,8 @@ }, { "vname": "remote_reads_test_res_6_2", - "type": "Uint64", - "value": "0" + "type": "String", + "value": "" }, { "vname": "remote_reads_test_res_7_3", diff --git a/tests/runner/remote_state_reads_cparam/state_10.json b/tests/runner/remote_state_reads_cparam/state_10.json new file mode 100644 index 000000000..5bc54a1a1 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_10.json @@ -0,0 +1,143 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { "vname": "x", "type": "Uint128", "value": "2801" }, + { "vname": "y", "type": "Uint64", "value": "1" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, + { "vname": "x", "type": "Uint128", "value": "54" }, + { "vname": "y", "type": "Uint64", "value": "1" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_11.json b/tests/runner/remote_state_reads_cparam/state_11.json new file mode 100644 index 000000000..83d3deb9c --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_11.json @@ -0,0 +1,179 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { + "vname": "admin", + "type": "ByStr20 with contract (f : ByStr20 with contract (g : Map Uint128 Uint128) end) end", + "value": "0xabfeccdc9012345678901234567890f777564324" + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [ + { + "vname": "f", + "type": "ByStr20 with contract (g : Map Uint128 Uint128) end", + "value": "0xabfeccdc9012345678901234567890f777564325" + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [ + { + "vname": "g", + "type": "Map Uint128 Uint128", + "value": [ + { + "key" : "0", + "val" : "1982" + } + ] + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564325" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_12.json b/tests/runner/remote_state_reads_cparam/state_12.json new file mode 100644 index 000000000..450395989 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_12.json @@ -0,0 +1,174 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { + "vname": "admin", + "type": "ByStr20 with contract (f : ByStr20 with contract (g : Map Uint128 Uint128) end) end", + "value": "0xabfeccdc9012345678901234567890f777564324" + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [ + { + "vname": "f", + "type": "ByStr20 with contract (g : Map Uint128 Uint128) end", + "value": "0xabfeccdc9012345678901234567890f777564325" + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [ + { + "vname": "g", + "type": "Map Uint128 Uint128", + "value": [] + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564325" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_13.json b/tests/runner/remote_state_reads_cparam/state_13.json new file mode 100644 index 000000000..42d0db3a3 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_13.json @@ -0,0 +1,194 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { + "vname": "admin", + "type": "ByStr20 with contract (f : ByStr20 with contract (g : Map Uint128 Uint128) end) end", + "value": "0xabfeccdc9012345678901234567890f777564324" + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [ + { + "vname": "f", + "type": "ByStr20 with contract (g : Map Uint128 Uint128) end", + "value": "0xabfeccdc9012345678901234567890f777564325" + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [ + { + "vname": "g1", + "type": "Map Uint128 Uint128", + "value": [ + { + "key" : "0", + "val" : "193282" + } + ] + }, + { + "vname": "f", + "type": "Uint128", + "value": "34" + }, + { + "vname": "g", + "type": "Map Uint128 Uint128", + "value": [ + { + "key" : "0", + "val" : "1982" + } + ] + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564325" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_14.json b/tests/runner/remote_state_reads_cparam/state_14.json new file mode 100644 index 000000000..fee1bc9b3 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_14.json @@ -0,0 +1,129 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_15.json b/tests/runner/remote_state_reads_cparam/state_15.json new file mode 100644 index 000000000..fee1bc9b3 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_15.json @@ -0,0 +1,129 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_16.json b/tests/runner/remote_state_reads_cparam/state_16.json new file mode 100644 index 000000000..fee1bc9b3 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_16.json @@ -0,0 +1,129 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_2.json b/tests/runner/remote_state_reads_cparam/state_2.json index bafdf5b7c..9434df82e 100644 --- a/tests/runner/remote_state_reads_cparam/state_2.json +++ b/tests/runner/remote_state_reads_cparam/state_2.json @@ -64,8 +64,8 @@ }, { "vname": "remote_reads_test_res_6_2", - "type": "Uint64", - "value": "0" + "type": "String", + "value": "" }, { "vname": "remote_reads_test_res_7_3", diff --git a/tests/runner/remote_state_reads_cparam/state_3.json b/tests/runner/remote_state_reads_cparam/state_3.json new file mode 100644 index 000000000..175ad957a --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_3.json @@ -0,0 +1,152 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { "vname": "x", "type": "ByStr20 with contract (x : Uint128) field y : Uint64 end", "value": "0xabfeccdc9012345678901234567890f777564324" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [ + { "vname": "x", "type": "Uint128", "value": "523" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" }, + { "vname": "y", "type": "Uint64", "value": "381" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_4.json b/tests/runner/remote_state_reads_cparam/state_4.json new file mode 100644 index 000000000..72f069485 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_4.json @@ -0,0 +1,141 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { "vname": "x", "type": "Uint128", "value": "4819" }, + { "vname": "y", "type": "String", "value": "dnineopro" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_5.json b/tests/runner/remote_state_reads_cparam/state_5.json new file mode 100644 index 000000000..dcc132453 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_5.json @@ -0,0 +1,144 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { + "vname": "x", + "type": "Map Uint128 Bool", + "value": [] + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_6.json b/tests/runner/remote_state_reads_cparam/state_6.json new file mode 100644 index 000000000..b465bc54f --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_6.json @@ -0,0 +1,149 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { + "vname": "x", + "type": "Map Uint128 Bool", + "value": [ + { + "key": "0", + "val": { "constructor": "True", "argtypes": [], "arguments": [] } + } + ] + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_7.json b/tests/runner/remote_state_reads_cparam/state_7.json new file mode 100644 index 000000000..26111af9d --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_7.json @@ -0,0 +1,141 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { "vname": "x", "type": "Uint128", "value": "2801" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, + { "vname": "x", "type": "String", "value": "Incongruentially" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_8.json b/tests/runner/remote_state_reads_cparam/state_8.json new file mode 100644 index 000000000..c6b3a2ad5 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_8.json @@ -0,0 +1,143 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { "vname": "x", "type": "Uint128", "value": "2801" }, + { "vname": "y", "type": "Uint64", "value": "1" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, + { "vname": "x", "type": "Uint128", "value": "54" }, + { "vname": "y", "type": "Uint64", "value": "1234" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_9.json b/tests/runner/remote_state_reads_cparam/state_9.json new file mode 100644 index 000000000..8d9857c02 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_9.json @@ -0,0 +1,143 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { "vname": "x", "type": "Uint128", "value": "2801" }, + { "vname": "y", "type": "Uint64", "value": "1" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, + { "vname": "x", "type": "Uint128", "value": "2801" }, + { "vname": "y", "type": "Uint64", "value": "1234" } + ] + } + ] + } +] From be1cc480cdb8d313c8ca23c12317eb914eaaedb9 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Fri, 27 Jan 2023 09:29:56 +0100 Subject: [PATCH 26/33] Remaining test cases --- .../remote_state_reads_cparam.scilla.gold | 22 ++- .../remote_state_reads_cparam.scilla | 5 + tests/runner/Testcontracts.ml | 5 +- .../blockchain_100.json | 1 + .../blockchain_101.json | 1 + .../blockchain_102.json | 1 + .../blockchain_103.json | 1 + .../blockchain_17.json | 1 + .../blockchain_18.json | 1 + .../init_extra_cparam_ipc_output.json | 2 +- .../init_ipc_output.json | 2 +- .../init_missing_cparam_ipc_output.json | 2 +- .../init_wrong_field_type_ipc_output.json | 2 +- .../message_100.json | 13 ++ .../message_101.json | 13 ++ .../message_102.json | 13 ++ .../message_103.json | 13 ++ .../remote_state_reads_cparam/message_17.json | 13 ++ .../remote_state_reads_cparam/message_18.json | 13 ++ .../remote_state_reads_cparam/output_100.json | 12 ++ .../remote_state_reads_cparam/output_101.json | 12 ++ .../remote_state_reads_cparam/output_102.json | 12 ++ .../remote_state_reads_cparam/output_103.json | 12 ++ .../remote_state_reads_cparam/output_17.json | 87 +++++++++ .../remote_state_reads_cparam/output_18.json | 87 +++++++++ .../remote_state_reads_cparam/state_100.json | 142 ++++++++++++++ .../remote_state_reads_cparam/state_101.json | 143 ++++++++++++++ .../remote_state_reads_cparam/state_102.json | 179 +++++++++++++++++ .../remote_state_reads_cparam/state_103.json | 179 +++++++++++++++++ .../remote_state_reads_cparam/state_17.json | 142 ++++++++++++++ .../remote_state_reads_cparam/state_18.json | 184 ++++++++++++++++++ 31 files changed, 1309 insertions(+), 6 deletions(-) create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_100.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_101.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_102.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_103.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_17.json create mode 100644 tests/runner/remote_state_reads_cparam/blockchain_18.json create mode 100644 tests/runner/remote_state_reads_cparam/message_100.json create mode 100644 tests/runner/remote_state_reads_cparam/message_101.json create mode 100644 tests/runner/remote_state_reads_cparam/message_102.json create mode 100644 tests/runner/remote_state_reads_cparam/message_103.json create mode 100644 tests/runner/remote_state_reads_cparam/message_17.json create mode 100644 tests/runner/remote_state_reads_cparam/message_18.json create mode 100644 tests/runner/remote_state_reads_cparam/output_100.json create mode 100644 tests/runner/remote_state_reads_cparam/output_101.json create mode 100644 tests/runner/remote_state_reads_cparam/output_102.json create mode 100644 tests/runner/remote_state_reads_cparam/output_103.json create mode 100644 tests/runner/remote_state_reads_cparam/output_17.json create mode 100644 tests/runner/remote_state_reads_cparam/output_18.json create mode 100644 tests/runner/remote_state_reads_cparam/state_100.json create mode 100644 tests/runner/remote_state_reads_cparam/state_101.json create mode 100644 tests/runner/remote_state_reads_cparam/state_102.json create mode 100644 tests/runner/remote_state_reads_cparam/state_103.json create mode 100644 tests/runner/remote_state_reads_cparam/state_17.json create mode 100644 tests/runner/remote_state_reads_cparam/state_18.json diff --git a/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold b/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold index b7410772c..9668d0946 100644 --- a/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold +++ b/tests/checker/good/gold/remote_state_reads_cparam.scilla.gold @@ -171,6 +171,16 @@ ] }, { "vname": "RemoteReadContractParameterTest10", "params": [] }, + { + "vname": "RemoteReadContractParameterTest11", + "params": [ + { + "vname": "remote", + "type": + "ByStr20 with contract (x : Uint128) field y : String end" + } + ] + }, { "vname": "AddressTypeErasureTest1", "params": [] }, { "vname": "AddressTypeErasureTest2", "params": [] } ], @@ -403,11 +413,21 @@ "end_location": { "file": "", "line": 0, "column": 0 }, "warning_id": 3 }, + { + "warning_message": "Unused transition parameter: remote", + "start_location": { + "file": "contracts/remote_state_reads_cparam.scilla", + "line": 125, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, { "warning_message": "Consider using in-place Map access", "start_location": { "file": "contracts/remote_state_reads_cparam.scilla", - "line": 131, + "line": 136, "column": 14 }, "end_location": { "file": "", "line": 0, "column": 0 }, diff --git a/tests/contracts/remote_state_reads_cparam.scilla b/tests/contracts/remote_state_reads_cparam.scilla index 9d982c465..afd12eb2b 100644 --- a/tests/contracts/remote_state_reads_cparam.scilla +++ b/tests/contracts/remote_state_reads_cparam.scilla @@ -121,6 +121,11 @@ transition RemoteReadContractParameterTest10() remote_reads_test_res_10 := ad end +transition RemoteReadContractParameterTest11( + remote: ByStr20 with contract (x : Uint128) field y : String end + ) +end + transition AddressTypeErasureTest1() zero = Uint128 0; address_type_erasure_test_res_1[zero] := cparam1 diff --git a/tests/runner/Testcontracts.ml b/tests/runner/Testcontracts.ml index 8db6efe0c..70186162b 100644 --- a/tests/runner/Testcontracts.ml +++ b/tests/runner/Testcontracts.ml @@ -468,7 +468,7 @@ let contract_tests env = "init_extra_cparam" ~is_library:false ~ipc_mode:true; "remote_state_reads_cparam" >::: build_contract_tests ~pplit:false env "remote_state_reads_cparam" - succ_code 1 16 []; + succ_code 1 18 []; "address_eq_test" >::: build_contract_tests ~pplit:false env "address_eq_test" succ_code 1 11 []; @@ -586,6 +586,9 @@ let contract_tests env = "remote_state_reads_cparam" >: build_contract_init_test env fail_code "remote_state_reads_cparam" "init_wrong_field_type" ~is_library:false ~ipc_mode:true; + "remote_state_reads_cparam" + >::: build_contract_tests env "remote_state_reads_cparam" + fail_code 100 103 []; "map_as_cparam" >: build_contract_init_test env fail_code "map_as_cparam" "init_illegal_key" ~is_library:false ~ipc_mode:true; diff --git a/tests/runner/remote_state_reads_cparam/blockchain_100.json b/tests/runner/remote_state_reads_cparam/blockchain_100.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_100.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_101.json b/tests/runner/remote_state_reads_cparam/blockchain_101.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_101.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_102.json b/tests/runner/remote_state_reads_cparam/blockchain_102.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_102.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_103.json b/tests/runner/remote_state_reads_cparam/blockchain_103.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_103.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_17.json b/tests/runner/remote_state_reads_cparam/blockchain_17.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_17.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/blockchain_18.json b/tests/runner/remote_state_reads_cparam/blockchain_18.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/blockchain_18.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json b/tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json index 1a219722d..cf5e138ed 100644 --- a/tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json +++ b/tests/runner/remote_state_reads_cparam/init_extra_cparam_ipc_output.json @@ -1,6 +1,6 @@ { "scilla_major_version": "0", - "gas_remaining": "58585", + "gas_remaining": "58463", "_accepted": "false", "messages": null, "states": [ diff --git a/tests/runner/remote_state_reads_cparam/init_ipc_output.json b/tests/runner/remote_state_reads_cparam/init_ipc_output.json index 1a219722d..cf5e138ed 100644 --- a/tests/runner/remote_state_reads_cparam/init_ipc_output.json +++ b/tests/runner/remote_state_reads_cparam/init_ipc_output.json @@ -1,6 +1,6 @@ { "scilla_major_version": "0", - "gas_remaining": "58585", + "gas_remaining": "58463", "_accepted": "false", "messages": null, "states": [ diff --git a/tests/runner/remote_state_reads_cparam/init_missing_cparam_ipc_output.json b/tests/runner/remote_state_reads_cparam/init_missing_cparam_ipc_output.json index 064907f05..ae03962bb 100644 --- a/tests/runner/remote_state_reads_cparam/init_missing_cparam_ipc_output.json +++ b/tests/runner/remote_state_reads_cparam/init_missing_cparam_ipc_output.json @@ -1,5 +1,5 @@ { - "gas_remaining": "7322", + "gas_remaining": "7307", "errors": [ { "error_message": diff --git a/tests/runner/remote_state_reads_cparam/init_wrong_field_type_ipc_output.json b/tests/runner/remote_state_reads_cparam/init_wrong_field_type_ipc_output.json index 064907f05..ae03962bb 100644 --- a/tests/runner/remote_state_reads_cparam/init_wrong_field_type_ipc_output.json +++ b/tests/runner/remote_state_reads_cparam/init_wrong_field_type_ipc_output.json @@ -1,5 +1,5 @@ { - "gas_remaining": "7322", + "gas_remaining": "7307", "errors": [ { "error_message": diff --git a/tests/runner/remote_state_reads_cparam/message_100.json b/tests/runner/remote_state_reads_cparam/message_100.json new file mode 100644 index 000000000..4421b0fe1 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_100.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest7", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote7", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_101.json b/tests/runner/remote_state_reads_cparam/message_101.json new file mode 100644 index 000000000..0437f84c3 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_101.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest6", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote6", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_102.json b/tests/runner/remote_state_reads_cparam/message_102.json new file mode 100644 index 000000000..89d7945b5 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_102.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest8", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_103.json b/tests/runner/remote_state_reads_cparam/message_103.json new file mode 100644 index 000000000..5861ec618 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_103.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest9", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_17.json b/tests/runner/remote_state_reads_cparam/message_17.json new file mode 100644 index 000000000..4250bb89f --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_17.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest11", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/message_18.json b/tests/runner/remote_state_reads_cparam/message_18.json new file mode 100644 index 000000000..5861ec618 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/message_18.json @@ -0,0 +1,13 @@ +{ + "_tag": "RemoteReadContractParameterTest9", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "remote", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/remote_state_reads_cparam/output_100.json b/tests/runner/remote_state_reads_cparam/output_100.json new file mode 100644 index 000000000..d5d0aafce --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_100.json @@ -0,0 +1,12 @@ +{ + "gas_remaining": "7952", + "errors": [ + { + "error_message": + "Address does not satisfy type: address is 0xabfeccdc9012345678901234567890f777564323, expected type is ByStr20 with contract (x : Uint128, y : Uint64) field x : Uint128, field y : Uint64 end", + "start_location": { "file": "", "line": 0, "column": 0 }, + "end_location": { "file": "", "line": 0, "column": 0 } + } + ], + "warnings": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_101.json b/tests/runner/remote_state_reads_cparam/output_101.json new file mode 100644 index 000000000..f396c336f --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_101.json @@ -0,0 +1,12 @@ +{ + "gas_remaining": "7952", + "errors": [ + { + "error_message": + "Address does not satisfy type: address is 0xabfeccdc9012345678901234567890f777564323, expected type is ByStr20 with contract (x : Uint128) field x : String end", + "start_location": { "file": "", "line": 0, "column": 0 }, + "end_location": { "file": "", "line": 0, "column": 0 } + } + ], + "warnings": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_102.json b/tests/runner/remote_state_reads_cparam/output_102.json new file mode 100644 index 000000000..0342e2966 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_102.json @@ -0,0 +1,12 @@ +{ + "gas_remaining": "7953", + "errors": [ + { + "error_message": + "Address does not satisfy type: address is 0xabfeccdc9012345678901234567890f777564323, expected type is ByStr20 with contract (admin : ByStr20 with contract (f : ByStr20 with contract (g : Uint128) end) end) end", + "start_location": { "file": "", "line": 0, "column": 0 }, + "end_location": { "file": "", "line": 0, "column": 0 } + } + ], + "warnings": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_103.json b/tests/runner/remote_state_reads_cparam/output_103.json new file mode 100644 index 000000000..014a7ad82 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_103.json @@ -0,0 +1,12 @@ +{ + "gas_remaining": "7953", + "errors": [ + { + "error_message": + "Address does not satisfy type: address is 0xabfeccdc9012345678901234567890f777564323, expected type is ByStr20 with contract (admin : ByStr20 with contract (f : ByStr20 with contract (g : Map (Uint128) (Uint128)) end) end) end", + "start_location": { "file": "", "line": 0, "column": 0 }, + "end_location": { "file": "", "line": 0, "column": 0 } + } + ], + "warnings": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_17.json b/tests/runner/remote_state_reads_cparam/output_17.json new file mode 100644 index 000000000..40eecfff4 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_17.json @@ -0,0 +1,87 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7952", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/remote_state_reads_cparam/output_18.json b/tests/runner/remote_state_reads_cparam/output_18.json new file mode 100644 index 000000000..f91040a1c --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/output_18.json @@ -0,0 +1,87 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7943", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_9", + "type": "Option (Uint128)", + "value": { + "constructor": "Some", + "argtypes": [ "Uint128" ], + "arguments": [ "1982" ] + } + }, + { "vname": "remote_reads_test_res_1", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { "vname": "remote_reads_test_res_3_2", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_3_3", "type": "Uint64", "value": "0" }, + { "vname": "remote_reads_test_res_4_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_4_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option (Bool))", + "value": { + "constructor": "None", + "argtypes": [ "Option (Bool)" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_6_1", "type": "Uint128", "value": "0" }, + { "vname": "remote_reads_test_res_6_2", "type": "String", "value": "" }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { "vname": "remote_reads_test_res_8", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map (Uint128) (ByStr20 with end)", + "value": [] + } + ], + "events": [] +} diff --git a/tests/runner/remote_state_reads_cparam/state_100.json b/tests/runner/remote_state_reads_cparam/state_100.json new file mode 100644 index 000000000..bea79c669 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_100.json @@ -0,0 +1,142 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { "vname": "y", "type": "Uint64", "value": "1" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, + { "vname": "x", "type": "Uint128", "value": "54" }, + { "vname": "y", "type": "Uint64", "value": "1234" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_101.json b/tests/runner/remote_state_reads_cparam/state_101.json new file mode 100644 index 000000000..005ee9b1a --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_101.json @@ -0,0 +1,143 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { "vname": "x", "type": "String", "value": "2801" }, + { "vname": "y", "type": "Uint64", "value": "1234" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, + { "vname": "x", "type": "String", "value": "54" }, + { "vname": "y", "type": "Uint64", "value": "1234" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_102.json b/tests/runner/remote_state_reads_cparam/state_102.json new file mode 100644 index 000000000..83d3deb9c --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_102.json @@ -0,0 +1,179 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { + "vname": "admin", + "type": "ByStr20 with contract (f : ByStr20 with contract (g : Map Uint128 Uint128) end) end", + "value": "0xabfeccdc9012345678901234567890f777564324" + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [ + { + "vname": "f", + "type": "ByStr20 with contract (g : Map Uint128 Uint128) end", + "value": "0xabfeccdc9012345678901234567890f777564325" + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [ + { + "vname": "g", + "type": "Map Uint128 Uint128", + "value": [ + { + "key" : "0", + "val" : "1982" + } + ] + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564325" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_103.json b/tests/runner/remote_state_reads_cparam/state_103.json new file mode 100644 index 000000000..55a727474 --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_103.json @@ -0,0 +1,179 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { + "vname": "admin", + "type": "ByStr20 with contract (f : ByStr20 with contract (g : Map String Uint128) end) end", + "value": "0xabfeccdc9012345678901234567890f777564324" + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [ + { + "vname": "f", + "type": "ByStr20 with contract (g : Map String Uint128) end", + "value": "0xabfeccdc9012345678901234567890f777564325" + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [ + { + "vname": "g", + "type": "Map String Uint128", + "value": [ + { + "key" : "0", + "val" : "1982" + } + ] + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564325" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_17.json b/tests/runner/remote_state_reads_cparam/state_17.json new file mode 100644 index 000000000..490b70ecd --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_17.json @@ -0,0 +1,142 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { "vname": "x", "type": "Uint128", "value": "0" }, + { "vname": "y", "type": "Uint128", "value": "0" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" }, + { "vname": "y", "type": "String", "value": "0" } + ] + } + ] + } +] diff --git a/tests/runner/remote_state_reads_cparam/state_18.json b/tests/runner/remote_state_reads_cparam/state_18.json new file mode 100644 index 000000000..330e66cbf --- /dev/null +++ b/tests/runner/remote_state_reads_cparam/state_18.json @@ -0,0 +1,184 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "remote_reads_test_res_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_2", + "type": "0x3620c286757a29985cee194eb90064270fb65414.AddressADT", + "value": { + "constructor": "0x3620c286757a29985cee194eb90064270fb65414.Address1", + "argtypes": [], + "arguments": [ "0x1234567890123456789012345678901234567890" ] + } + }, + { + "vname": "remote_reads_test_res_3_2", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_3_3", + "type": "Uint64", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_4_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_5_1", + "type": "Map (Uint128) (Bool)", + "value": [] + }, + { + "vname": "remote_reads_test_res_5_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_5_5", + "type": "Option (Option Bool)", + "value": { + "constructor": "None", + "argtypes": ["Option (Bool)"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_6_1", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_6_2", + "type": "String", + "value": "" + }, + { + "vname": "remote_reads_test_res_7_3", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_7_6", + "type": "Option Bool", + "value": { + "constructor": "None", + "argtypes": ["Bool"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_8", + "type": "Uint128", + "value": "0" + }, + { + "vname": "remote_reads_test_res_9", + "type": "Option Uint128", + "value": { + "constructor": "None", + "argtypes": ["Uint128"], + "arguments": [] + } + }, + { + "vname": "remote_reads_test_res_10", + "type": "ByStr20", + "value": "0x3620c286757a29985cee194eb90064270fb65414" + }, + { + "vname": "address_type_erasure_test_res_1", + "type": "Map Uint128 (ByStr20 with end)", + "value": [] + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0x1234567890123456789012345678901234567890", + "cparams": [ + { "vname": "admin", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567891" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "42" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0x1234567890123456789012345678901234567890" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { + "vname": "admin", + "type": "ByStr20 with contract (f : ByStr20 with contract (h: String, g : Map Uint128 Uint128) end) end", + "value": "0xabfeccdc9012345678901234567890f777564324" + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564324", + "cparams": [ + { + "vname": "f", + "type": "ByStr20 with contract (h: String, g : Map Uint128 Uint128) end", + "value": "0xabfeccdc9012345678901234567890f777564325" + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564324" } + ] + }, + { + "address": "0xabfeccdc9012345678901234567890f777564325", + "cparams": [ + { + "vname": "g", + "type": "Map Uint128 Uint128", + "value": [ + { + "key" : "0", + "val" : "1982" + } + ] + }, + { + "vname": "h", + "type": "String", + "value": "Hello world!" + } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "64" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564325" } + ] + } + ] + } +] From 015674e50ad08c219c61577368d261cd972cbefe Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Mon, 30 Jan 2023 14:52:40 +0100 Subject: [PATCH 27/33] Update existing type_cast tests --- .../checker/good/gold/type_casts.scilla.gold | 175 +++++++++++++++--- tests/contracts/type_casts.scilla | 55 ++++++ tests/runner/type_casts/output_1.json | 66 ++++++- tests/runner/type_casts/output_10.json | 65 ++++++- tests/runner/type_casts/output_11.json | 65 ++++++- tests/runner/type_casts/output_12.json | 65 ++++++- tests/runner/type_casts/output_13.json | 65 ++++++- tests/runner/type_casts/output_14.json | 65 ++++++- tests/runner/type_casts/output_15.json | 65 ++++++- tests/runner/type_casts/output_16.json | 65 ++++++- tests/runner/type_casts/output_17.json | 65 ++++++- tests/runner/type_casts/output_18.json | 65 ++++++- tests/runner/type_casts/output_19.json | 65 ++++++- tests/runner/type_casts/output_2.json | 65 ++++++- tests/runner/type_casts/output_20.json | 65 ++++++- tests/runner/type_casts/output_21.json | 65 ++++++- tests/runner/type_casts/output_22.json | 65 ++++++- tests/runner/type_casts/output_23.json | 65 ++++++- tests/runner/type_casts/output_24.json | 65 ++++++- tests/runner/type_casts/output_25.json | 65 ++++++- tests/runner/type_casts/output_26.json | 65 ++++++- tests/runner/type_casts/output_27.json | 65 ++++++- tests/runner/type_casts/output_28.json | 65 ++++++- tests/runner/type_casts/output_29.json | 65 ++++++- tests/runner/type_casts/output_3.json | 65 ++++++- tests/runner/type_casts/output_30.json | 65 ++++++- tests/runner/type_casts/output_31.json | 65 ++++++- tests/runner/type_casts/output_32.json | 65 ++++++- tests/runner/type_casts/output_33.json | 65 ++++++- tests/runner/type_casts/output_34.json | 65 ++++++- tests/runner/type_casts/output_35.json | 65 ++++++- tests/runner/type_casts/output_36.json | 65 ++++++- tests/runner/type_casts/output_37.json | 65 ++++++- tests/runner/type_casts/output_4.json | 65 ++++++- tests/runner/type_casts/output_5.json | 65 ++++++- tests/runner/type_casts/output_6.json | 65 ++++++- tests/runner/type_casts/output_7.json | 65 ++++++- tests/runner/type_casts/output_8.json | 65 ++++++- tests/runner/type_casts/output_9.json | 65 ++++++- tests/runner/type_casts/state_1.json | 35 ++++ tests/runner/type_casts/state_10.json | 35 ++++ tests/runner/type_casts/state_11.json | 35 ++++ tests/runner/type_casts/state_12.json | 35 ++++ tests/runner/type_casts/state_13.json | 35 ++++ tests/runner/type_casts/state_14.json | 35 ++++ tests/runner/type_casts/state_15.json | 35 ++++ tests/runner/type_casts/state_16.json | 35 ++++ tests/runner/type_casts/state_17.json | 35 ++++ tests/runner/type_casts/state_18.json | 35 ++++ tests/runner/type_casts/state_19.json | 35 ++++ tests/runner/type_casts/state_2.json | 35 ++++ tests/runner/type_casts/state_20.json | 35 ++++ tests/runner/type_casts/state_21.json | 35 ++++ tests/runner/type_casts/state_22.json | 35 ++++ tests/runner/type_casts/state_23.json | 35 ++++ tests/runner/type_casts/state_24.json | 35 ++++ tests/runner/type_casts/state_25.json | 35 ++++ tests/runner/type_casts/state_26.json | 35 ++++ tests/runner/type_casts/state_27.json | 35 ++++ tests/runner/type_casts/state_28.json | 35 ++++ tests/runner/type_casts/state_29.json | 35 ++++ tests/runner/type_casts/state_3.json | 35 ++++ tests/runner/type_casts/state_30.json | 35 ++++ tests/runner/type_casts/state_31.json | 35 ++++ tests/runner/type_casts/state_32.json | 35 ++++ tests/runner/type_casts/state_33.json | 35 ++++ tests/runner/type_casts/state_34.json | 35 ++++ tests/runner/type_casts/state_35.json | 35 ++++ tests/runner/type_casts/state_36.json | 35 ++++ tests/runner/type_casts/state_37.json | 35 ++++ tests/runner/type_casts/state_4.json | 35 ++++ tests/runner/type_casts/state_5.json | 35 ++++ tests/runner/type_casts/state_6.json | 35 ++++ tests/runner/type_casts/state_7.json | 35 ++++ tests/runner/type_casts/state_8.json | 35 ++++ tests/runner/type_casts/state_9.json | 35 ++++ 76 files changed, 3866 insertions(+), 65 deletions(-) diff --git a/tests/checker/good/gold/type_casts.scilla.gold b/tests/checker/good/gold/type_casts.scilla.gold index 25bbbd857..61f497b3e 100644 --- a/tests/checker/good/gold/type_casts.scilla.gold +++ b/tests/checker/good/gold/type_casts.scilla.gold @@ -21,7 +21,14 @@ { "field": "test_6_4_g_res", "tag": "(Option NoInfo)" }, { "field": "test_6_4_failed_cast", "tag": "NotMoney" }, { "field": "test_7_g_res", "tag": "(Option NoInfo)" }, - { "field": "test_7_h_res", "tag": "(Option NoInfo)" } + { "field": "test_7_h_res", "tag": "(Option NoInfo)" }, + { "field": "test_9_f_res", "tag": "(Option NoInfo)" }, + { "field": "test_10_f_immut_res", "tag": "(Option NoInfo)" }, + { "field": "test_10_g_immut_res", "tag": "(Option NoInfo)" }, + { "field": "test_10_f_mut_res", "tag": "(Option NoInfo)" }, + { "field": "test_11_f_immut_res", "tag": "(Option NoInfo)" }, + { "field": "test_11_g_immut_res", "tag": "(Option NoInfo)" }, + { "field": "test_11_f_mut_res", "tag": "(Option NoInfo)" } ], "ADT constructors": [] }, @@ -62,7 +69,22 @@ { "vname": "test_6_4_g_res", "type": "Option (Bool)", "depth": 0 }, { "vname": "test_6_4_failed_cast", "type": "Bool", "depth": 0 }, { "vname": "test_7_g_res", "type": "Option (Bool)", "depth": 0 }, - { "vname": "test_7_h_res", "type": "Option (Int256)", "depth": 0 } + { "vname": "test_7_h_res", "type": "Option (Int256)", "depth": 0 }, + { "vname": "test_9_f_res", "type": "Option (Uint128)", "depth": 0 }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "depth": 0 + }, + { "vname": "test_10_g_immut_res", "type": "Option (Bool)", "depth": 0 }, + { "vname": "test_10_f_mut_res", "type": "Option (String)", "depth": 0 }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "depth": 0 + }, + { "vname": "test_11_g_immut_res", "type": "Option (Bool)", "depth": 0 }, + { "vname": "test_11_f_mut_res", "type": "Option (String)", "depth": 0 } ], "transitions": [ { @@ -111,7 +133,8 @@ "params": [ { "vname": "x", - "type": "ByStr20 with contract field f : Uint256, field g : Bool end" + "type": + "ByStr20 with contract field f : Uint256, field g : Bool end" } ] }, @@ -119,7 +142,31 @@ "vname": "CastTest7", "params": [ { "vname": "x", "type": "ByStr20" } ] }, - { "vname": "CastTest8", "params": [] } + { "vname": "CastTest8", "params": [] }, + { + "vname": "CastTest9", + "params": [ + { + "vname": "x", + "type": + "ByStr20 with contract (f : Uint128, g : Bool) field f : String end" + } + ] + }, + { + "vname": "CastTest10", + "params": [ + { + "vname": "x", + "type": + "ByStr20 with contract (f : Uint128, g : Bool) field f : String end" + } + ] + }, + { + "vname": "CastTest11", + "params": [ { "vname": "x", "type": "ByStr20" } ] + } ], "procedures": [], "events": [], @@ -164,11 +211,21 @@ ] }, "warnings": [ + { + "warning_message": "Write only field: test_9_f_res", + "start_location": { + "file": "contracts/type_casts.scilla", + "line": 201, + "column": 5 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, { "warning_message": "Write only field: test_7_h_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 175, + "line": 182, "column": 7 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -178,7 +235,7 @@ "warning_message": "Write only field: test_7_g_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 172, + "line": 179, "column": 7 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -188,7 +245,7 @@ "warning_message": "Write only field: test_6_4_g_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 154, + "line": 161, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -198,7 +255,7 @@ "warning_message": "Write only field: test_6_4_failed_cast", "start_location": { "file": "contracts/type_casts.scilla", - "line": 157, + "line": 164, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -208,7 +265,7 @@ "warning_message": "Write only field: test_6_4_f_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 151, + "line": 158, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -218,7 +275,7 @@ "warning_message": "Write only field: test_6_4_bal_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 148, + "line": 155, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -228,7 +285,7 @@ "warning_message": "Write only field: test_6_3_g_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 136, + "line": 143, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -238,7 +295,7 @@ "warning_message": "Write only field: test_6_3_f_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 133, + "line": 140, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -248,7 +305,7 @@ "warning_message": "Write only field: test_6_3_bal_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 130, + "line": 137, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -258,7 +315,7 @@ "warning_message": "Write only field: test_6_2_g_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 118, + "line": 125, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -268,7 +325,7 @@ "warning_message": "Write only field: test_6_2_f_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 115, + "line": 122, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -278,7 +335,7 @@ "warning_message": "Write only field: test_6_2_bal_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 112, + "line": 119, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -288,7 +345,7 @@ "warning_message": "Write only field: test_6_1_g_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 100, + "line": 107, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -298,7 +355,7 @@ "warning_message": "Write only field: test_6_1_f_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 97, + "line": 104, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -308,7 +365,7 @@ "warning_message": "Write only field: test_6_1_bal_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 94, + "line": 101, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -318,7 +375,7 @@ "warning_message": "Write only field: test_5_2_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 82, + "line": 89, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -328,7 +385,7 @@ "warning_message": "Write only field: test_5_1_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 70, + "line": 77, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -338,7 +395,7 @@ "warning_message": "Write only field: test_4_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 58, + "line": 65, "column": 5 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -348,7 +405,7 @@ "warning_message": "Write only field: test_3_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 48, + "line": 55, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -358,7 +415,7 @@ "warning_message": "Write only field: test_2_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 42, + "line": 49, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -368,24 +425,86 @@ "warning_message": "Write only field: test_1_res", "start_location": { "file": "contracts/type_casts.scilla", - "line": 36, + "line": 43, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, "warning_id": 3 }, { - "warning_message": "Unused type cast statement to: maybe_contract_address", + "warning_message": "Write only field: test_11_g_immut_res", + "start_location": { + "file": "contracts/type_casts.scilla", + "line": 234, + "column": 5 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: test_11_f_mut_res", + "start_location": { + "file": "contracts/type_casts.scilla", + "line": 237, + "column": 5 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: test_11_f_immut_res", + "start_location": { + "file": "contracts/type_casts.scilla", + "line": 231, + "column": 5 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: test_10_g_immut_res", + "start_location": { + "file": "contracts/type_casts.scilla", + "line": 216, + "column": 5 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: test_10_f_mut_res", + "start_location": { + "file": "contracts/type_casts.scilla", + "line": 219, + "column": 5 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": "Write only field: test_10_f_immut_res", + "start_location": { + "file": "contracts/type_casts.scilla", + "line": 213, + "column": 5 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, + { + "warning_message": + "Unused type cast statement to: maybe_contract_address", "start_location": { "file": "contracts/type_casts.scilla", - "line": 184, + "line": 191, "column": 3 }, "end_location": { "file": "", "line": 0, "column": 0 }, "warning_id": 3 }, { - "warning_message": "No transition in contract CastContract contains an accept statement\n", + "warning_message": + "No transition in contract CastContract contains an accept statement\n", "start_location": { "file": "contracts/type_casts.scilla", "line": 9, diff --git a/tests/contracts/type_casts.scilla b/tests/contracts/type_casts.scilla index b2b2a78fb..b706da531 100644 --- a/tests/contracts/type_casts.scilla +++ b/tests/contracts/type_casts.scilla @@ -29,6 +29,13 @@ field test_6_4_g_res : Option Bool = None {Bool} field test_6_4_failed_cast : Bool = False field test_7_g_res : Option Bool = None {Bool} field test_7_h_res : Option Int256 = None {Int256} +field test_9_f_res : Option Uint128 = None {Uint128} +field test_10_f_immut_res : Option Uint128 = None {Uint128} +field test_10_g_immut_res : Option Bool = None {Bool} +field test_10_f_mut_res : Option String = None {String} +field test_11_f_immut_res : Option Uint128 = None {Uint128} +field test_11_g_immut_res : Option Bool = None {Bool} +field test_11_f_mut_res : Option String = None {String} transition CastTest1(x : ByStr20 with contract end) (* Cast to less restrictive type *) @@ -183,3 +190,51 @@ transition CastTest8() (* cast an address defined in the contract library *) maybe_contract_address <-& zero_address as ByStr20 with contract end end + +transition CastTest9(x : ByStr20 with contract (g : Bool, f : Uint128) field f : String end) + (* Cast to less restrictive type with immutable fields *) + x_cast <-& x as ByStr20 with contract (f : Uint128) end; + match x_cast with + | Some x_as_address => + f <-& x_as_address.(f); + f_res = Some {Uint128} f; + test_9_f_res := f_res + | None => + end +end + +transition CastTest10(x : ByStr20 with contract (g : Bool, f : Uint128) field f : String end) + (* Cast to same type with immutable fields *) + x_cast <-& x as ByStr20 with contract (g : Bool, f : Uint128) field f : String end; + match x_cast with + | Some x_as_address => + f_immut <-& x_as_address.(f); + f_immut_res = Some {Uint128} f_immut; + test_10_f_immut_res := f_immut_res; + g_immut <-& x_as_address.(g); + g_immut_res = Some {Bool} g_immut; + test_10_g_immut_res := g_immut_res; + f_mut <-& x_as_address.f; + f_mut_res = Some {String} f_mut; + test_10_f_mut_res := f_mut_res + | None => + end +end + +transition CastTest11(x : ByStr20) + (* Cast to address with both mutable and immutable fields *) + x_cast <-& x as ByStr20 with contract (g : Bool, f : Uint128) field f : String end; + match x_cast with + | Some x_as_address => + f_immut <-& x_as_address.(f); + f_immut_res = Some {Uint128} f_immut; + test_11_f_immut_res := f_immut_res; + g_immut <-& x_as_address.(g); + g_immut_res = Some {Bool} g_immut; + test_11_g_immut_res := g_immut_res; + f_mut <-& x_as_address.f; + f_mut_res = Some {String} f_mut; + test_11_f_mut_res := f_mut_res + | None => + end +end diff --git a/tests/runner/type_casts/output_1.json b/tests/runner/type_casts/output_1.json index 3875cb9d4..ca87caa77 100644 --- a/tests/runner/type_casts/output_1.json +++ b/tests/runner/type_casts/output_1.json @@ -189,7 +189,71 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} + diff --git a/tests/runner/type_casts/output_10.json b/tests/runner/type_casts/output_10.json index b2124c292..791688ebf 100644 --- a/tests/runner/type_casts/output_10.json +++ b/tests/runner/type_casts/output_10.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_11.json b/tests/runner/type_casts/output_11.json index a8b439af3..b4c037de7 100644 --- a/tests/runner/type_casts/output_11.json +++ b/tests/runner/type_casts/output_11.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_12.json b/tests/runner/type_casts/output_12.json index a8b439af3..b4c037de7 100644 --- a/tests/runner/type_casts/output_12.json +++ b/tests/runner/type_casts/output_12.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_13.json b/tests/runner/type_casts/output_13.json index 15c160564..3a81132c4 100644 --- a/tests/runner/type_casts/output_13.json +++ b/tests/runner/type_casts/output_13.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_14.json b/tests/runner/type_casts/output_14.json index 6ae149dbf..2085f57cb 100644 --- a/tests/runner/type_casts/output_14.json +++ b/tests/runner/type_casts/output_14.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_15.json b/tests/runner/type_casts/output_15.json index b3cb02660..6af5b631f 100644 --- a/tests/runner/type_casts/output_15.json +++ b/tests/runner/type_casts/output_15.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_16.json b/tests/runner/type_casts/output_16.json index f04427596..ab6db676a 100644 --- a/tests/runner/type_casts/output_16.json +++ b/tests/runner/type_casts/output_16.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_17.json b/tests/runner/type_casts/output_17.json index f04427596..ab6db676a 100644 --- a/tests/runner/type_casts/output_17.json +++ b/tests/runner/type_casts/output_17.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_18.json b/tests/runner/type_casts/output_18.json index b3cb02660..6af5b631f 100644 --- a/tests/runner/type_casts/output_18.json +++ b/tests/runner/type_casts/output_18.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_19.json b/tests/runner/type_casts/output_19.json index b3cb02660..6af5b631f 100644 --- a/tests/runner/type_casts/output_19.json +++ b/tests/runner/type_casts/output_19.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_2.json b/tests/runner/type_casts/output_2.json index 3875cb9d4..9190d7f54 100644 --- a/tests/runner/type_casts/output_2.json +++ b/tests/runner/type_casts/output_2.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_20.json b/tests/runner/type_casts/output_20.json index b3cb02660..6af5b631f 100644 --- a/tests/runner/type_casts/output_20.json +++ b/tests/runner/type_casts/output_20.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_21.json b/tests/runner/type_casts/output_21.json index b3cb02660..6af5b631f 100644 --- a/tests/runner/type_casts/output_21.json +++ b/tests/runner/type_casts/output_21.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_22.json b/tests/runner/type_casts/output_22.json index 8bb1f30b0..6da25e9ed 100644 --- a/tests/runner/type_casts/output_22.json +++ b/tests/runner/type_casts/output_22.json @@ -191,7 +191,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_23.json b/tests/runner/type_casts/output_23.json index 8bb1f30b0..6da25e9ed 100644 --- a/tests/runner/type_casts/output_23.json +++ b/tests/runner/type_casts/output_23.json @@ -191,7 +191,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_24.json b/tests/runner/type_casts/output_24.json index b3cb02660..6af5b631f 100644 --- a/tests/runner/type_casts/output_24.json +++ b/tests/runner/type_casts/output_24.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_25.json b/tests/runner/type_casts/output_25.json index b3cb02660..6af5b631f 100644 --- a/tests/runner/type_casts/output_25.json +++ b/tests/runner/type_casts/output_25.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_26.json b/tests/runner/type_casts/output_26.json index b3cb02660..6af5b631f 100644 --- a/tests/runner/type_casts/output_26.json +++ b/tests/runner/type_casts/output_26.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_27.json b/tests/runner/type_casts/output_27.json index b3cb02660..6af5b631f 100644 --- a/tests/runner/type_casts/output_27.json +++ b/tests/runner/type_casts/output_27.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_28.json b/tests/runner/type_casts/output_28.json index f1477a1e0..643f1fda2 100644 --- a/tests/runner/type_casts/output_28.json +++ b/tests/runner/type_casts/output_28.json @@ -191,7 +191,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_29.json b/tests/runner/type_casts/output_29.json index f1477a1e0..643f1fda2 100644 --- a/tests/runner/type_casts/output_29.json +++ b/tests/runner/type_casts/output_29.json @@ -191,7 +191,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_3.json b/tests/runner/type_casts/output_3.json index c2177f165..848a65c10 100644 --- a/tests/runner/type_casts/output_3.json +++ b/tests/runner/type_casts/output_3.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_30.json b/tests/runner/type_casts/output_30.json index b3cb02660..6af5b631f 100644 --- a/tests/runner/type_casts/output_30.json +++ b/tests/runner/type_casts/output_30.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_31.json b/tests/runner/type_casts/output_31.json index b3cb02660..6af5b631f 100644 --- a/tests/runner/type_casts/output_31.json +++ b/tests/runner/type_casts/output_31.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_32.json b/tests/runner/type_casts/output_32.json index b3cb02660..6af5b631f 100644 --- a/tests/runner/type_casts/output_32.json +++ b/tests/runner/type_casts/output_32.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_33.json b/tests/runner/type_casts/output_33.json index c04102479..f4246539c 100644 --- a/tests/runner/type_casts/output_33.json +++ b/tests/runner/type_casts/output_33.json @@ -191,7 +191,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_34.json b/tests/runner/type_casts/output_34.json index c04102479..f4246539c 100644 --- a/tests/runner/type_casts/output_34.json +++ b/tests/runner/type_casts/output_34.json @@ -191,7 +191,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_35.json b/tests/runner/type_casts/output_35.json index b3cb02660..6af5b631f 100644 --- a/tests/runner/type_casts/output_35.json +++ b/tests/runner/type_casts/output_35.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_36.json b/tests/runner/type_casts/output_36.json index bc0022ce7..233374c4e 100644 --- a/tests/runner/type_casts/output_36.json +++ b/tests/runner/type_casts/output_36.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_37.json b/tests/runner/type_casts/output_37.json index e71a38f58..f132c8f14 100644 --- a/tests/runner/type_casts/output_37.json +++ b/tests/runner/type_casts/output_37.json @@ -191,7 +191,70 @@ "vname": "test_6_4_failed_cast", "type": "Bool", "value": { "constructor": "False", "argtypes": [], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_4.json b/tests/runner/type_casts/output_4.json index c2177f165..848a65c10 100644 --- a/tests/runner/type_casts/output_4.json +++ b/tests/runner/type_casts/output_4.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_5.json b/tests/runner/type_casts/output_5.json index c2177f165..848a65c10 100644 --- a/tests/runner/type_casts/output_5.json +++ b/tests/runner/type_casts/output_5.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_6.json b/tests/runner/type_casts/output_6.json index 1e3ad08ab..22bef9686 100644 --- a/tests/runner/type_casts/output_6.json +++ b/tests/runner/type_casts/output_6.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_7.json b/tests/runner/type_casts/output_7.json index a8b439af3..b4c037de7 100644 --- a/tests/runner/type_casts/output_7.json +++ b/tests/runner/type_casts/output_7.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_8.json b/tests/runner/type_casts/output_8.json index b2124c292..791688ebf 100644 --- a/tests/runner/type_casts/output_8.json +++ b/tests/runner/type_casts/output_8.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/output_9.json b/tests/runner/type_casts/output_9.json index b2124c292..791688ebf 100644 --- a/tests/runner/type_casts/output_9.json +++ b/tests/runner/type_casts/output_9.json @@ -189,7 +189,70 @@ "argtypes": [ "Int256" ], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } } ], "events": [] -} \ No newline at end of file +} diff --git a/tests/runner/type_casts/state_1.json b/tests/runner/type_casts/state_1.json index 37ab7d327..83fac3e8a 100644 --- a/tests/runner/type_casts/state_1.json +++ b/tests/runner/type_casts/state_1.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_10.json b/tests/runner/type_casts/state_10.json index 99a2e61e0..5b1f04bbd 100644 --- a/tests/runner/type_casts/state_10.json +++ b/tests/runner/type_casts/state_10.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_11.json b/tests/runner/type_casts/state_11.json index 5d1811d26..79b958f0c 100644 --- a/tests/runner/type_casts/state_11.json +++ b/tests/runner/type_casts/state_11.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_12.json b/tests/runner/type_casts/state_12.json index f85cce72b..3cae975fa 100644 --- a/tests/runner/type_casts/state_12.json +++ b/tests/runner/type_casts/state_12.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_13.json b/tests/runner/type_casts/state_13.json index 37ab7d327..83fac3e8a 100644 --- a/tests/runner/type_casts/state_13.json +++ b/tests/runner/type_casts/state_13.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_14.json b/tests/runner/type_casts/state_14.json index d7fc2198b..8bfe900cc 100644 --- a/tests/runner/type_casts/state_14.json +++ b/tests/runner/type_casts/state_14.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_15.json b/tests/runner/type_casts/state_15.json index f85cce72b..3cae975fa 100644 --- a/tests/runner/type_casts/state_15.json +++ b/tests/runner/type_casts/state_15.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_16.json b/tests/runner/type_casts/state_16.json index ec71925cd..776113104 100644 --- a/tests/runner/type_casts/state_16.json +++ b/tests/runner/type_casts/state_16.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_17.json b/tests/runner/type_casts/state_17.json index ea72bffa1..6bab042f4 100644 --- a/tests/runner/type_casts/state_17.json +++ b/tests/runner/type_casts/state_17.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_18.json b/tests/runner/type_casts/state_18.json index 5d1811d26..79b958f0c 100644 --- a/tests/runner/type_casts/state_18.json +++ b/tests/runner/type_casts/state_18.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_19.json b/tests/runner/type_casts/state_19.json index f85cce72b..3cae975fa 100644 --- a/tests/runner/type_casts/state_19.json +++ b/tests/runner/type_casts/state_19.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_2.json b/tests/runner/type_casts/state_2.json index 99a2e61e0..5b1f04bbd 100644 --- a/tests/runner/type_casts/state_2.json +++ b/tests/runner/type_casts/state_2.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_20.json b/tests/runner/type_casts/state_20.json index f8245d679..4b992f673 100644 --- a/tests/runner/type_casts/state_20.json +++ b/tests/runner/type_casts/state_20.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_21.json b/tests/runner/type_casts/state_21.json index 9edeac6e1..930db1422 100644 --- a/tests/runner/type_casts/state_21.json +++ b/tests/runner/type_casts/state_21.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_22.json b/tests/runner/type_casts/state_22.json index d7fc2198b..8bfe900cc 100644 --- a/tests/runner/type_casts/state_22.json +++ b/tests/runner/type_casts/state_22.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_23.json b/tests/runner/type_casts/state_23.json index a588e21cf..410bf13fe 100644 --- a/tests/runner/type_casts/state_23.json +++ b/tests/runner/type_casts/state_23.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_24.json b/tests/runner/type_casts/state_24.json index 70f5cfe16..66d7453e1 100644 --- a/tests/runner/type_casts/state_24.json +++ b/tests/runner/type_casts/state_24.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_25.json b/tests/runner/type_casts/state_25.json index 239b60496..57ac6b621 100644 --- a/tests/runner/type_casts/state_25.json +++ b/tests/runner/type_casts/state_25.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_26.json b/tests/runner/type_casts/state_26.json index 6712b3cae..5c2740eb9 100644 --- a/tests/runner/type_casts/state_26.json +++ b/tests/runner/type_casts/state_26.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_27.json b/tests/runner/type_casts/state_27.json index cc416727c..3f6034fdb 100644 --- a/tests/runner/type_casts/state_27.json +++ b/tests/runner/type_casts/state_27.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_28.json b/tests/runner/type_casts/state_28.json index 63a6575cd..c01ec00e3 100644 --- a/tests/runner/type_casts/state_28.json +++ b/tests/runner/type_casts/state_28.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_29.json b/tests/runner/type_casts/state_29.json index 7b32ca20d..42dca9bf5 100644 --- a/tests/runner/type_casts/state_29.json +++ b/tests/runner/type_casts/state_29.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_3.json b/tests/runner/type_casts/state_3.json index 37ab7d327..83fac3e8a 100644 --- a/tests/runner/type_casts/state_3.json +++ b/tests/runner/type_casts/state_3.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_30.json b/tests/runner/type_casts/state_30.json index 9e4ca3ba2..356268f56 100644 --- a/tests/runner/type_casts/state_30.json +++ b/tests/runner/type_casts/state_30.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_31.json b/tests/runner/type_casts/state_31.json index 4649943aa..d1f4b4770 100644 --- a/tests/runner/type_casts/state_31.json +++ b/tests/runner/type_casts/state_31.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_32.json b/tests/runner/type_casts/state_32.json index c8872ad40..4bc18084b 100644 --- a/tests/runner/type_casts/state_32.json +++ b/tests/runner/type_casts/state_32.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_33.json b/tests/runner/type_casts/state_33.json index 63a6575cd..c01ec00e3 100644 --- a/tests/runner/type_casts/state_33.json +++ b/tests/runner/type_casts/state_33.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_34.json b/tests/runner/type_casts/state_34.json index d8049b4ad..69562cd4f 100644 --- a/tests/runner/type_casts/state_34.json +++ b/tests/runner/type_casts/state_34.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_35.json b/tests/runner/type_casts/state_35.json index a45fd34c1..c0c96eb36 100644 --- a/tests/runner/type_casts/state_35.json +++ b/tests/runner/type_casts/state_35.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_36.json b/tests/runner/type_casts/state_36.json index c8872ad40..4bc18084b 100644 --- a/tests/runner/type_casts/state_36.json +++ b/tests/runner/type_casts/state_36.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_37.json b/tests/runner/type_casts/state_37.json index 7d3247798..4e74cdd0b 100644 --- a/tests/runner/type_casts/state_37.json +++ b/tests/runner/type_casts/state_37.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_4.json b/tests/runner/type_casts/state_4.json index 99a2e61e0..5b1f04bbd 100644 --- a/tests/runner/type_casts/state_4.json +++ b/tests/runner/type_casts/state_4.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_5.json b/tests/runner/type_casts/state_5.json index 37ab7d327..83fac3e8a 100644 --- a/tests/runner/type_casts/state_5.json +++ b/tests/runner/type_casts/state_5.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_6.json b/tests/runner/type_casts/state_6.json index 99a2e61e0..5b1f04bbd 100644 --- a/tests/runner/type_casts/state_6.json +++ b/tests/runner/type_casts/state_6.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_7.json b/tests/runner/type_casts/state_7.json index 5d1811d26..79b958f0c 100644 --- a/tests/runner/type_casts/state_7.json +++ b/tests/runner/type_casts/state_7.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_8.json b/tests/runner/type_casts/state_8.json index f85cce72b..3cae975fa 100644 --- a/tests/runner/type_casts/state_8.json +++ b/tests/runner/type_casts/state_8.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", diff --git a/tests/runner/type_casts/state_9.json b/tests/runner/type_casts/state_9.json index 37ab7d327..83fac3e8a 100644 --- a/tests/runner/type_casts/state_9.json +++ b/tests/runner/type_casts/state_9.json @@ -105,6 +105,41 @@ "type": "Option Int256", "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, { "vname": "_external", "type": "Unit", From adf90ab3397a17eaa43c152babb8506fd5f9a808 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Mon, 30 Jan 2023 19:30:54 +0100 Subject: [PATCH 28/33] Type cast test cases added --- tests/runner/Testcontracts.ml | 2 +- tests/runner/type_casts/blockchain_38.json | 1 + tests/runner/type_casts/blockchain_39.json | 1 + tests/runner/type_casts/blockchain_40.json | 1 + tests/runner/type_casts/blockchain_41.json | 1 + tests/runner/type_casts/blockchain_42.json | 1 + tests/runner/type_casts/message_38.json | 13 ++ tests/runner/type_casts/message_39.json | 13 ++ tests/runner/type_casts/message_40.json | 13 ++ tests/runner/type_casts/message_41.json | 13 ++ tests/runner/type_casts/message_42.json | 13 ++ tests/runner/type_casts/output_38.json | 258 ++++++++++++++++++++ tests/runner/type_casts/output_39.json | 260 +++++++++++++++++++++ tests/runner/type_casts/output_40.json | 260 +++++++++++++++++++++ tests/runner/type_casts/output_41.json | 258 ++++++++++++++++++++ tests/runner/type_casts/output_42.json | 258 ++++++++++++++++++++ tests/runner/type_casts/state_38.json | 162 +++++++++++++ tests/runner/type_casts/state_39.json | 162 +++++++++++++ tests/runner/type_casts/state_40.json | 162 +++++++++++++ tests/runner/type_casts/state_41.json | 161 +++++++++++++ tests/runner/type_casts/state_42.json | 162 +++++++++++++ 21 files changed, 2174 insertions(+), 1 deletion(-) create mode 100644 tests/runner/type_casts/blockchain_38.json create mode 100644 tests/runner/type_casts/blockchain_39.json create mode 100644 tests/runner/type_casts/blockchain_40.json create mode 100644 tests/runner/type_casts/blockchain_41.json create mode 100644 tests/runner/type_casts/blockchain_42.json create mode 100644 tests/runner/type_casts/message_38.json create mode 100644 tests/runner/type_casts/message_39.json create mode 100644 tests/runner/type_casts/message_40.json create mode 100644 tests/runner/type_casts/message_41.json create mode 100644 tests/runner/type_casts/message_42.json create mode 100644 tests/runner/type_casts/output_38.json create mode 100644 tests/runner/type_casts/output_39.json create mode 100644 tests/runner/type_casts/output_40.json create mode 100644 tests/runner/type_casts/output_41.json create mode 100644 tests/runner/type_casts/output_42.json create mode 100644 tests/runner/type_casts/state_38.json create mode 100644 tests/runner/type_casts/state_39.json create mode 100644 tests/runner/type_casts/state_40.json create mode 100644 tests/runner/type_casts/state_41.json create mode 100644 tests/runner/type_casts/state_42.json diff --git a/tests/runner/Testcontracts.ml b/tests/runner/Testcontracts.ml index 70186162b..10367e42e 100644 --- a/tests/runner/Testcontracts.ml +++ b/tests/runner/Testcontracts.ml @@ -479,7 +479,7 @@ let contract_tests env = >::: build_contract_tests ~pplit:false env "address_list_traversal" succ_code 1 2 []; "type_casts" - >::: build_contract_tests env "type_casts" succ_code 1 37 []; + >::: build_contract_tests env "type_casts" succ_code 1 42 []; "addfunds_proxy" >::: build_contract_tests env "addfunds_proxy" succ_code 1 2 []; "addfunds" diff --git a/tests/runner/type_casts/blockchain_38.json b/tests/runner/type_casts/blockchain_38.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/type_casts/blockchain_38.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/type_casts/blockchain_39.json b/tests/runner/type_casts/blockchain_39.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/type_casts/blockchain_39.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/type_casts/blockchain_40.json b/tests/runner/type_casts/blockchain_40.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/type_casts/blockchain_40.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/type_casts/blockchain_41.json b/tests/runner/type_casts/blockchain_41.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/type_casts/blockchain_41.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/type_casts/blockchain_42.json b/tests/runner/type_casts/blockchain_42.json new file mode 100644 index 000000000..d962cce79 --- /dev/null +++ b/tests/runner/type_casts/blockchain_42.json @@ -0,0 +1 @@ +[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] diff --git a/tests/runner/type_casts/message_38.json b/tests/runner/type_casts/message_38.json new file mode 100644 index 000000000..f0eeeaf89 --- /dev/null +++ b/tests/runner/type_casts/message_38.json @@ -0,0 +1,13 @@ +{ + "_tag": "CastTest9", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "x", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/type_casts/message_39.json b/tests/runner/type_casts/message_39.json new file mode 100644 index 000000000..aaa199a19 --- /dev/null +++ b/tests/runner/type_casts/message_39.json @@ -0,0 +1,13 @@ +{ + "_tag": "CastTest10", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "x", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/type_casts/message_40.json b/tests/runner/type_casts/message_40.json new file mode 100644 index 000000000..f951b7039 --- /dev/null +++ b/tests/runner/type_casts/message_40.json @@ -0,0 +1,13 @@ +{ + "_tag": "CastTest11", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "x", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/type_casts/message_41.json b/tests/runner/type_casts/message_41.json new file mode 100644 index 000000000..f951b7039 --- /dev/null +++ b/tests/runner/type_casts/message_41.json @@ -0,0 +1,13 @@ +{ + "_tag": "CastTest11", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "x", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/type_casts/message_42.json b/tests/runner/type_casts/message_42.json new file mode 100644 index 000000000..f951b7039 --- /dev/null +++ b/tests/runner/type_casts/message_42.json @@ -0,0 +1,13 @@ +{ + "_tag": "CastTest11", + "_amount": "0", + "_sender": "0xabfeccdc9012345678901234567890f777564322", + "params": [ + { + "vname" : "x", + "type" : "ByStr20", + "value" : "0xabfeccdc9012345678901234567890f777564323" + } + ], + "_origin": "0xabfeccdc9012345678901234567890f777564322" +} diff --git a/tests/runner/type_casts/output_38.json b/tests/runner/type_casts/output_38.json new file mode 100644 index 000000000..999542252 --- /dev/null +++ b/tests/runner/type_casts/output_38.json @@ -0,0 +1,258 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7951", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "Some", + "argtypes": [ "Uint128" ], + "arguments": [ "1289" ] + } + }, + { + "vname": "test_1_res", + "type": "Option (ByStr20 with end)", + "value": { + "constructor": "None", + "argtypes": [ "ByStr20 with end" ], + "arguments": [] + } + }, + { + "vname": "test_2_res", + "type": "Option (ByStr20 with contract end)", + "value": { + "constructor": "None", + "argtypes": [ "ByStr20 with contract end" ], + "arguments": [] + } + }, + { + "vname": "test_3_res", + "type": "Option (ByStr20 with contract end)", + "value": { + "constructor": "None", + "argtypes": [ "ByStr20 with contract end" ], + "arguments": [] + } + }, + { + "vname": "test_4_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_5_1_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_5_2_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_1_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_1_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_1_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_2_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_2_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_2_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_3_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_3_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_3_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_failed_cast", + "type": "Bool", + "value": { "constructor": "False", "argtypes": [], "arguments": [] } + }, + { + "vname": "test_7_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_7_h_res", + "type": "Option (Int256)", + "value": { + "constructor": "None", + "argtypes": [ "Int256" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/type_casts/output_39.json b/tests/runner/type_casts/output_39.json new file mode 100644 index 000000000..4babffbe1 --- /dev/null +++ b/tests/runner/type_casts/output_39.json @@ -0,0 +1,260 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7939", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "Some", + "argtypes": [ "String" ], + "arguments": [ "0xabfeccdc9012345678901234567890f777564324" ] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "Some", + "argtypes": [ "Bool" ], + "arguments": [ + { "constructor": "True", "argtypes": [], "arguments": [] } + ] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "Some", + "argtypes": [ "Uint128" ], + "arguments": [ "1281" ] + } + }, + { + "vname": "test_1_res", + "type": "Option (ByStr20 with end)", + "value": { + "constructor": "None", + "argtypes": [ "ByStr20 with end" ], + "arguments": [] + } + }, + { + "vname": "test_2_res", + "type": "Option (ByStr20 with contract end)", + "value": { + "constructor": "None", + "argtypes": [ "ByStr20 with contract end" ], + "arguments": [] + } + }, + { + "vname": "test_3_res", + "type": "Option (ByStr20 with contract end)", + "value": { + "constructor": "None", + "argtypes": [ "ByStr20 with contract end" ], + "arguments": [] + } + }, + { + "vname": "test_4_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_5_1_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_5_2_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_1_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_1_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_1_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_2_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_2_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_2_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_3_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_3_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_3_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_failed_cast", + "type": "Bool", + "value": { "constructor": "False", "argtypes": [], "arguments": [] } + }, + { + "vname": "test_7_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_7_h_res", + "type": "Option (Int256)", + "value": { + "constructor": "None", + "argtypes": [ "Int256" ], + "arguments": [] + } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/type_casts/output_40.json b/tests/runner/type_casts/output_40.json new file mode 100644 index 000000000..478c859f4 --- /dev/null +++ b/tests/runner/type_casts/output_40.json @@ -0,0 +1,260 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7941", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "Some", + "argtypes": [ "String" ], + "arguments": [ "0xabfeccdc9012345678567890f777564324" ] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "Some", + "argtypes": [ "Bool" ], + "arguments": [ + { "constructor": "False", "argtypes": [], "arguments": [] } + ] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "Some", + "argtypes": [ "Uint128" ], + "arguments": [ "128" ] + } + }, + { + "vname": "test_1_res", + "type": "Option (ByStr20 with end)", + "value": { + "constructor": "None", + "argtypes": [ "ByStr20 with end" ], + "arguments": [] + } + }, + { + "vname": "test_2_res", + "type": "Option (ByStr20 with contract end)", + "value": { + "constructor": "None", + "argtypes": [ "ByStr20 with contract end" ], + "arguments": [] + } + }, + { + "vname": "test_3_res", + "type": "Option (ByStr20 with contract end)", + "value": { + "constructor": "None", + "argtypes": [ "ByStr20 with contract end" ], + "arguments": [] + } + }, + { + "vname": "test_4_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_5_1_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_5_2_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_1_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_1_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_1_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_2_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_2_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_2_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_3_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_3_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_3_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_failed_cast", + "type": "Bool", + "value": { "constructor": "False", "argtypes": [], "arguments": [] } + }, + { + "vname": "test_7_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_7_h_res", + "type": "Option (Int256)", + "value": { + "constructor": "None", + "argtypes": [ "Int256" ], + "arguments": [] + } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/type_casts/output_41.json b/tests/runner/type_casts/output_41.json new file mode 100644 index 000000000..fc0342667 --- /dev/null +++ b/tests/runner/type_casts/output_41.json @@ -0,0 +1,258 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7955", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "test_1_res", + "type": "Option (ByStr20 with end)", + "value": { + "constructor": "None", + "argtypes": [ "ByStr20 with end" ], + "arguments": [] + } + }, + { + "vname": "test_2_res", + "type": "Option (ByStr20 with contract end)", + "value": { + "constructor": "None", + "argtypes": [ "ByStr20 with contract end" ], + "arguments": [] + } + }, + { + "vname": "test_3_res", + "type": "Option (ByStr20 with contract end)", + "value": { + "constructor": "None", + "argtypes": [ "ByStr20 with contract end" ], + "arguments": [] + } + }, + { + "vname": "test_4_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_5_1_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_5_2_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_1_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_1_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_1_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_2_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_2_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_2_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_3_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_3_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_3_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_failed_cast", + "type": "Bool", + "value": { "constructor": "False", "argtypes": [], "arguments": [] } + }, + { + "vname": "test_7_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_7_h_res", + "type": "Option (Int256)", + "value": { + "constructor": "None", + "argtypes": [ "Int256" ], + "arguments": [] + } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + } + ], + "events": [] +} \ No newline at end of file diff --git a/tests/runner/type_casts/output_42.json b/tests/runner/type_casts/output_42.json new file mode 100644 index 000000000..6af5b631f --- /dev/null +++ b/tests/runner/type_casts/output_42.json @@ -0,0 +1,258 @@ +{ + "scilla_major_version": "0", + "gas_remaining": "7955", + "_accepted": "false", + "messages": [], + "states": [ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "test_1_res", + "type": "Option (ByStr20 with end)", + "value": { + "constructor": "None", + "argtypes": [ "ByStr20 with end" ], + "arguments": [] + } + }, + { + "vname": "test_2_res", + "type": "Option (ByStr20 with contract end)", + "value": { + "constructor": "None", + "argtypes": [ "ByStr20 with contract end" ], + "arguments": [] + } + }, + { + "vname": "test_3_res", + "type": "Option (ByStr20 with contract end)", + "value": { + "constructor": "None", + "argtypes": [ "ByStr20 with contract end" ], + "arguments": [] + } + }, + { + "vname": "test_4_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_5_1_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_5_2_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_1_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_1_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_1_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_2_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_2_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_2_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_3_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_3_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_3_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_bal_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_6_4_failed_cast", + "type": "Bool", + "value": { "constructor": "False", "argtypes": [], "arguments": [] } + }, + { + "vname": "test_7_g_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_7_h_res", + "type": "Option (Int256)", + "value": { + "constructor": "None", + "argtypes": [ "Int256" ], + "arguments": [] + } + }, + { + "vname": "test_9_f_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option (Uint128)", + "value": { + "constructor": "None", + "argtypes": [ "Uint128" ], + "arguments": [] + } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option (Bool)", + "value": { + "constructor": "None", + "argtypes": [ "Bool" ], + "arguments": [] + } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option (String)", + "value": { + "constructor": "None", + "argtypes": [ "String" ], + "arguments": [] + } + } + ], + "events": [] +} diff --git a/tests/runner/type_casts/state_38.json b/tests/runner/type_casts/state_38.json new file mode 100644 index 000000000..2568e45c9 --- /dev/null +++ b/tests/runner/type_casts/state_38.json @@ -0,0 +1,162 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "test_1_res", + "type": "Option (ByStr20 with end)", + "value": { "constructor": "None", "argtypes": ["ByStr20 with end"], "arguments": [] } + }, + { + "vname": "test_2_res", + "type": "Option (ByStr20 with contract end)", + "value": { "constructor": "None", "argtypes": ["ByStr20 with contract end"], "arguments": [] } + }, + { + "vname": "test_3_res", + "type": "Option (ByStr20 with contract end)", + "value": { "constructor": "None", "argtypes": ["ByStr20 with contract end"], "arguments": [] } + }, + { + "vname": "test_4_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_5_1_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_5_2_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_1_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_1_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_1_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_2_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_2_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_2_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_3_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_3_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_3_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_4_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_4_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_4_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_4_failed_cast", + "type": "Bool", + "value": { "constructor": "False", "argtypes": [], "arguments": [] } + }, + { + "vname": "test_7_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_7_h_res", + "type": "Option Int256", + "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { "vname": "f", "type": "Uint128", "value": "1289" }, + { "vname": "g", "type": "Bool", "value": { "constructor": "True", "argtypes": [], "arguments": [] } } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "242" }, + { "vname": "f", "type": "String", "value": "0xabfeccdc9012345678901234567890f777564324" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + } + ] + } +] diff --git a/tests/runner/type_casts/state_39.json b/tests/runner/type_casts/state_39.json new file mode 100644 index 000000000..b4d78435f --- /dev/null +++ b/tests/runner/type_casts/state_39.json @@ -0,0 +1,162 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "test_1_res", + "type": "Option (ByStr20 with end)", + "value": { "constructor": "None", "argtypes": ["ByStr20 with end"], "arguments": [] } + }, + { + "vname": "test_2_res", + "type": "Option (ByStr20 with contract end)", + "value": { "constructor": "None", "argtypes": ["ByStr20 with contract end"], "arguments": [] } + }, + { + "vname": "test_3_res", + "type": "Option (ByStr20 with contract end)", + "value": { "constructor": "None", "argtypes": ["ByStr20 with contract end"], "arguments": [] } + }, + { + "vname": "test_4_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_5_1_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_5_2_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_1_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_1_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_1_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_2_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_2_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_2_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_3_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_3_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_3_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_4_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_4_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_4_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_4_failed_cast", + "type": "Bool", + "value": { "constructor": "False", "argtypes": [], "arguments": [] } + }, + { + "vname": "test_7_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_7_h_res", + "type": "Option Int256", + "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { "vname": "f", "type": "Uint128", "value": "1281" }, + { "vname": "g", "type": "Bool", "value": { "constructor": "True", "argtypes": [], "arguments": [] } } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "242" }, + { "vname": "f", "type": "String", "value": "0xabfeccdc9012345678901234567890f777564324" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + } + ] + } +] diff --git a/tests/runner/type_casts/state_40.json b/tests/runner/type_casts/state_40.json new file mode 100644 index 000000000..ed45c7b6d --- /dev/null +++ b/tests/runner/type_casts/state_40.json @@ -0,0 +1,162 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "test_1_res", + "type": "Option (ByStr20 with end)", + "value": { "constructor": "None", "argtypes": ["ByStr20 with end"], "arguments": [] } + }, + { + "vname": "test_2_res", + "type": "Option (ByStr20 with contract end)", + "value": { "constructor": "None", "argtypes": ["ByStr20 with contract end"], "arguments": [] } + }, + { + "vname": "test_3_res", + "type": "Option (ByStr20 with contract end)", + "value": { "constructor": "None", "argtypes": ["ByStr20 with contract end"], "arguments": [] } + }, + { + "vname": "test_4_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_5_1_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_5_2_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_1_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_1_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_1_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_2_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_2_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_2_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_3_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_3_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_3_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_4_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_4_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_4_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_4_failed_cast", + "type": "Bool", + "value": { "constructor": "False", "argtypes": [], "arguments": [] } + }, + { + "vname": "test_7_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_7_h_res", + "type": "Option Int256", + "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { "vname": "f", "type": "Uint128", "value": "128" }, + { "vname": "g", "type": "Bool", "value": { "constructor": "False", "argtypes": [], "arguments": [] } } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "242" }, + { "vname": "f", "type": "String", "value": "0xabfeccdc9012345678567890f777564324" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + } + ] + } +] diff --git a/tests/runner/type_casts/state_41.json b/tests/runner/type_casts/state_41.json new file mode 100644 index 000000000..9240edb56 --- /dev/null +++ b/tests/runner/type_casts/state_41.json @@ -0,0 +1,161 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "test_1_res", + "type": "Option (ByStr20 with end)", + "value": { "constructor": "None", "argtypes": ["ByStr20 with end"], "arguments": [] } + }, + { + "vname": "test_2_res", + "type": "Option (ByStr20 with contract end)", + "value": { "constructor": "None", "argtypes": ["ByStr20 with contract end"], "arguments": [] } + }, + { + "vname": "test_3_res", + "type": "Option (ByStr20 with contract end)", + "value": { "constructor": "None", "argtypes": ["ByStr20 with contract end"], "arguments": [] } + }, + { + "vname": "test_4_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_5_1_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_5_2_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_1_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_1_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_1_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_2_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_2_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_2_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_3_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_3_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_3_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_4_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_4_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_4_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_4_failed_cast", + "type": "Bool", + "value": { "constructor": "False", "argtypes": [], "arguments": [] } + }, + { + "vname": "test_7_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_7_h_res", + "type": "Option Int256", + "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { "vname": "f", "type": "Uint128", "value": "128" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "242" }, + { "vname": "f", "type": "String", "value": "0xabfeccdc9012345678567890f777564324" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + } + ] + } +] diff --git a/tests/runner/type_casts/state_42.json b/tests/runner/type_casts/state_42.json new file mode 100644 index 000000000..fcc6ed359 --- /dev/null +++ b/tests/runner/type_casts/state_42.json @@ -0,0 +1,162 @@ +[ + { "vname": "_balance", "type": "Uint128", "value": "0" }, + { + "vname": "test_1_res", + "type": "Option (ByStr20 with end)", + "value": { "constructor": "None", "argtypes": ["ByStr20 with end"], "arguments": [] } + }, + { + "vname": "test_2_res", + "type": "Option (ByStr20 with contract end)", + "value": { "constructor": "None", "argtypes": ["ByStr20 with contract end"], "arguments": [] } + }, + { + "vname": "test_3_res", + "type": "Option (ByStr20 with contract end)", + "value": { "constructor": "None", "argtypes": ["ByStr20 with contract end"], "arguments": [] } + }, + { + "vname": "test_4_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_5_1_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_5_2_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_1_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_1_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_1_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_2_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_2_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_2_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_3_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_3_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_3_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_4_bal_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_4_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_6_4_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_6_4_failed_cast", + "type": "Bool", + "value": { "constructor": "False", "argtypes": [], "arguments": [] } + }, + { + "vname": "test_7_g_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_7_h_res", + "type": "Option Int256", + "value": { "constructor": "None", "argtypes": ["Int256"], "arguments": [] } + }, + { + "vname": "test_9_f_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_10_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_10_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "test_11_f_immut_res", + "type": "Option Uint128", + "value": { "constructor": "None", "argtypes": ["Uint128"], "arguments": [] } + }, + { + "vname": "test_11_g_immut_res", + "type": "Option Bool", + "value": { "constructor": "None", "argtypes": ["Bool"], "arguments": [] } + }, + { + "vname": "test_11_f_mut_res", + "type": "Option String", + "value": { "constructor": "None", "argtypes": ["String"], "arguments": [] } + }, + { + "vname": "_external", + "type": "Unit", + "value": [ + { + "address": "0xabfeccdc9012345678901234567890f777564323", + "cparams": [ + { "vname": "f", "type": "Uint128", "value": "128" }, + { "vname": "g", "type": "String", "value": "constructor" } + ], + "state": [ + { "vname": "_nonce", "type": "Uint64", "value": "0" }, + { "vname": "_balance", "type": "Uint128", "value": "242" }, + { "vname": "f", "type": "String", "value": "0xabfeccdc9012345678567890f777564324" }, + { "vname": "_this_address", "type": "ByStr20", "value": "0xabfeccdc9012345678901234567890f777564323" } + ] + } + ] + } +] From e8c7f0493e879379d896b566ecc04db8901c74a2 Mon Sep 17 00:00:00 2001 From: Georgiy Komarov Date: Sun, 26 Feb 2023 16:39:01 +0700 Subject: [PATCH 29/33] feat(dcd): Support immutable reads --- src/base/DeadCodeDetector.ml | 233 +++++++++++------- .../good/gold/dead_code_test18.scilla.gold | 43 +++- tests/contracts/dead_code_test18.scilla | 12 +- 3 files changed, 194 insertions(+), 94 deletions(-) diff --git a/src/base/DeadCodeDetector.ml b/src/base/DeadCodeDetector.ml index cc4bfe4a4..36921e958 100644 --- a/src/base/DeadCodeDetector.ml +++ b/src/base/DeadCodeDetector.ml @@ -535,115 +535,171 @@ module DeadCodeDetector (SR : Rep) (ER : Rep) = struct Map.merge m1 m2 ~f:(fun ~key:_ -> function | `Both (s1, s2) -> Some (Set.union s1 s2) | `Left s | `Right s -> Some s) - (** Returns a list of fields with the contract address type from - [address_params] that are used in [s]. *) - let rec get_used_address_fields address_params (s, _annot) = + (** Returns maps of immutable and mutable fields with the contract address + type from [address_params] that are used in [s]. *) + let rec get_used_address_fields (s, _annot) = match s with - | RemoteLoad (_, addr, field, _) | RemoteMapGet (_, addr, field, _, _, _) -> - Map.set emp_idsmap ~key:(get_id addr) - ~data:(SCIdentifierSet.singleton (get_id field)) + | RemoteLoad (_, addr, field, Immutable) + | RemoteMapGet (_, addr, field, Immutable, _, _) -> + ( Map.set emp_idsmap ~key:(get_id addr) + ~data:(SCIdentifierSet.singleton (get_id field)), + emp_idsmap ) + | RemoteLoad (_, addr, field, Mutable) + | RemoteMapGet (_, addr, field, Mutable, _, _) -> + ( emp_idsmap, + Map.set emp_idsmap ~key:(get_id addr) + ~data:(SCIdentifierSet.singleton (get_id field)) ) | MatchStmt (_id, arms) -> - List.fold_left arms ~init:emp_idsmap ~f:(fun m (_pattern, stmts) -> - List.fold_left stmts ~init:emp_idsmap ~f:(fun m sa -> - get_used_address_fields address_params sa |> merge_id_maps m) - |> merge_id_maps m) + List.fold_left arms ~init:(emp_idsmap, emp_idsmap) + ~f:(fun (immut_m, mut_m) (_pattern, stmts) -> + let immut_m', mut_m' = + List.fold_left stmts ~init:(emp_idsmap, emp_idsmap) + ~f:(fun (immut_m', mut_m') sa -> + let immut_m'', mut_m'' = get_used_address_fields sa in + ( merge_id_maps immut_m' immut_m'', + merge_id_maps mut_m' mut_m'' )) + in + (merge_id_maps immut_m immut_m', merge_id_maps mut_m mut_m')) | Bind _ | Load _ | Store _ | MapUpdate _ | MapGet _ | ReadFromBC _ | TypeCast _ | AcceptPayment | Iterate _ | SendMsgs _ | CreateEvnt _ | CallProc _ | Throw _ | GasStmt _ -> - emp_idsmap + (emp_idsmap, emp_idsmap) (** Returns a set of field names of the contract address type. *) - let get_addr_fields addr = - List.fold_left (SType.IdLoc_Comp.Map.keys addr) ~init:emp_idset + let get_addr_fields fields = + List.fold_left (SType.IdLoc_Comp.Map.keys fields) ~init:emp_idset ~f:(fun s id -> SCIdentifierSet.add s (get_id id)) - (** Updates a map of identifiers [m] iff [ty] has contract address type. - [m] has the following structure: [id |-> F] where [F] is a set of field - names used in the contract address type. *) - let update_contract_params_map m id ty = + (** Returns sets with names of immutable and mutable fields of the contract + address type [ty]. *) + let find_contract_type_fields ty = match ty with - | SType.Address (ContrAddr (_im_addr, m_addr)) -> - let data = get_addr_fields m_addr in - Map.set m ~key:(SCIdentifier.get_id id) ~data - | _ -> m - - (** Checks for unused fields in contract address types of [comp]'s - parameters. - Returns a set of ids of contract parameters used in this [comp]. *) - let check_contract_address_types_in_params used_contract_params - contract_params comp = - let address_params = - List.fold_left comp.comp_params ~init:contract_params - ~f:(fun m (id, ty) -> update_contract_params_map m id ty) + | SType.Address (ContrAddr (immutable_fields, mutable_fields)) -> + Some (get_addr_fields immutable_fields, get_addr_fields mutable_fields) + | _ -> None + + (** Takes the procedure/transition [comp] and looks for unused fields in its parameters. + Returns maps of immutable and mutable fields of the contract parameters used + in the body of [comp]. + Arguments: + - [contr_immut_used] and [contr_mut_used] are parameters of the + contract that are known as used. + - [contr_immut_fields] and [contr_mut_fields] are all the fields of the + contract. *) + let check_addresses_in_params (comp : component) contr_immut_used + contr_mut_used contr_immut_fields contr_mut_fields = + (* Collect fields of contract address types from parameters of the component *) + let immut_address_params, mut_address_params = + List.fold_left comp.comp_params + ~init:(contr_immut_fields, contr_mut_fields) + ~f:(fun (immut_m, mut_m) (id, ty) -> + find_contract_type_fields ty + |> Option.value_map ~default:(immut_m, mut_m) + ~f:(fun (immut_fields, mut_fields) -> + let update_map m data = + Map.set m ~key:(SCIdentifier.get_id id) ~data + in + (update_map immut_m immut_fields, update_map mut_m mut_fields))) in - let used_addresses = + (* Collect fields of contract address types used in the body of the component *) + let immut_used_addresses, mut_used_addresses = (* addr |-> set of used fields *) - List.fold_left comp.comp_body ~init:emp_idsmap ~f:(fun m s -> - get_used_address_fields address_params s |> merge_id_maps m) + List.fold_left comp.comp_body ~init:(emp_idsmap, emp_idsmap) + ~f:(fun (immut_m, mut_m) s -> + let immut_m', mut_m' = get_used_address_fields s in + (merge_id_maps immut_m immut_m', merge_id_maps mut_m mut_m')) in - (* Generate warnings for unused fields in component arguments. *) + (* Generate warnings for unused fields in component parameters *) List.iter comp.comp_params ~f:(fun (id, ty) -> - let name = get_id id in - match (Map.find address_params name, Map.find used_addresses name) with - | Some fields, Some used_fields - when not @@ phys_equal (Set.length fields) (Set.length used_fields) - -> ( - match ty with - | SType.Address (ContrAddr (_ims, ms)) -> - List.iter (SType.IdLoc_Comp.Map.keys ms) ~f:(fun id -> - let name = get_id id in - if Set.mem fields name && (not @@ Set.mem used_fields name) - then - warn1 - ("Unused field in contract address type: " - ^ as_error_string id) - warning_level_dead_code - (SType.TIdentifier.get_rep id)) - | _ -> ()) + match ty with + | SType.Address (ContrAddr (ims, ms)) -> + let name = get_id id in + let find_unused address_fields params used_params warn_name = + match (Map.find params name, Map.find used_params name) with + | Some fields, Some used_fields + when not + @@ phys_equal (Set.length fields) (Set.length used_fields) + -> + List.iter (SType.IdLoc_Comp.Map.keys address_fields) + ~f:(fun id -> + let name = get_id id in + if Set.mem fields name && (not @@ Set.mem used_fields name) + then + warn1 + ("Unused " ^ warn_name ^ " in contract address type: " + ^ as_error_string id) + warning_level_dead_code + (SType.TIdentifier.get_rep id)) + | _ -> () + in + (* Handle immutable fields *) + find_unused ims immut_address_params immut_used_addresses + "contract parameter"; + (* Handle mutable fields *) + find_unused ms mut_address_params mut_used_addresses "field" | _ -> ()); - (* Collect fields of the [cmod] contract with contract address types used + (* Collect fields of the contract with contract address types used in this component. *) - Map.keys used_addresses - |> List.fold_left ~init:used_contract_params ~f:(fun used_ids_map used_id -> - let used_fields = Map.find_exn used_addresses used_id in - match Map.find used_ids_map used_id with - | Some used_fields -> - let data = used_fields |> Set.union used_fields in - Map.set used_ids_map ~key:used_id ~data - | None -> Map.set used_ids_map ~key:used_id ~data:used_fields) + let collect contr_used comp_used = + Map.keys comp_used + |> List.fold_left ~init:contr_used ~f:(fun used_ids_map used_id -> + let used_fields = Map.find_exn comp_used used_id in + match Map.find used_ids_map used_id with + | Some used_fields -> + let data = used_fields |> Set.union used_fields in + Map.set used_ids_map ~key:used_id ~data + | None -> Map.set used_ids_map ~key:used_id ~data:used_fields) + in + ( collect contr_immut_used immut_used_addresses, + collect contr_mut_used mut_used_addresses ) (** Checks for unused fields in contract address types occurred in contract parameters and parameters of contract's components. *) let check_param_contract_address_types cmod = - let contract_params = - List.fold_left cmod.contr.cparams ~init:emp_idsmap ~f:(fun m (id, ty) -> - update_contract_params_map m id ty) + (* Collect names of fields in address types of contract params *) + let contr_immut, contr_mut = + List.fold_left cmod.contr.cparams ~init:(emp_idsmap, emp_idsmap) + ~f:(fun (immut_m, mut_m) (id, ty) -> + find_contract_type_fields ty + |> Option.value_map ~default:(immut_m, mut_m) + ~f:(fun (immut_fields', mut_fields') -> + let update_map m data = + Map.set m ~key:(SCIdentifier.get_id id) ~data + in + (update_map immut_m immut_fields', update_map mut_m mut_fields'))) in - let used_contract_params = - List.fold_left cmod.contr.ccomps ~init:emp_idsmap ~f:(fun used c -> - check_contract_address_types_in_params used contract_params c) + let contr_immut_used, contr_mut_used = + List.fold_left cmod.contr.ccomps ~init:(emp_idsmap, emp_idsmap) + ~f:(fun (immut_used, mut_used) comp -> + check_addresses_in_params comp immut_used mut_used contr_immut + contr_mut) in - (* Report unused contract parameters with contract address types. *) - Map.keys contract_params - |> List.iter ~f:(fun param -> - match Map.find used_contract_params param with - | Some used_fields -> - let all_fields = Map.find_exn contract_params param in - let unused_fields = Set.diff all_fields used_fields in - if not @@ Set.is_empty unused_fields then - List.iter cmod.contr.cparams ~f:(fun (id, _ty) -> - if SCIdentifier.Name.equal param (SCIdentifier.get_id id) - then - Set.iter unused_fields ~f:(fun f -> - warn1 - ("Unused field in contract address type: " - ^ SCIdentifier.Name.as_string f) - warning_level_dead_code - (ER.get_loc (SCIdentifier.get_rep id)))) - | None -> - (* All the fields of [param] are unused, so we don't report it. - It is an unused contract parameter.*) - ()) + (* Report unused contract parameters with contract address types *) + let check fields used warn_name = + Map.keys fields + |> List.iter ~f:(fun param -> + match Map.find used param with + | Some used_fields -> + let all_fields = Map.find_exn fields param in + let unused_fields = Set.diff all_fields used_fields in + if not @@ Set.is_empty unused_fields then + List.iter cmod.contr.cparams ~f:(fun (id, _ty) -> + if SCIdentifier.Name.equal param (SCIdentifier.get_id id) + then + Set.iter unused_fields ~f:(fun f -> + warn1 + ("Unused " ^ warn_name + ^ " in contract address type: " + ^ SCIdentifier.Name.as_string f) + warning_level_dead_code + (ER.get_loc (SCIdentifier.get_rep id)))) + | None -> + (* All the fields of [param] are unused, so we don't report it. + It is an unused contract parameter.*) + ()) + in + check contr_immut contr_immut_used "contract_parameter"; + check contr_mut contr_mut_used "field" type adts_ty = ( Name.t, @@ -774,7 +830,8 @@ module DeadCodeDetector (SR : Rep) (ER : Rep) = struct in ignore @@ Stack.pop env_stack; res)) - | RemoteLoad (_, addr, field, _) | RemoteMapGet (_, addr, field, _, _, _) -> ( + | RemoteLoad (_, addr, field, _) | RemoteMapGet (_, addr, field, _, _, _) + -> ( match env_find_bind (SCIdentifier.get_id addr) with | Some (ctr_name, ctr_arg_pos) when Map.mem adt_ctrs ctr_name -> let ctr_arg_pos_to_fields = diff --git a/tests/checker/good/gold/dead_code_test18.scilla.gold b/tests/checker/good/gold/dead_code_test18.scilla.gold index 3e5e60dcd..fce821f2d 100644 --- a/tests/checker/good/gold/dead_code_test18.scilla.gold +++ b/tests/checker/good/gold/dead_code_test18.scilla.gold @@ -1,6 +1,8 @@ { "cashflow_tags": { - "State variables": [], + "State variables": [ + { "field": "remote_reads_test_res_1", "tag": "NoInfo" } + ], "ADT constructors": [ { "dead_code_test18.A": [ @@ -16,11 +18,22 @@ "scilla_major_version": "0", "vname": "Dead18", "params": [], - "fields": [], + "fields": [ + { "vname": "remote_reads_test_res_1", "type": "Uint128", "depth": 0 } + ], "transitions": [ { - "vname": "test", + "vname": "test_mutables", "params": [ { "vname": "a", "type": "dead_code_test18.A" } ] + }, + { + "vname": "read_cparam_1", + "params": [ + { + "vname": "remote1", + "type": "ByStr20 with contract (unused : Uint128, used : Uint128) end" + } + ] } ], "procedures": [ @@ -118,6 +131,16 @@ ] }, "warnings": [ + { + "warning_message": "Write only field: remote_reads_test_res_1", + "start_location": { + "file": "contracts/dead_code_test18.scilla", + "line": 67, + "column": 3 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, { "warning_message": "Unused field in contract address type: a1_unused2_3", "start_location": { @@ -148,11 +171,21 @@ "end_location": { "file": "", "line": 0, "column": 0 }, "warning_id": 3 }, + { + "warning_message": "Unused contract parameter in contract address type: unused", + "start_location": { + "file": "contracts/dead_code_test18.scilla", + "line": 64, + "column": 35 + }, + "end_location": { "file": "", "line": 0, "column": 0 }, + "warning_id": 3 + }, { "warning_message": "Unused match bound: num", "start_location": { "file": "contracts/dead_code_test18.scilla", - "line": 33, + "line": 35, "column": 23 }, "end_location": { "file": "", "line": 0, "column": 0 }, @@ -162,7 +195,7 @@ "warning_message": "Unused match bound: a12_unused", "start_location": { "file": "contracts/dead_code_test18.scilla", - "line": 33, + "line": 35, "column": 27 }, "end_location": { "file": "", "line": 0, "column": 0 }, diff --git a/tests/contracts/dead_code_test18.scilla b/tests/contracts/dead_code_test18.scilla index 685377c01..f438fc0a9 100644 --- a/tests/contracts/dead_code_test18.scilla +++ b/tests/contracts/dead_code_test18.scilla @@ -28,6 +28,8 @@ type A = contract Dead18 () +field remote_reads_test_res_1 : Uint128 = Uint128 0 + procedure use_a1 (a1 : A) match a1 with | A1_has_unused a11 num a12_unused a13 => @@ -52,7 +54,15 @@ procedure use_a2 (a2 : A) end end -transition test(a : A) +transition test_mutables(a : A) use_a1 a; use_a2 a end + +transition read_cparam_1( + remote1: ByStr20 with contract (used : Uint128, + unused: Uint128) + end) + tmp_1 <-& remote1.(used); + remote_reads_test_res_1 := tmp_1 +end From 21550eed51f693b7c03ce38c420d4b7b522120c3 Mon Sep 17 00:00:00 2001 From: Georgiy Komarov Date: Sun, 26 Feb 2023 16:53:51 +0700 Subject: [PATCH 30/33] feat(merge): Add tests --- .../gold/remote_collisions1.scilla.gold | 20 +++++++++++++++---- tests/merge/static/remote_collisions11.scilla | 15 ++++++++++++-- tests/merge/static/remote_collisions12.scilla | 2 +- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/tests/merge/static/gold/remote_collisions1.scilla.gold b/tests/merge/static/gold/remote_collisions1.scilla.gold index 31c71fa40..5d1f91fbe 100644 --- a/tests/merge/static/gold/remote_collisions1.scilla.gold +++ b/tests/merge/static/gold/remote_collisions1.scilla.gold @@ -5,9 +5,17 @@ import BoolUtils library MergedLib -contract MergedContr () +contract MergedContr + ( + remoteCollisions12_param1 : Uint128, + remoteCollisions12_param2 : Uint128 + ) +field remoteCollisions11_param1_read_res : Uint128 = Uint128 0 + +field remoteCollisions11_param2_read_res : Uint128 = Uint128 0 + field remoteCollisions11_f : Bool = False field remoteCollisions11_z : Uint32 = Uint32 0 @@ -29,10 +37,14 @@ transition remoteCollisions11_tr (a : ByStr20) remoteCollisions11_f <- (remoteCollisions12_a_f|remoteCollisions13_a_f); remoteCollisions11_f <- remoteCollisions12_a_f2; k <- remoteCollisions11_z; - remoteCollisions11_f <- (remoteCollisions12_m_f|remoteCollisions13_m_f)[k] + remoteCollisions11_f <- (remoteCollisions12_m_f|remoteCollisions13_m_f)[k]; + param1_tmp = remoteCollisions12_param1; + remoteCollisions11_param1_read_res := param1_tmp; + param2_tmp = remoteCollisions12_param2; + remoteCollisions11_param2_read_res := param2_tmp | None => end end -merge/static/remote_collisions11.scilla:21:15: warning: [2] Name collision: Please disambiguate `m_f` in the configuration file -merge/static/remote_collisions11.scilla:18:15: warning: [2] Name collision: Please disambiguate `a_f` in the configuration file +merge/static/remote_collisions11.scilla:25:15: warning: [2] Name collision: Please disambiguate `m_f` in the configuration file +merge/static/remote_collisions11.scilla:22:15: warning: [2] Name collision: Please disambiguate `a_f` in the configuration file diff --git a/tests/merge/static/remote_collisions11.scilla b/tests/merge/static/remote_collisions11.scilla index 14e4820c9..d9d4ad022 100644 --- a/tests/merge/static/remote_collisions11.scilla +++ b/tests/merge/static/remote_collisions11.scilla @@ -4,21 +4,32 @@ library RemoteCollisions11 contract RemoteCollisions11() +field param1_read_res: Uint128 = Uint128 0 +field param2_read_res: Uint128 = Uint128 0 field f: Bool = False field z: Uint32 = Uint32 0 transition tr(a: ByStr20) - a_opt <- & a as ByStr20 with contract + a_opt <- & a as ByStr20 with contract (param1: Uint128, + param2: Uint128) field a_f: Bool, field a_f2: Bool, field m_f: Map Uint32 Bool end; match a_opt with | Some aa => + (* Read mutables *) f <- & aa.a_f; f <- & aa.a_f2; k <- z; - f <- & aa.m_f[k] + f <- & aa.m_f[k]; + (* Read immutables + This doesn't require disambiguation, because contract parameters + in remote_collisions12.scilla are renamed. *) + param1_tmp <-& aa.(param1); + param1_read_res := param1_tmp; + param2_tmp <-& aa.(param2); + param2_read_res := param2_tmp | None => end end diff --git a/tests/merge/static/remote_collisions12.scilla b/tests/merge/static/remote_collisions12.scilla index 35c9251e4..399845841 100644 --- a/tests/merge/static/remote_collisions12.scilla +++ b/tests/merge/static/remote_collisions12.scilla @@ -2,7 +2,7 @@ scilla_version 0 library RemoteCollisions12 -contract RemoteCollisions12() +contract RemoteCollisions12(param1: Uint128, param2: Uint128) field a_f: Bool = False field a_f2: Bool = False From 678580a05369ad1a6b2cd5d226b6fa73ccc56d05 Mon Sep 17 00:00:00 2001 From: Georgiy Komarov Date: Sun, 26 Feb 2023 17:19:07 +0700 Subject: [PATCH 31/33] fix(formatter): Typo --- tests/formatter/look_and_feel/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/formatter/look_and_feel/README.md b/tests/formatter/look_and_feel/README.md index 9d92e122e..2d0c51650 100644 --- a/tests/formatter/look_and_feel/README.md +++ b/tests/formatter/look_and_feel/README.md @@ -5,7 +5,7 @@ integrated into the Dune build system. Each directory is a separate test and the directory name must end with `.t`. Also, each directory contains one contract or expression to format and the `run.t` script which calls `scilla-fmt` on its contract or expression -and and shows the expected output on the next line. +and shows the expected output on the next line. To run cram tests use the `dune runtests` command. To update tests when the formatter behavior changes run `dune promote`. From 9a142fe8ff8546b41e579a4845132ef52520f636 Mon Sep 17 00:00:00 2001 From: Georgiy Komarov Date: Sun, 26 Feb 2023 17:24:49 +0700 Subject: [PATCH 32/33] feat(formatter): Add test for immutable reads --- .../remote_state_reads_cparam.scilla | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 tests/formatter/ast_does_not_change.t/remote_state_reads_cparam.scilla diff --git a/tests/formatter/ast_does_not_change.t/remote_state_reads_cparam.scilla b/tests/formatter/ast_does_not_change.t/remote_state_reads_cparam.scilla new file mode 100644 index 000000000..afd12eb2b --- /dev/null +++ b/tests/formatter/ast_does_not_change.t/remote_state_reads_cparam.scilla @@ -0,0 +1,140 @@ +scilla_version 0 + +library RRCPLib + +(* Tests various aspects of address types with contract parameters *) +type AddressADT = +| Address1 of ByStr20 with end +| Address2 of ByStr20 with contract (param : ByStr20 with contract (x : Uint128) end) field admin : ByStr20 with end end + +contract RRCPContract ( + cparam1: ByStr20 with contract (admin : ByStr20) end) + +field remote_reads_test_res_1 : Uint128 = Uint128 0 (* (x) of remote1 *) +field remote_reads_test_res_2 : AddressADT = Address1 cparam1 (* (x) of remote2 *) +field remote_reads_test_res_3_2 : Uint128 = Uint128 0 (* (x) of remote3, then (x) of (x) *) +field remote_reads_test_res_3_3 : Uint64 = Uint64 0 (* (x) of remote3, then y of (x) *) +field remote_reads_test_res_4_1 : Uint128 = Uint128 0 (* (x) of remote4 *) +field remote_reads_test_res_4_2 : String = "" (* (y) of remote4 *) +field remote_reads_test_res_5_1 : Map Uint128 Bool = Emp Uint128 Bool (* (x) of remote5 *) +field remote_reads_test_res_5_3 : Option Bool = None { Bool } (* exists (x)[0] of remote5 *) +field remote_reads_test_res_5_5 : Option (Option Bool) = None { (Option Bool) } (* (x)[0] of remote5 *) +field remote_reads_test_res_6_1 : Uint128 = Uint128 0 (* (x) of remote6 *) +field remote_reads_test_res_6_2 : String = "" (* x of remote6 *) +field remote_reads_test_res_7_3 : Option Bool = None { Bool } (* (x) = x in remote7 *) +field remote_reads_test_res_7_6 : Option Bool = None { Bool } (* (y) = y in remote7 *) +field remote_reads_test_res_8 : Uint128 = Uint128 0 (* remote.(admin).(f).(g) *) +field remote_reads_test_res_9 : Option Uint128 = None {Uint128} (* remote.(admin).(f).(g)[0] *) +field remote_reads_test_res_10 : ByStr20 = _this_address (* cparam1.(admin) *) +field address_type_erasure_test_res_1 : Map Uint128 (ByStr20 with end) = Emp Uint128 (ByStr20 with end) (* field[0] := cparam1 *) + + + +transition RemoteReadContractParameterTest1( + remote1: ByStr20 with contract (x : Uint128) end + ) + tmp_1 <-& remote1.(x); + remote_reads_test_res_1 := tmp_1 +end + +transition RemoteReadContractParameterTest2( + remote2: ByStr20 with contract (x : AddressADT) end + ) + tmp_2 <-& remote2.(x); + remote_reads_test_res_2 := tmp_2 +end + +transition RemoteReadContractParameterTest3( + remote3: ByStr20 with contract (x : ByStr20 with contract (x : Uint128) field y : Uint64 end) end + ) + tmp_3_1 <-& remote3.(x); + tmp_3_2 <-& tmp_3_1.(x); + remote_reads_test_res_3_2 := tmp_3_2; + tmp_3_3 <-& tmp_3_1.y; + remote_reads_test_res_3_3 := tmp_3_3 +end + +transition RemoteReadContractParameterTest4( + remote4: ByStr20 with contract (x : Uint128, y : String) end + ) + tmp_4_1 <-& remote4.(x); + tmp_4_2 <-& remote4.(y); + remote_reads_test_res_4_1 := tmp_4_1; + remote_reads_test_res_4_2 := tmp_4_2 +end + +transition RemoteReadContractParameterTest5( + remote5: ByStr20 with contract (x : Map Uint128 Bool) end + ) + tmp_5_1 <-& remote5.(x); + remote_reads_test_res_5_1 := tmp_5_1; + zero = Uint128 0 ; + tmp_5_2 <-& exists remote5.(x)[zero]; + tmp_5_3 = Some { Bool } tmp_5_2; + remote_reads_test_res_5_3 := tmp_5_3; + tmp_5_4 <-& remote5.(x)[zero]; + tmp_5_5 = Some { (Option Bool) } tmp_5_4; + remote_reads_test_res_5_5 := tmp_5_5 +end + +transition RemoteReadContractParameterTest6( + remote6: ByStr20 with contract (x : Uint128) field x : String end + ) + tmp_6_1 <-& remote6.(x); + remote_reads_test_res_6_1 := tmp_6_1; + tmp_6_2 <-& remote6.x; + remote_reads_test_res_6_2 := tmp_6_2 +end + +transition RemoteReadContractParameterTest7( + remote7: ByStr20 with contract (x : Uint128, y : Uint64) field y : Uint64, field x : Uint128 end + ) + tmp_7_1 <-& remote7.(x); + tmp_7_2 <-& remote7.x; + tmp_7_3 = let res = builtin eq tmp_7_1 tmp_7_2 in Some { Bool } res; + remote_reads_test_res_7_3 := tmp_7_3; + tmp_7_4 <-& remote7.(y); + tmp_7_5 <-& remote7.y; + tmp_7_6 = let res = builtin eq tmp_7_4 tmp_7_5 in Some { Bool } res; + remote_reads_test_res_7_6 := tmp_7_6 +end + +transition RemoteReadContractParameterTest8( + remote: ByStr20 with contract (admin : ByStr20 with contract (f : ByStr20 with contract (g : Uint128) end) end) end) + ad <-& remote.(admin); + this_f <-& ad.(f); + this_g <-& this_f.(g); + remote_reads_test_res_8 := this_g +end + +transition RemoteReadContractParameterTest9( + remote: ByStr20 with contract (admin : ByStr20 with contract (f : ByStr20 with contract (g : Map Uint128 Uint128) end) end) end) + ad <-& remote.(admin); + this_f <-& ad.(f); + remote_key = Uint128 0; + this_g <-& this_f.(g)[remote_key]; + remote_reads_test_res_9 := this_g +end + +transition RemoteReadContractParameterTest10() + ad <-& cparam1.(admin); + remote_reads_test_res_10 := ad +end + +transition RemoteReadContractParameterTest11( + remote: ByStr20 with contract (x : Uint128) field y : String end + ) +end + +transition AddressTypeErasureTest1() + zero = Uint128 0; + address_type_erasure_test_res_1[zero] := cparam1 +end + +transition AddressTypeErasureTest2() + zero = Uint128 0; + emp_map <- address_type_erasure_test_res_1; + new_map = builtin put emp_map zero cparam1; + address_type_erasure_test_res_1 := new_map +end + From 4e007b02eebe215aade4360678351bda03af803e Mon Sep 17 00:00:00 2001 From: Georgiy Komarov Date: Tue, 28 Feb 2023 10:26:40 +0700 Subject: [PATCH 33/33] fix(tests): Update cram tests for JSON --- tests/formatter/to_json/ark.t/run.t | 2 +- tests/formatter/to_json/codehash.t/run.t | 2 +- tests/formatter/to_json/crowdfunding_governor.t/run.t | 2 +- tests/formatter/to_json/polymorphic_address.t/run.t | 2 +- tests/formatter/to_json/remote_state_reads.t/run.t | 2 +- tests/formatter/to_json/simple-dex-remote-reads.t/run.t | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/formatter/to_json/ark.t/run.t b/tests/formatter/to_json/ark.t/run.t index 720610667..baaff83c9 100644 --- a/tests/formatter/to_json/ark.t/run.t +++ b/tests/formatter/to_json/ark.t/run.t @@ -1,2 +1,2 @@ $ scilla-fmt --json --deannot ark.scilla - {"smver":0,"libs":{"lname":["Ident",["SimpleLocal","ARK"],null],"lentries":[["LibTyp",["Ident",["SimpleLocal","Denom"],null],[{"cname":["Ident",["SimpleLocal","Zil"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","Token"],null],"c_arg_types":[["PrimType",["Bystrx_typ",20]]]}]],["LibTyp",["Ident",["SimpleLocal","Coins"],null],[{"cname":["Ident",["SimpleLocal","Coins"],null],"c_arg_types":[["ADT",["Ident",["SimpleLocal","Denom"],{"fname":"","lnum":0,"cnum":0}],[]],["PrimType",["Uint_typ",["Bits128"]]]]}]],["LibTyp",["Ident",["SimpleLocal","NFT"],null],[{"cname":["Ident",["SimpleLocal","NFT"],null],"c_arg_types":[["Address","Address"],["PrimType",["Uint_typ",["Bits256"]]]]}]],["LibTyp",["Ident",["SimpleLocal","Side"],null],[{"cname":["Ident",["SimpleLocal","Buy"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","Sell"],null],"c_arg_types":[]}]],["LibTyp",["Ident",["SimpleLocal","Cheque"],null],[{"cname":["Ident",["SimpleLocal","Cheque"],null],"c_arg_types":[["ADT",["Ident",["SimpleLocal","Side"],{"fname":"","lnum":0,"cnum":0}],[]],["PrimType",["Bnum_typ"]],["PrimType",["Uint_typ",["Bits128"]]],["PrimType",["Bystrx_typ",33]],["PrimType",["Bystrx_typ",64]]]}]],["LibTyp",["Ident",["SimpleLocal","Action"],null],[{"cname":["Ident",["SimpleLocal","Execute"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","Void"],null],"c_arg_types":[]}]],["LibVar",["Ident",["SimpleLocal","zero"],null],null,[["Literal","0"],null]],["LibVar",["Ident",["SimpleLocal","none"],null],null,[["Constr",["Ident",["SimpleLocal","None"],null],[["PrimType",["Bystrx_typ",20]]],[]],null]],["LibVar",["Ident",["SimpleLocal","true"],null],null,[["Constr",["Ident",["SimpleLocal","True"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","buy"],null],null,[["Constr",["Ident",["SimpleLocal","Buy"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","sell"],null],null,[["Constr",["Ident",["SimpleLocal","Sell"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","zil"],null],null,[["Constr",["Ident",["SimpleLocal","Zil"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","signed_message_prefix"],null],null,[["Literal","Zilliqa Signed Message ("],null]],["LibVar",["Ident",["SimpleLocal","signed_message_suffix"],null],null,[["Literal","):\n"],null]],["LibVar",["Ident",["SimpleLocal","execute_prefix"],null],null,[["Literal","Execute ARK Cheque "],null]],["LibVar",["Ident",["SimpleLocal","void_prefix"],null],null,[["Literal","Void ARK Cheque "],null]],["LibVar",["Ident",["SimpleLocal","execute"],null],null,[["Constr",["Ident",["SimpleLocal","Execute"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","void"],null],null,[["Constr",["Ident",["SimpleLocal","Void"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","one_msg"],null],null,[["Fun",["Ident",["SimpleLocal","msg"],null],["PrimType",["Msg_typ"]],[["Let",["Ident",["SimpleLocal","nil_msg"],null],null,[["Constr",["Ident",["SimpleLocal","Nil"],null],[["PrimType",["Msg_typ"]]],[]],null],[["Constr",["Ident",["SimpleLocal","Cons"],null],[["PrimType",["Msg_typ"]]],[["Ident",["SimpleLocal","msg"],null],["Ident",["SimpleLocal","nil_msg"],null]]],null]],null]],null]],["LibTyp",["Ident",["SimpleLocal","Error"],null],[{"cname":["Ident",["SimpleLocal","CodeNotOwner"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeNotPendingOwner"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodePendingOwnerNotEmpty"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeTokenProxyNotSet"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeTokenProxyAlreadySet"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeSignatureInvalid"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeChequeAlreadyVoided"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeChequeExpired"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeInvalidPrice"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeInvalidFee"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeInvalidSide"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeInvalidOwner"],null],"c_arg_types":[]}]],["LibVar",["Ident",["SimpleLocal","make_error"],null],null,[["Fun",["Ident",["SimpleLocal","result"],null],["ADT",["Ident",["SimpleLocal","Error"],{"fname":"","lnum":0,"cnum":0}],[]],[["Let",["Ident",["SimpleLocal","result_code"],null],null,[["MatchExpr",["Ident",["SimpleLocal","result"],null],[[["Constructor",["Ident",["SimpleLocal","CodeNotOwner"],null],[]],[["Literal","-1"],null]],[["Constructor",["Ident",["SimpleLocal","CodeNotPendingOwner"],null],[]],[["Literal","-2"],null]],[["Constructor",["Ident",["SimpleLocal","CodePendingOwnerNotEmpty"],null],[]],[["Literal","-3"],null]],[["Constructor",["Ident",["SimpleLocal","CodeTokenProxyNotSet"],null],[]],[["Literal","-4"],null]],[["Constructor",["Ident",["SimpleLocal","CodeTokenProxyAlreadySet"],null],[]],[["Literal","-5"],null]],[["Constructor",["Ident",["SimpleLocal","CodeSignatureInvalid"],null],[]],[["Literal","-6"],null]],[["Constructor",["Ident",["SimpleLocal","CodeChequeAlreadyVoided"],null],[]],[["Literal","-7"],null]],[["Constructor",["Ident",["SimpleLocal","CodeChequeExpired"],null],[]],[["Literal","-8"],null]],[["Constructor",["Ident",["SimpleLocal","CodeInvalidPrice"],null],[]],[["Literal","-9"],null]],[["Constructor",["Ident",["SimpleLocal","CodeInvalidFee"],null],[]],[["Literal","-10"],null]],[["Constructor",["Ident",["SimpleLocal","CodeInvalidSide"],null],[]],[["Literal","-11"],null]],[["Constructor",["Ident",["SimpleLocal","CodeInvalidOwner"],null],[]],[["Literal","-12"],null]]]],null],[["Message",[["_exception",["MLit","Error"]],["code",["MVar",["Ident",["SimpleLocal","result_code"],null]]]]],null]],null]],null]],["LibVar",["Ident",["SimpleLocal","get_action_prefix"],null],null,[["Fun",["Ident",["SimpleLocal","action"],null],["ADT",["Ident",["SimpleLocal","Action"],{"fname":"","lnum":0,"cnum":0}],[]],[["MatchExpr",["Ident",["SimpleLocal","action"],null],[[["Constructor",["Ident",["SimpleLocal","Execute"],null],[]],[["Var",["Ident",["SimpleLocal","execute_prefix"],null]],null]],[["Constructor",["Ident",["SimpleLocal","Void"],null],[]],[["Var",["Ident",["SimpleLocal","void_prefix"],null]],null]]]],null]],null]],["LibVar",["Ident",["SimpleLocal","get_account"],null],null,[["Fun",["Ident",["SimpleLocal","cheque"],null],["ADT",["Ident",["SimpleLocal","Cheque"],{"fname":"","lnum":0,"cnum":0}],[]],[["MatchExpr",["Ident",["SimpleLocal","cheque"],null],[[["Constructor",["Ident",["SimpleLocal","Cheque"],null],[["Binder",["Ident",["SimpleLocal","direction"],null]],["Binder",["Ident",["SimpleLocal","expiry"],null]],["Binder",["Ident",["SimpleLocal","nonce"],null]],["Binder",["Ident",["SimpleLocal","pubkey"],null]],["Binder",["Ident",["SimpleLocal","signature"],null]]]],[["Builtin",[["Builtin_schnorr_get_address"],null],[],[["Ident",["SimpleLocal","pubkey"],null]]],null]]]],null]],null]],["LibVar",["Ident",["SimpleLocal","get_amount"],null],null,[["Fun",["Ident",["SimpleLocal","price"],null],["ADT",["Ident",["SimpleLocal","Coins"],{"fname":"","lnum":0,"cnum":0}],[]],[["MatchExpr",["Ident",["SimpleLocal","price"],null],[[["Constructor",["Ident",["SimpleLocal","Coins"],null],[["Binder",["Ident",["SimpleLocal","denom"],null]],["Binder",["Ident",["SimpleLocal","amount"],null]]]],[["Var",["Ident",["SimpleLocal","amount"],null]],null]]]],null]],null]],["LibVar",["Ident",["SimpleLocal","get_cheque_hash"],null],null,[["Fun",["Ident",["SimpleLocal","contract_address"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","direction"],null],["ADT",["Ident",["SimpleLocal","Side"],{"fname":"","lnum":0,"cnum":0}],[]],[["Fun",["Ident",["SimpleLocal","token"],null],["ADT",["Ident",["SimpleLocal","NFT"],{"fname":"","lnum":0,"cnum":0}],[]],[["Fun",["Ident",["SimpleLocal","price"],null],["ADT",["Ident",["SimpleLocal","Coins"],{"fname":"","lnum":0,"cnum":0}],[]],[["Fun",["Ident",["SimpleLocal","fee_amount"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Fun",["Ident",["SimpleLocal","expiry"],null],["PrimType",["Bnum_typ"]],[["Fun",["Ident",["SimpleLocal","nonce"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Let",["Ident",["SimpleLocal","dir_hash"],null],null,[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","direction"],null]]],null],[["Let",["Ident",["SimpleLocal","token_hash"],null],null,[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","token"],null]]],null],[["Let",["Ident",["SimpleLocal","price_hash"],null],null,[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","price"],null]]],null],[["Let",["Ident",["SimpleLocal","fee_hash"],null],null,[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","fee_amount"],null]]],null],[["Let",["Ident",["SimpleLocal","expiry_hash"],null],null,[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","expiry"],null]]],null],[["Let",["Ident",["SimpleLocal","nonce_hash"],null],null,[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","nonce"],null]]],null],[["Let",["Ident",["SimpleLocal","p0"],null],null,[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","contract_address"],null],["Ident",["SimpleLocal","dir_hash"],null]]],null],[["Let",["Ident",["SimpleLocal","p1"],null],null,[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","p0"],null],["Ident",["SimpleLocal","token_hash"],null]]],null],[["Let",["Ident",["SimpleLocal","p2"],null],null,[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","p1"],null],["Ident",["SimpleLocal","price_hash"],null]]],null],[["Let",["Ident",["SimpleLocal","p3"],null],null,[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","p2"],null],["Ident",["SimpleLocal","fee_hash"],null]]],null],[["Let",["Ident",["SimpleLocal","p4"],null],null,[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","p3"],null],["Ident",["SimpleLocal","expiry_hash"],null]]],null],[["Let",["Ident",["SimpleLocal","p5"],null],null,[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","p4"],null],["Ident",["SimpleLocal","nonce_hash"],null]]],null],[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","p5"],null]]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]]]},"elibs":[[["Ident",["SimpleLocal","IntUtils"],null],null],[["Ident",["SimpleLocal","ListUtils"],null],null]],"contr":{"cname":["Ident",["SimpleLocal","ARK"],null],"cparams":[[["Ident",["SimpleLocal","contract_owner"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","initial_fee_address"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","chain_id"],null],["PrimType",["Uint_typ",["Bits32"]]]]],"cconstraint":[["Literal",{"name":["SimpleLocal","True"],"types":[],"lits":[]}],null],"cfields":[[["Ident",["SimpleLocal","current_owner"],null],["ADT",["Ident",["SimpleLocal","Option"],{"fname":"","lnum":0,"cnum":0}],[["PrimType",["Bystrx_typ",20]]]],[["Constr",["Ident",["SimpleLocal","Some"],null],[["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","contract_owner"],null]]],null]],[["Ident",["SimpleLocal","pending_owner"],null],["ADT",["Ident",["SimpleLocal","Option"],{"fname":"","lnum":0,"cnum":0}],[["PrimType",["Bystrx_typ",20]]]],[["Var",["Ident",["SimpleLocal","none"],null]],null]],[["Ident",["SimpleLocal","token_proxy"],null],["ADT",["Ident",["SimpleLocal","Option"],{"fname":"","lnum":0,"cnum":0}],[["PrimType",["Bystrx_typ",20]]]],[["Var",["Ident",["SimpleLocal","none"],null]],null]],[["Ident",["SimpleLocal","fee_address"],null],["PrimType",["Bystrx_typ",20]],[["Var",["Ident",["SimpleLocal","initial_fee_address"],null]],null]],[["Ident",["SimpleLocal","voided_cheques"],null],["MapType",["PrimType",["Bystrx_typ",33]],["MapType",["PrimType",["Bystrx_typ",32]],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],[["Literal",{"mtype":[["PrimType",["Bystrx_typ",33]],["MapType",["PrimType",["Bystrx_typ",32]],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],"data":[]}],null]]],"ccomps":[{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","ThrowError"],null],"comp_params":[[["Ident",["SimpleLocal","err"],null],["ADT",["Ident",["SimpleLocal","Error"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","e"],null],[["App",["Ident",["SimpleLocal","make_error"],null],[["Ident",["SimpleLocal","err"],null]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsOwner"],null],"comp_params":[[["Ident",["SimpleLocal","address"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["Load",["Ident",["SimpleLocal","maybe_current_owner"],null],["Ident",["SimpleLocal","current_owner"],null]],null],[["MatchStmt",["Ident",["SimpleLocal","maybe_current_owner"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","current_contract_owner"],null]]]],[[["Bind",["Ident",["SimpleLocal","is_owner"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","current_contract_owner"],null],["Ident",["SimpleLocal","address"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_owner"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeNotOwner"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeNotOwner"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsPendingOwner"],null],"comp_params":[[["Ident",["SimpleLocal","address"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["Load",["Ident",["SimpleLocal","maybe_pending_owner"],null],["Ident",["SimpleLocal","pending_owner"],null]],null],[["MatchStmt",["Ident",["SimpleLocal","maybe_pending_owner"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","current_pending_owner"],null]]]],[[["Bind",["Ident",["SimpleLocal","is_pending_owner"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","current_pending_owner"],null],["Ident",["SimpleLocal","address"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_pending_owner"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeNotPendingOwner"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeNotPendingOwner"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","NoPendingOwner"],null],"comp_params":[],"comp_body":[[["Load",["Ident",["SimpleLocal","maybe_pending_owner"],null],["Ident",["SimpleLocal","pending_owner"],null]],null],[["MatchStmt",["Ident",["SimpleLocal","maybe_pending_owner"],null],[[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","p"],null]]]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodePendingOwnerNotEmpty"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsNotExpired"],null],"comp_params":[[["Ident",["SimpleLocal","expiry"],null],["PrimType",["Bnum_typ"]]]],"comp_body":[[["ReadFromBC",["Ident",["SimpleLocal","current_block"],null],["CurBlockNum"]],null],[["Bind",["Ident",["SimpleLocal","is_not_expired"],null],[["Builtin",[["Builtin_blt"],null],[],[["Ident",["SimpleLocal","current_block"],null],["Ident",["SimpleLocal","expiry"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_not_expired"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_exception",["MLit","TransactionExpired"]]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsValidPrice"],null],"comp_params":[[["Ident",["SimpleLocal","price"],null],["ADT",["Ident",["SimpleLocal","Coins"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","amount"],null],[["App",["Ident",["SimpleLocal","get_amount"],null],[["Ident",["SimpleLocal","price"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","is_zero"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","zero"],null],["Ident",["SimpleLocal","amount"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_zero"],null],[[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidPrice"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsValidFee"],null],"comp_params":[[["Ident",["SimpleLocal","price"],null],["ADT",["Ident",["SimpleLocal","Coins"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","fee"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","amount"],null],[["App",["Ident",["SimpleLocal","get_amount"],null],[["Ident",["SimpleLocal","price"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","is_valid"],null],[["Builtin",[["Builtin_lt"],null],[],[["Ident",["SimpleLocal","fee"],null],["Ident",["SimpleLocal","amount"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_valid"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidFee"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsValidSide"],null],"comp_params":[[["Ident",["SimpleLocal","s1"],null],["ADT",["Ident",["SimpleLocal","Side"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","s2"],null],["ADT",["Ident",["SimpleLocal","Side"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["MatchStmt",["Ident",["SimpleLocal","s1"],null],[[["Constructor",["Ident",["SimpleLocal","Buy"],null],[]],[[["MatchStmt",["Ident",["SimpleLocal","s2"],null],[[["Constructor",["Ident",["SimpleLocal","Buy"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","Sell"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidSide"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]]],[["Constructor",["Ident",["SimpleLocal","Sell"],null],[]],[[["MatchStmt",["Ident",["SimpleLocal","s2"],null],[[["Constructor",["Ident",["SimpleLocal","Sell"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","Buy"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidSide"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsNotVoided"],null],"comp_params":[[["Ident",["SimpleLocal","cheque_hash"],null],["PrimType",["Bystrx_typ",32]]],[["Ident",["SimpleLocal","pubkey"],null],["PrimType",["Bystrx_typ",33]]]],"comp_body":[[["MapGet",["Ident",["SimpleLocal","cheque_voided"],null],["Ident",["SimpleLocal","voided_cheques"],null],[["Ident",["SimpleLocal","pubkey"],null],["Ident",["SimpleLocal","cheque_hash"],null]],false],null],[["MatchStmt",["Ident",["SimpleLocal","cheque_voided"],null],[[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeChequeAlreadyVoided"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsValidSignature"],null],"comp_params":[[["Ident",["SimpleLocal","action"],null],["ADT",["Ident",["SimpleLocal","Action"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","cheque_hash"],null],["PrimType",["Bystrx_typ",32]]],[["Ident",["SimpleLocal","pubkey"],null],["PrimType",["Bystrx_typ",33]]],[["Ident",["SimpleLocal","signature"],null],["PrimType",["Bystrx_typ",64]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","hex_hash"],null],[["Builtin",[["Builtin_to_string"],null],[],[["Ident",["SimpleLocal","cheque_hash"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","action_prefix"],null],[["App",["Ident",["SimpleLocal","get_action_prefix"],null],[["Ident",["SimpleLocal","action"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","action_string"],null],[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","action_prefix"],null],["Ident",["SimpleLocal","hex_hash"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","chain_id_string"],null],[["Builtin",[["Builtin_to_string"],null],[],[["Ident",["SimpleLocal","chain_id"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","message_header"],null],[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","signed_message_prefix"],null],["Ident",["SimpleLocal","chain_id_string"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","message_header"],null],[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","message_header"],null],["Ident",["SimpleLocal","signed_message_suffix"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","message_string"],null],[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","message_header"],null],["Ident",["SimpleLocal","action_string"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","signed_hash"],null],[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","message_string"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","signed_data"],null],[["Builtin",[["Builtin_to_bystr"],null],[],[["Ident",["SimpleLocal","signed_hash"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","valid_sig"],null],[["Builtin",[["Builtin_schnorr_verify"],null],[],[["Ident",["SimpleLocal","pubkey"],null],["Ident",["SimpleLocal","signed_data"],null],["Ident",["SimpleLocal","signature"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","valid_sig"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeSignatureInvalid"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","ValidateAndConsumeCheque"],null],"comp_params":[[["Ident",["SimpleLocal","token"],null],["ADT",["Ident",["SimpleLocal","NFT"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","price"],null],["ADT",["Ident",["SimpleLocal","Coins"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","fee_amount"],null],["PrimType",["Uint_typ",["Bits128"]]]],[["Ident",["SimpleLocal","valid_direction"],null],["ADT",["Ident",["SimpleLocal","Side"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","cheque"],null],["ADT",["Ident",["SimpleLocal","Cheque"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["MatchStmt",["Ident",["SimpleLocal","cheque"],null],[[["Constructor",["Ident",["SimpleLocal","Cheque"],null],[["Binder",["Ident",["SimpleLocal","direction"],null]],["Binder",["Ident",["SimpleLocal","expiry"],null]],["Binder",["Ident",["SimpleLocal","nonce"],null]],["Binder",["Ident",["SimpleLocal","pubkey"],null]],["Binder",["Ident",["SimpleLocal","signature"],null]]]],[[["CallProc",null,["Ident",["SimpleLocal","IsValidPrice"],null],[["Ident",["SimpleLocal","price"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","IsValidSide"],null],[["Ident",["SimpleLocal","valid_direction"],null],["Ident",["SimpleLocal","direction"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","IsNotExpired"],null],[["Ident",["SimpleLocal","expiry"],null]]],null],[["Bind",["Ident",["SimpleLocal","cheque_hash"],null],[["App",["Ident",["SimpleLocal","get_cheque_hash"],null],[["Ident",["SimpleLocal","_this_address"],null],["Ident",["SimpleLocal","direction"],null],["Ident",["SimpleLocal","token"],null],["Ident",["SimpleLocal","price"],null],["Ident",["SimpleLocal","fee_amount"],null],["Ident",["SimpleLocal","expiry"],null],["Ident",["SimpleLocal","nonce"],null]]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","IsNotVoided"],null],[["Ident",["SimpleLocal","cheque_hash"],null],["Ident",["SimpleLocal","pubkey"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","IsValidSignature"],null],[["Ident",["SimpleLocal","execute"],null],["Ident",["SimpleLocal","cheque_hash"],null],["Ident",["SimpleLocal","pubkey"],null],["Ident",["SimpleLocal","signature"],null]]],null],[["MapUpdate",["Ident",["SimpleLocal","voided_cheques"],null],[["Ident",["SimpleLocal","pubkey"],null],["Ident",["SimpleLocal","cheque_hash"],null]],["Ident",["SimpleLocal","true"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","TransferCoins"],null],"comp_params":[[["Ident",["SimpleLocal","coins"],null],["ADT",["Ident",["SimpleLocal","Coins"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","from"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","to"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["MatchStmt",["Ident",["SimpleLocal","coins"],null],[[["Constructor",["Ident",["SimpleLocal","Coins"],null],[["Binder",["Ident",["SimpleLocal","denom"],null]],["Binder",["Ident",["SimpleLocal","amount"],null]]]],[[["MatchStmt",["Ident",["SimpleLocal","denom"],null],[[["Constructor",["Ident",["SimpleLocal","Zil"],null],[]],[[["Bind",["Ident",["SimpleLocal","msg"],null],[["Message",[["_tag",["MLit","AddFunds"]],["_recipient",["MVar",["Ident",["SimpleLocal","to"],null]]],["_amount",["MVar",["Ident",["SimpleLocal","amount"],null]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null]]],[["Constructor",["Ident",["SimpleLocal","Token"],null],[["Binder",["Ident",["SimpleLocal","token"],null]]]],[[["Load",["Ident",["SimpleLocal","maybe_token_proxy"],null],["Ident",["SimpleLocal","token_proxy"],null]],null],[["MatchStmt",["Ident",["SimpleLocal","maybe_token_proxy"],null],[[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeTokenProxyNotSet"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","t"],null]]]],[[["Bind",["Ident",["SimpleLocal","msg_to_token_proxy"],null],[["Message",[["_tag",["MLit","TransferFrom"]],["_recipient",["MVar",["Ident",["SimpleLocal","t"],null]]],["_amount",["MVar",["Ident",["SimpleLocal","zero"],null]]],["token",["MVar",["Ident",["SimpleLocal","token"],null]]],["from",["MVar",["Ident",["SimpleLocal","from"],null]]],["to",["MVar",["Ident",["SimpleLocal","to"],null]]],["amount",["MVar",["Ident",["SimpleLocal","amount"],null]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg_to_token_proxy"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null]]]]],null]]]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","TransferNFT"],null],"comp_params":[[["Ident",["SimpleLocal","token"],null],["ADT",["Ident",["SimpleLocal","NFT"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","from"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","to"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["MatchStmt",["Ident",["SimpleLocal","token"],null],[[["Constructor",["Ident",["SimpleLocal","NFT"],null],[["Binder",["Ident",["SimpleLocal","token_address"],null]],["Binder",["Ident",["SimpleLocal","token_id"],null]]]],[[["RemoteMapGet",["Ident",["SimpleLocal","maybe_token_owner"],null],["Ident",["SimpleLocal","token_address"],null],["Ident",["SimpleLocal","token_owners"],null],[["Ident",["SimpleLocal","token_id"],null]],true],null],[["MatchStmt",["Ident",["SimpleLocal","maybe_token_owner"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","token_owner"],null]]]],[[["Bind",["Ident",["SimpleLocal","is_valid_owner"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","token_owner"],null],["Ident",["SimpleLocal","from"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_valid_owner"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidOwner"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidOwner"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null],[["Bind",["Ident",["SimpleLocal","msg_to_token"],null],[["Message",[["_tag",["MLit","TransferFrom"]],["_recipient",["MVar",["Ident",["SimpleLocal","token_address"],null]]],["_amount",["MVar",["Ident",["SimpleLocal","zero"],null]]],["to",["MVar",["Ident",["SimpleLocal","to"],null]]],["token_id",["MVar",["Ident",["SimpleLocal","token_id"],null]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg_to_token"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","ExecuteTrade"],null],"comp_params":[[["Ident",["SimpleLocal","token"],null],["ADT",["Ident",["SimpleLocal","NFT"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","price"],null],["ADT",["Ident",["SimpleLocal","Coins"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","fee_amount"],null],["PrimType",["Uint_typ",["Bits128"]]]],[["Ident",["SimpleLocal","sell_cheque"],null],["ADT",["Ident",["SimpleLocal","Cheque"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","buy_cheque"],null],["ADT",["Ident",["SimpleLocal","Cheque"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","ValidateAndConsumeCheque"],null],[["Ident",["SimpleLocal","token"],null],["Ident",["SimpleLocal","price"],null],["Ident",["SimpleLocal","fee_amount"],null],["Ident",["SimpleLocal","sell"],null],["Ident",["SimpleLocal","sell_cheque"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","ValidateAndConsumeCheque"],null],[["Ident",["SimpleLocal","token"],null],["Ident",["SimpleLocal","price"],null],["Ident",["SimpleLocal","zero"],null],["Ident",["SimpleLocal","buy"],null],["Ident",["SimpleLocal","buy_cheque"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","IsValidFee"],null],[["Ident",["SimpleLocal","price"],null],["Ident",["SimpleLocal","fee_amount"],null]]],null],[["MatchStmt",["Ident",["SimpleLocal","price"],null],[[["Constructor",["Ident",["SimpleLocal","Coins"],null],[["Binder",["Ident",["SimpleLocal","denom"],null]],["Binder",["Ident",["SimpleLocal","amount"],null]]]],[[["Load",["Ident",["SimpleLocal","fee_receiver"],null],["Ident",["SimpleLocal","fee_address"],null]],null],[["Bind",["Ident",["SimpleLocal","seller"],null],[["App",["Ident",["SimpleLocal","get_account"],null],[["Ident",["SimpleLocal","sell_cheque"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","buyer"],null],[["App",["Ident",["SimpleLocal","get_account"],null],[["Ident",["SimpleLocal","buy_cheque"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","seller_receive_amount"],null],[["Builtin",[["Builtin_sub"],null],[],[["Ident",["SimpleLocal","amount"],null],["Ident",["SimpleLocal","fee_amount"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","seller_receive_coins"],null],[["Constr",["Ident",["SimpleLocal","Coins"],null],[],[["Ident",["SimpleLocal","denom"],null],["Ident",["SimpleLocal","seller_receive_amount"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","fee_receive_coins"],null],[["Constr",["Ident",["SimpleLocal","Coins"],null],[],[["Ident",["SimpleLocal","denom"],null],["Ident",["SimpleLocal","fee_amount"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","denom"],null],[[["Constructor",["Ident",["SimpleLocal","Zil"],null],[]],[[["Bind",["Ident",["SimpleLocal","receiving_from_buyer"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","buyer"],null],["Ident",["SimpleLocal","_sender"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","receiving_from_buyer"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidPrice"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null],[["Bind",["Ident",["SimpleLocal","correct_amount"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","_amount"],null],["Ident",["SimpleLocal","amount"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","correct_amount"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidPrice"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null],[["AcceptPayment"],null]]],[["Wildcard"],[]]]],null],[["CallProc",null,["Ident",["SimpleLocal","TransferCoins"],null],[["Ident",["SimpleLocal","seller_receive_coins"],null],["Ident",["SimpleLocal","buyer"],null],["Ident",["SimpleLocal","seller"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","TransferCoins"],null],[["Ident",["SimpleLocal","fee_receive_coins"],null],["Ident",["SimpleLocal","buyer"],null],["Ident",["SimpleLocal","fee_receiver"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","TransferNFT"],null],[["Ident",["SimpleLocal","token"],null],["Ident",["SimpleLocal","seller"],null],["Ident",["SimpleLocal","buyer"],null]]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","ExecuteTradeSuccess"]],["initiator",["MVar",["Ident",["SimpleLocal","_sender"],null]]],["token",["MVar",["Ident",["SimpleLocal","token"],null]]],["seller",["MVar",["Ident",["SimpleLocal","seller"],null]]],["buyer",["MVar",["Ident",["SimpleLocal","buyer"],null]]],["proceeds",["MVar",["Ident",["SimpleLocal","seller_receive_coins"],null]]],["fees",["MVar",["Ident",["SimpleLocal","fee_receive_coins"],null]]],["sell_cheque",["MVar",["Ident",["SimpleLocal","sell_cheque"],null]]],["buy_cheque",["MVar",["Ident",["SimpleLocal","buy_cheque"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","VoidCheque"],null],"comp_params":[[["Ident",["SimpleLocal","cheque_hash"],null],["PrimType",["Bystrx_typ",32]]],[["Ident",["SimpleLocal","pubkey"],null],["PrimType",["Bystrx_typ",33]]],[["Ident",["SimpleLocal","signature"],null],["PrimType",["Bystrx_typ",64]]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","IsNotVoided"],null],[["Ident",["SimpleLocal","cheque_hash"],null],["Ident",["SimpleLocal","pubkey"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","IsValidSignature"],null],[["Ident",["SimpleLocal","void"],null],["Ident",["SimpleLocal","cheque_hash"],null],["Ident",["SimpleLocal","pubkey"],null],["Ident",["SimpleLocal","signature"],null]]],null],[["MapUpdate",["Ident",["SimpleLocal","voided_cheques"],null],[["Ident",["SimpleLocal","pubkey"],null],["Ident",["SimpleLocal","cheque_hash"],null]],["Ident",["SimpleLocal","true"],null]],null],[["Bind",["Ident",["SimpleLocal","from"],null],[["Builtin",[["Builtin_schnorr_get_address"],null],[],[["Ident",["SimpleLocal","pubkey"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","VoidChequeSuccess"]],["initiator",["MVar",["Ident",["SimpleLocal","_sender"],null]]],["sender",["MVar",["Ident",["SimpleLocal","from"],null]]],["cheque_hash",["MVar",["Ident",["SimpleLocal","cheque_hash"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","SetTokenProxy"],null],"comp_params":[[["Ident",["SimpleLocal","address"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","IsOwner"],null],[["Ident",["SimpleLocal","_sender"],null]]],null],[["Load",["Ident",["SimpleLocal","t"],null],["Ident",["SimpleLocal","token_proxy"],null]],null],[["MatchStmt",["Ident",["SimpleLocal","t"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Wildcard"]]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeTokenProxyAlreadySet"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","new_token_proxy"],null],[["Constr",["Ident",["SimpleLocal","Some"],null],[["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","address"],null]]],null]],null],[["Store",["Ident",["SimpleLocal","token_proxy"],null],["Ident",["SimpleLocal","new_token_proxy"],null]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","SetTokenProxySuccess"]],["token_proxy",["MVar",["Ident",["SimpleLocal","address"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","TransferOwnership"],null],"comp_params":[[["Ident",["SimpleLocal","new_owner"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","IsOwner"],null],[["Ident",["SimpleLocal","_sender"],null]]],null],[["Bind",["Ident",["SimpleLocal","o"],null],[["Constr",["Ident",["SimpleLocal","Some"],null],[["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","new_owner"],null]]],null]],null],[["Store",["Ident",["SimpleLocal","pending_owner"],null],["Ident",["SimpleLocal","o"],null]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","OwnershipTransferInitiated"]],["current_owner",["MVar",["Ident",["SimpleLocal","_sender"],null]]],["pending_owner",["MVar",["Ident",["SimpleLocal","new_owner"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","AcceptOwnership"],null],"comp_params":[],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","IsPendingOwner"],null],[["Ident",["SimpleLocal","_sender"],null]]],null],[["Load",["Ident",["SimpleLocal","previous_current_owner"],null],["Ident",["SimpleLocal","current_owner"],null]],null],[["Bind",["Ident",["SimpleLocal","o"],null],[["Constr",["Ident",["SimpleLocal","Some"],null],[["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","_sender"],null]]],null]],null],[["Store",["Ident",["SimpleLocal","current_owner"],null],["Ident",["SimpleLocal","o"],null]],null],[["Store",["Ident",["SimpleLocal","pending_owner"],null],["Ident",["SimpleLocal","none"],null]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","OwnershipTransferAccepted"]],["previous_current_owner",["MVar",["Ident",["SimpleLocal","previous_current_owner"],null]]],["current_owner",["MVar",["Ident",["SimpleLocal","_sender"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","RevokeOwnership"],null],"comp_params":[],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","IsOwner"],null],[["Ident",["SimpleLocal","_sender"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","NoPendingOwner"],null],[]],null],[["Store",["Ident",["SimpleLocal","current_owner"],null],["Ident",["SimpleLocal","none"],null]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","OwnershipRevoked"]],["current_owner",["MVar",["Ident",["SimpleLocal","_sender"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","TransferFromSuccessCallBack"],null],"comp_params":[[["Ident",["SimpleLocal","from"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","recipient"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","token_id"],null],["PrimType",["Uint_typ",["Bits256"]]]]],"comp_body":[],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","ZRC6_TransferFromCallback"],null],"comp_params":[[["Ident",["SimpleLocal","from"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","to"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","token_id"],null],["PrimType",["Uint_typ",["Bits256"]]]]],"comp_body":[],"comp_return":null}]}} + {"smver":0,"libs":{"lname":["Ident",["SimpleLocal","ARK"],null],"lentries":[["LibTyp",["Ident",["SimpleLocal","Denom"],null],[{"cname":["Ident",["SimpleLocal","Zil"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","Token"],null],"c_arg_types":[["PrimType",["Bystrx_typ",20]]]}]],["LibTyp",["Ident",["SimpleLocal","Coins"],null],[{"cname":["Ident",["SimpleLocal","Coins"],null],"c_arg_types":[["ADT",["Ident",["SimpleLocal","Denom"],{"fname":"","lnum":0,"cnum":0}],[]],["PrimType",["Uint_typ",["Bits128"]]]]}]],["LibTyp",["Ident",["SimpleLocal","NFT"],null],[{"cname":["Ident",["SimpleLocal","NFT"],null],"c_arg_types":[["Address","Address"],["PrimType",["Uint_typ",["Bits256"]]]]}]],["LibTyp",["Ident",["SimpleLocal","Side"],null],[{"cname":["Ident",["SimpleLocal","Buy"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","Sell"],null],"c_arg_types":[]}]],["LibTyp",["Ident",["SimpleLocal","Cheque"],null],[{"cname":["Ident",["SimpleLocal","Cheque"],null],"c_arg_types":[["ADT",["Ident",["SimpleLocal","Side"],{"fname":"","lnum":0,"cnum":0}],[]],["PrimType",["Bnum_typ"]],["PrimType",["Uint_typ",["Bits128"]]],["PrimType",["Bystrx_typ",33]],["PrimType",["Bystrx_typ",64]]]}]],["LibTyp",["Ident",["SimpleLocal","Action"],null],[{"cname":["Ident",["SimpleLocal","Execute"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","Void"],null],"c_arg_types":[]}]],["LibVar",["Ident",["SimpleLocal","zero"],null],null,[["Literal","0"],null]],["LibVar",["Ident",["SimpleLocal","none"],null],null,[["Constr",["Ident",["SimpleLocal","None"],null],[["PrimType",["Bystrx_typ",20]]],[]],null]],["LibVar",["Ident",["SimpleLocal","true"],null],null,[["Constr",["Ident",["SimpleLocal","True"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","buy"],null],null,[["Constr",["Ident",["SimpleLocal","Buy"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","sell"],null],null,[["Constr",["Ident",["SimpleLocal","Sell"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","zil"],null],null,[["Constr",["Ident",["SimpleLocal","Zil"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","signed_message_prefix"],null],null,[["Literal","Zilliqa Signed Message ("],null]],["LibVar",["Ident",["SimpleLocal","signed_message_suffix"],null],null,[["Literal","):\n"],null]],["LibVar",["Ident",["SimpleLocal","execute_prefix"],null],null,[["Literal","Execute ARK Cheque "],null]],["LibVar",["Ident",["SimpleLocal","void_prefix"],null],null,[["Literal","Void ARK Cheque "],null]],["LibVar",["Ident",["SimpleLocal","execute"],null],null,[["Constr",["Ident",["SimpleLocal","Execute"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","void"],null],null,[["Constr",["Ident",["SimpleLocal","Void"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","one_msg"],null],null,[["Fun",["Ident",["SimpleLocal","msg"],null],["PrimType",["Msg_typ"]],[["Let",["Ident",["SimpleLocal","nil_msg"],null],null,[["Constr",["Ident",["SimpleLocal","Nil"],null],[["PrimType",["Msg_typ"]]],[]],null],[["Constr",["Ident",["SimpleLocal","Cons"],null],[["PrimType",["Msg_typ"]]],[["Ident",["SimpleLocal","msg"],null],["Ident",["SimpleLocal","nil_msg"],null]]],null]],null]],null]],["LibTyp",["Ident",["SimpleLocal","Error"],null],[{"cname":["Ident",["SimpleLocal","CodeNotOwner"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeNotPendingOwner"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodePendingOwnerNotEmpty"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeTokenProxyNotSet"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeTokenProxyAlreadySet"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeSignatureInvalid"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeChequeAlreadyVoided"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeChequeExpired"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeInvalidPrice"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeInvalidFee"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeInvalidSide"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","CodeInvalidOwner"],null],"c_arg_types":[]}]],["LibVar",["Ident",["SimpleLocal","make_error"],null],null,[["Fun",["Ident",["SimpleLocal","result"],null],["ADT",["Ident",["SimpleLocal","Error"],{"fname":"","lnum":0,"cnum":0}],[]],[["Let",["Ident",["SimpleLocal","result_code"],null],null,[["MatchExpr",["Ident",["SimpleLocal","result"],null],[[["Constructor",["Ident",["SimpleLocal","CodeNotOwner"],null],[]],[["Literal","-1"],null]],[["Constructor",["Ident",["SimpleLocal","CodeNotPendingOwner"],null],[]],[["Literal","-2"],null]],[["Constructor",["Ident",["SimpleLocal","CodePendingOwnerNotEmpty"],null],[]],[["Literal","-3"],null]],[["Constructor",["Ident",["SimpleLocal","CodeTokenProxyNotSet"],null],[]],[["Literal","-4"],null]],[["Constructor",["Ident",["SimpleLocal","CodeTokenProxyAlreadySet"],null],[]],[["Literal","-5"],null]],[["Constructor",["Ident",["SimpleLocal","CodeSignatureInvalid"],null],[]],[["Literal","-6"],null]],[["Constructor",["Ident",["SimpleLocal","CodeChequeAlreadyVoided"],null],[]],[["Literal","-7"],null]],[["Constructor",["Ident",["SimpleLocal","CodeChequeExpired"],null],[]],[["Literal","-8"],null]],[["Constructor",["Ident",["SimpleLocal","CodeInvalidPrice"],null],[]],[["Literal","-9"],null]],[["Constructor",["Ident",["SimpleLocal","CodeInvalidFee"],null],[]],[["Literal","-10"],null]],[["Constructor",["Ident",["SimpleLocal","CodeInvalidSide"],null],[]],[["Literal","-11"],null]],[["Constructor",["Ident",["SimpleLocal","CodeInvalidOwner"],null],[]],[["Literal","-12"],null]]]],null],[["Message",[["_exception",["MLit","Error"]],["code",["MVar",["Ident",["SimpleLocal","result_code"],null]]]]],null]],null]],null]],["LibVar",["Ident",["SimpleLocal","get_action_prefix"],null],null,[["Fun",["Ident",["SimpleLocal","action"],null],["ADT",["Ident",["SimpleLocal","Action"],{"fname":"","lnum":0,"cnum":0}],[]],[["MatchExpr",["Ident",["SimpleLocal","action"],null],[[["Constructor",["Ident",["SimpleLocal","Execute"],null],[]],[["Var",["Ident",["SimpleLocal","execute_prefix"],null]],null]],[["Constructor",["Ident",["SimpleLocal","Void"],null],[]],[["Var",["Ident",["SimpleLocal","void_prefix"],null]],null]]]],null]],null]],["LibVar",["Ident",["SimpleLocal","get_account"],null],null,[["Fun",["Ident",["SimpleLocal","cheque"],null],["ADT",["Ident",["SimpleLocal","Cheque"],{"fname":"","lnum":0,"cnum":0}],[]],[["MatchExpr",["Ident",["SimpleLocal","cheque"],null],[[["Constructor",["Ident",["SimpleLocal","Cheque"],null],[["Binder",["Ident",["SimpleLocal","direction"],null]],["Binder",["Ident",["SimpleLocal","expiry"],null]],["Binder",["Ident",["SimpleLocal","nonce"],null]],["Binder",["Ident",["SimpleLocal","pubkey"],null]],["Binder",["Ident",["SimpleLocal","signature"],null]]]],[["Builtin",[["Builtin_schnorr_get_address"],null],[],[["Ident",["SimpleLocal","pubkey"],null]]],null]]]],null]],null]],["LibVar",["Ident",["SimpleLocal","get_amount"],null],null,[["Fun",["Ident",["SimpleLocal","price"],null],["ADT",["Ident",["SimpleLocal","Coins"],{"fname":"","lnum":0,"cnum":0}],[]],[["MatchExpr",["Ident",["SimpleLocal","price"],null],[[["Constructor",["Ident",["SimpleLocal","Coins"],null],[["Binder",["Ident",["SimpleLocal","denom"],null]],["Binder",["Ident",["SimpleLocal","amount"],null]]]],[["Var",["Ident",["SimpleLocal","amount"],null]],null]]]],null]],null]],["LibVar",["Ident",["SimpleLocal","get_cheque_hash"],null],null,[["Fun",["Ident",["SimpleLocal","contract_address"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","direction"],null],["ADT",["Ident",["SimpleLocal","Side"],{"fname":"","lnum":0,"cnum":0}],[]],[["Fun",["Ident",["SimpleLocal","token"],null],["ADT",["Ident",["SimpleLocal","NFT"],{"fname":"","lnum":0,"cnum":0}],[]],[["Fun",["Ident",["SimpleLocal","price"],null],["ADT",["Ident",["SimpleLocal","Coins"],{"fname":"","lnum":0,"cnum":0}],[]],[["Fun",["Ident",["SimpleLocal","fee_amount"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Fun",["Ident",["SimpleLocal","expiry"],null],["PrimType",["Bnum_typ"]],[["Fun",["Ident",["SimpleLocal","nonce"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Let",["Ident",["SimpleLocal","dir_hash"],null],null,[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","direction"],null]]],null],[["Let",["Ident",["SimpleLocal","token_hash"],null],null,[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","token"],null]]],null],[["Let",["Ident",["SimpleLocal","price_hash"],null],null,[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","price"],null]]],null],[["Let",["Ident",["SimpleLocal","fee_hash"],null],null,[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","fee_amount"],null]]],null],[["Let",["Ident",["SimpleLocal","expiry_hash"],null],null,[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","expiry"],null]]],null],[["Let",["Ident",["SimpleLocal","nonce_hash"],null],null,[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","nonce"],null]]],null],[["Let",["Ident",["SimpleLocal","p0"],null],null,[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","contract_address"],null],["Ident",["SimpleLocal","dir_hash"],null]]],null],[["Let",["Ident",["SimpleLocal","p1"],null],null,[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","p0"],null],["Ident",["SimpleLocal","token_hash"],null]]],null],[["Let",["Ident",["SimpleLocal","p2"],null],null,[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","p1"],null],["Ident",["SimpleLocal","price_hash"],null]]],null],[["Let",["Ident",["SimpleLocal","p3"],null],null,[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","p2"],null],["Ident",["SimpleLocal","fee_hash"],null]]],null],[["Let",["Ident",["SimpleLocal","p4"],null],null,[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","p3"],null],["Ident",["SimpleLocal","expiry_hash"],null]]],null],[["Let",["Ident",["SimpleLocal","p5"],null],null,[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","p4"],null],["Ident",["SimpleLocal","nonce_hash"],null]]],null],[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","p5"],null]]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]]]},"elibs":[[["Ident",["SimpleLocal","IntUtils"],null],null],[["Ident",["SimpleLocal","ListUtils"],null],null]],"contr":{"cname":["Ident",["SimpleLocal","ARK"],null],"cparams":[[["Ident",["SimpleLocal","contract_owner"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","initial_fee_address"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","chain_id"],null],["PrimType",["Uint_typ",["Bits32"]]]]],"cconstraint":[["Literal",{"name":["SimpleLocal","True"],"types":[],"lits":[]}],null],"cfields":[[["Ident",["SimpleLocal","current_owner"],null],["ADT",["Ident",["SimpleLocal","Option"],{"fname":"","lnum":0,"cnum":0}],[["PrimType",["Bystrx_typ",20]]]],[["Constr",["Ident",["SimpleLocal","Some"],null],[["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","contract_owner"],null]]],null]],[["Ident",["SimpleLocal","pending_owner"],null],["ADT",["Ident",["SimpleLocal","Option"],{"fname":"","lnum":0,"cnum":0}],[["PrimType",["Bystrx_typ",20]]]],[["Var",["Ident",["SimpleLocal","none"],null]],null]],[["Ident",["SimpleLocal","token_proxy"],null],["ADT",["Ident",["SimpleLocal","Option"],{"fname":"","lnum":0,"cnum":0}],[["PrimType",["Bystrx_typ",20]]]],[["Var",["Ident",["SimpleLocal","none"],null]],null]],[["Ident",["SimpleLocal","fee_address"],null],["PrimType",["Bystrx_typ",20]],[["Var",["Ident",["SimpleLocal","initial_fee_address"],null]],null]],[["Ident",["SimpleLocal","voided_cheques"],null],["MapType",["PrimType",["Bystrx_typ",33]],["MapType",["PrimType",["Bystrx_typ",32]],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],[["Literal",{"mtype":[["PrimType",["Bystrx_typ",33]],["MapType",["PrimType",["Bystrx_typ",32]],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],"data":[]}],null]]],"ccomps":[{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","ThrowError"],null],"comp_params":[[["Ident",["SimpleLocal","err"],null],["ADT",["Ident",["SimpleLocal","Error"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","e"],null],[["App",["Ident",["SimpleLocal","make_error"],null],[["Ident",["SimpleLocal","err"],null]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsOwner"],null],"comp_params":[[["Ident",["SimpleLocal","address"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["Load",["Ident",["SimpleLocal","maybe_current_owner"],null],["Ident",["SimpleLocal","current_owner"],null]],null],[["MatchStmt",["Ident",["SimpleLocal","maybe_current_owner"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","current_contract_owner"],null]]]],[[["Bind",["Ident",["SimpleLocal","is_owner"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","current_contract_owner"],null],["Ident",["SimpleLocal","address"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_owner"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeNotOwner"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeNotOwner"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsPendingOwner"],null],"comp_params":[[["Ident",["SimpleLocal","address"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["Load",["Ident",["SimpleLocal","maybe_pending_owner"],null],["Ident",["SimpleLocal","pending_owner"],null]],null],[["MatchStmt",["Ident",["SimpleLocal","maybe_pending_owner"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","current_pending_owner"],null]]]],[[["Bind",["Ident",["SimpleLocal","is_pending_owner"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","current_pending_owner"],null],["Ident",["SimpleLocal","address"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_pending_owner"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeNotPendingOwner"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeNotPendingOwner"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","NoPendingOwner"],null],"comp_params":[],"comp_body":[[["Load",["Ident",["SimpleLocal","maybe_pending_owner"],null],["Ident",["SimpleLocal","pending_owner"],null]],null],[["MatchStmt",["Ident",["SimpleLocal","maybe_pending_owner"],null],[[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","p"],null]]]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodePendingOwnerNotEmpty"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsNotExpired"],null],"comp_params":[[["Ident",["SimpleLocal","expiry"],null],["PrimType",["Bnum_typ"]]]],"comp_body":[[["ReadFromBC",["Ident",["SimpleLocal","current_block"],null],["CurBlockNum"]],null],[["Bind",["Ident",["SimpleLocal","is_not_expired"],null],[["Builtin",[["Builtin_blt"],null],[],[["Ident",["SimpleLocal","current_block"],null],["Ident",["SimpleLocal","expiry"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_not_expired"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_exception",["MLit","TransactionExpired"]]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsValidPrice"],null],"comp_params":[[["Ident",["SimpleLocal","price"],null],["ADT",["Ident",["SimpleLocal","Coins"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","amount"],null],[["App",["Ident",["SimpleLocal","get_amount"],null],[["Ident",["SimpleLocal","price"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","is_zero"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","zero"],null],["Ident",["SimpleLocal","amount"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_zero"],null],[[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidPrice"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsValidFee"],null],"comp_params":[[["Ident",["SimpleLocal","price"],null],["ADT",["Ident",["SimpleLocal","Coins"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","fee"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","amount"],null],[["App",["Ident",["SimpleLocal","get_amount"],null],[["Ident",["SimpleLocal","price"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","is_valid"],null],[["Builtin",[["Builtin_lt"],null],[],[["Ident",["SimpleLocal","fee"],null],["Ident",["SimpleLocal","amount"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_valid"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidFee"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsValidSide"],null],"comp_params":[[["Ident",["SimpleLocal","s1"],null],["ADT",["Ident",["SimpleLocal","Side"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","s2"],null],["ADT",["Ident",["SimpleLocal","Side"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["MatchStmt",["Ident",["SimpleLocal","s1"],null],[[["Constructor",["Ident",["SimpleLocal","Buy"],null],[]],[[["MatchStmt",["Ident",["SimpleLocal","s2"],null],[[["Constructor",["Ident",["SimpleLocal","Buy"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","Sell"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidSide"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]]],[["Constructor",["Ident",["SimpleLocal","Sell"],null],[]],[[["MatchStmt",["Ident",["SimpleLocal","s2"],null],[[["Constructor",["Ident",["SimpleLocal","Sell"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","Buy"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidSide"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsNotVoided"],null],"comp_params":[[["Ident",["SimpleLocal","cheque_hash"],null],["PrimType",["Bystrx_typ",32]]],[["Ident",["SimpleLocal","pubkey"],null],["PrimType",["Bystrx_typ",33]]]],"comp_body":[[["MapGet",["Ident",["SimpleLocal","cheque_voided"],null],["Ident",["SimpleLocal","voided_cheques"],null],[["Ident",["SimpleLocal","pubkey"],null],["Ident",["SimpleLocal","cheque_hash"],null]],false],null],[["MatchStmt",["Ident",["SimpleLocal","cheque_voided"],null],[[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeChequeAlreadyVoided"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","IsValidSignature"],null],"comp_params":[[["Ident",["SimpleLocal","action"],null],["ADT",["Ident",["SimpleLocal","Action"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","cheque_hash"],null],["PrimType",["Bystrx_typ",32]]],[["Ident",["SimpleLocal","pubkey"],null],["PrimType",["Bystrx_typ",33]]],[["Ident",["SimpleLocal","signature"],null],["PrimType",["Bystrx_typ",64]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","hex_hash"],null],[["Builtin",[["Builtin_to_string"],null],[],[["Ident",["SimpleLocal","cheque_hash"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","action_prefix"],null],[["App",["Ident",["SimpleLocal","get_action_prefix"],null],[["Ident",["SimpleLocal","action"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","action_string"],null],[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","action_prefix"],null],["Ident",["SimpleLocal","hex_hash"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","chain_id_string"],null],[["Builtin",[["Builtin_to_string"],null],[],[["Ident",["SimpleLocal","chain_id"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","message_header"],null],[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","signed_message_prefix"],null],["Ident",["SimpleLocal","chain_id_string"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","message_header"],null],[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","message_header"],null],["Ident",["SimpleLocal","signed_message_suffix"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","message_string"],null],[["Builtin",[["Builtin_concat"],null],[],[["Ident",["SimpleLocal","message_header"],null],["Ident",["SimpleLocal","action_string"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","signed_hash"],null],[["Builtin",[["Builtin_sha256hash"],null],[],[["Ident",["SimpleLocal","message_string"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","signed_data"],null],[["Builtin",[["Builtin_to_bystr"],null],[],[["Ident",["SimpleLocal","signed_hash"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","valid_sig"],null],[["Builtin",[["Builtin_schnorr_verify"],null],[],[["Ident",["SimpleLocal","pubkey"],null],["Ident",["SimpleLocal","signed_data"],null],["Ident",["SimpleLocal","signature"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","valid_sig"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeSignatureInvalid"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","ValidateAndConsumeCheque"],null],"comp_params":[[["Ident",["SimpleLocal","token"],null],["ADT",["Ident",["SimpleLocal","NFT"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","price"],null],["ADT",["Ident",["SimpleLocal","Coins"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","fee_amount"],null],["PrimType",["Uint_typ",["Bits128"]]]],[["Ident",["SimpleLocal","valid_direction"],null],["ADT",["Ident",["SimpleLocal","Side"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","cheque"],null],["ADT",["Ident",["SimpleLocal","Cheque"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["MatchStmt",["Ident",["SimpleLocal","cheque"],null],[[["Constructor",["Ident",["SimpleLocal","Cheque"],null],[["Binder",["Ident",["SimpleLocal","direction"],null]],["Binder",["Ident",["SimpleLocal","expiry"],null]],["Binder",["Ident",["SimpleLocal","nonce"],null]],["Binder",["Ident",["SimpleLocal","pubkey"],null]],["Binder",["Ident",["SimpleLocal","signature"],null]]]],[[["CallProc",null,["Ident",["SimpleLocal","IsValidPrice"],null],[["Ident",["SimpleLocal","price"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","IsValidSide"],null],[["Ident",["SimpleLocal","valid_direction"],null],["Ident",["SimpleLocal","direction"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","IsNotExpired"],null],[["Ident",["SimpleLocal","expiry"],null]]],null],[["Bind",["Ident",["SimpleLocal","cheque_hash"],null],[["App",["Ident",["SimpleLocal","get_cheque_hash"],null],[["Ident",["SimpleLocal","_this_address"],null],["Ident",["SimpleLocal","direction"],null],["Ident",["SimpleLocal","token"],null],["Ident",["SimpleLocal","price"],null],["Ident",["SimpleLocal","fee_amount"],null],["Ident",["SimpleLocal","expiry"],null],["Ident",["SimpleLocal","nonce"],null]]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","IsNotVoided"],null],[["Ident",["SimpleLocal","cheque_hash"],null],["Ident",["SimpleLocal","pubkey"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","IsValidSignature"],null],[["Ident",["SimpleLocal","execute"],null],["Ident",["SimpleLocal","cheque_hash"],null],["Ident",["SimpleLocal","pubkey"],null],["Ident",["SimpleLocal","signature"],null]]],null],[["MapUpdate",["Ident",["SimpleLocal","voided_cheques"],null],[["Ident",["SimpleLocal","pubkey"],null],["Ident",["SimpleLocal","cheque_hash"],null]],["Ident",["SimpleLocal","true"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","TransferCoins"],null],"comp_params":[[["Ident",["SimpleLocal","coins"],null],["ADT",["Ident",["SimpleLocal","Coins"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","from"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","to"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["MatchStmt",["Ident",["SimpleLocal","coins"],null],[[["Constructor",["Ident",["SimpleLocal","Coins"],null],[["Binder",["Ident",["SimpleLocal","denom"],null]],["Binder",["Ident",["SimpleLocal","amount"],null]]]],[[["MatchStmt",["Ident",["SimpleLocal","denom"],null],[[["Constructor",["Ident",["SimpleLocal","Zil"],null],[]],[[["Bind",["Ident",["SimpleLocal","msg"],null],[["Message",[["_tag",["MLit","AddFunds"]],["_recipient",["MVar",["Ident",["SimpleLocal","to"],null]]],["_amount",["MVar",["Ident",["SimpleLocal","amount"],null]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null]]],[["Constructor",["Ident",["SimpleLocal","Token"],null],[["Binder",["Ident",["SimpleLocal","token"],null]]]],[[["Load",["Ident",["SimpleLocal","maybe_token_proxy"],null],["Ident",["SimpleLocal","token_proxy"],null]],null],[["MatchStmt",["Ident",["SimpleLocal","maybe_token_proxy"],null],[[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeTokenProxyNotSet"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","t"],null]]]],[[["Bind",["Ident",["SimpleLocal","msg_to_token_proxy"],null],[["Message",[["_tag",["MLit","TransferFrom"]],["_recipient",["MVar",["Ident",["SimpleLocal","t"],null]]],["_amount",["MVar",["Ident",["SimpleLocal","zero"],null]]],["token",["MVar",["Ident",["SimpleLocal","token"],null]]],["from",["MVar",["Ident",["SimpleLocal","from"],null]]],["to",["MVar",["Ident",["SimpleLocal","to"],null]]],["amount",["MVar",["Ident",["SimpleLocal","amount"],null]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg_to_token_proxy"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null]]]]],null]]]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","TransferNFT"],null],"comp_params":[[["Ident",["SimpleLocal","token"],null],["ADT",["Ident",["SimpleLocal","NFT"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","from"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","to"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["MatchStmt",["Ident",["SimpleLocal","token"],null],[[["Constructor",["Ident",["SimpleLocal","NFT"],null],[["Binder",["Ident",["SimpleLocal","token_address"],null]],["Binder",["Ident",["SimpleLocal","token_id"],null]]]],[[["RemoteMapGet",["Ident",["SimpleLocal","maybe_token_owner"],null],["Ident",["SimpleLocal","token_address"],null],["Ident",["SimpleLocal","token_owners"],null],["Mutable"],[["Ident",["SimpleLocal","token_id"],null]],true],null],[["MatchStmt",["Ident",["SimpleLocal","maybe_token_owner"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","token_owner"],null]]]],[[["Bind",["Ident",["SimpleLocal","is_valid_owner"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","token_owner"],null],["Ident",["SimpleLocal","from"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_valid_owner"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidOwner"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidOwner"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null],[["Bind",["Ident",["SimpleLocal","msg_to_token"],null],[["Message",[["_tag",["MLit","TransferFrom"]],["_recipient",["MVar",["Ident",["SimpleLocal","token_address"],null]]],["_amount",["MVar",["Ident",["SimpleLocal","zero"],null]]],["to",["MVar",["Ident",["SimpleLocal","to"],null]]],["token_id",["MVar",["Ident",["SimpleLocal","token_id"],null]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg_to_token"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","ExecuteTrade"],null],"comp_params":[[["Ident",["SimpleLocal","token"],null],["ADT",["Ident",["SimpleLocal","NFT"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","price"],null],["ADT",["Ident",["SimpleLocal","Coins"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","fee_amount"],null],["PrimType",["Uint_typ",["Bits128"]]]],[["Ident",["SimpleLocal","sell_cheque"],null],["ADT",["Ident",["SimpleLocal","Cheque"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","buy_cheque"],null],["ADT",["Ident",["SimpleLocal","Cheque"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","ValidateAndConsumeCheque"],null],[["Ident",["SimpleLocal","token"],null],["Ident",["SimpleLocal","price"],null],["Ident",["SimpleLocal","fee_amount"],null],["Ident",["SimpleLocal","sell"],null],["Ident",["SimpleLocal","sell_cheque"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","ValidateAndConsumeCheque"],null],[["Ident",["SimpleLocal","token"],null],["Ident",["SimpleLocal","price"],null],["Ident",["SimpleLocal","zero"],null],["Ident",["SimpleLocal","buy"],null],["Ident",["SimpleLocal","buy_cheque"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","IsValidFee"],null],[["Ident",["SimpleLocal","price"],null],["Ident",["SimpleLocal","fee_amount"],null]]],null],[["MatchStmt",["Ident",["SimpleLocal","price"],null],[[["Constructor",["Ident",["SimpleLocal","Coins"],null],[["Binder",["Ident",["SimpleLocal","denom"],null]],["Binder",["Ident",["SimpleLocal","amount"],null]]]],[[["Load",["Ident",["SimpleLocal","fee_receiver"],null],["Ident",["SimpleLocal","fee_address"],null]],null],[["Bind",["Ident",["SimpleLocal","seller"],null],[["App",["Ident",["SimpleLocal","get_account"],null],[["Ident",["SimpleLocal","sell_cheque"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","buyer"],null],[["App",["Ident",["SimpleLocal","get_account"],null],[["Ident",["SimpleLocal","buy_cheque"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","seller_receive_amount"],null],[["Builtin",[["Builtin_sub"],null],[],[["Ident",["SimpleLocal","amount"],null],["Ident",["SimpleLocal","fee_amount"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","seller_receive_coins"],null],[["Constr",["Ident",["SimpleLocal","Coins"],null],[],[["Ident",["SimpleLocal","denom"],null],["Ident",["SimpleLocal","seller_receive_amount"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","fee_receive_coins"],null],[["Constr",["Ident",["SimpleLocal","Coins"],null],[],[["Ident",["SimpleLocal","denom"],null],["Ident",["SimpleLocal","fee_amount"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","denom"],null],[[["Constructor",["Ident",["SimpleLocal","Zil"],null],[]],[[["Bind",["Ident",["SimpleLocal","receiving_from_buyer"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","buyer"],null],["Ident",["SimpleLocal","_sender"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","receiving_from_buyer"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidPrice"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null],[["Bind",["Ident",["SimpleLocal","correct_amount"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","_amount"],null],["Ident",["SimpleLocal","amount"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","correct_amount"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeInvalidPrice"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]]]],null],[["AcceptPayment"],null]]],[["Wildcard"],[]]]],null],[["CallProc",null,["Ident",["SimpleLocal","TransferCoins"],null],[["Ident",["SimpleLocal","seller_receive_coins"],null],["Ident",["SimpleLocal","buyer"],null],["Ident",["SimpleLocal","seller"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","TransferCoins"],null],[["Ident",["SimpleLocal","fee_receive_coins"],null],["Ident",["SimpleLocal","buyer"],null],["Ident",["SimpleLocal","fee_receiver"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","TransferNFT"],null],[["Ident",["SimpleLocal","token"],null],["Ident",["SimpleLocal","seller"],null],["Ident",["SimpleLocal","buyer"],null]]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","ExecuteTradeSuccess"]],["initiator",["MVar",["Ident",["SimpleLocal","_sender"],null]]],["token",["MVar",["Ident",["SimpleLocal","token"],null]]],["seller",["MVar",["Ident",["SimpleLocal","seller"],null]]],["buyer",["MVar",["Ident",["SimpleLocal","buyer"],null]]],["proceeds",["MVar",["Ident",["SimpleLocal","seller_receive_coins"],null]]],["fees",["MVar",["Ident",["SimpleLocal","fee_receive_coins"],null]]],["sell_cheque",["MVar",["Ident",["SimpleLocal","sell_cheque"],null]]],["buy_cheque",["MVar",["Ident",["SimpleLocal","buy_cheque"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","VoidCheque"],null],"comp_params":[[["Ident",["SimpleLocal","cheque_hash"],null],["PrimType",["Bystrx_typ",32]]],[["Ident",["SimpleLocal","pubkey"],null],["PrimType",["Bystrx_typ",33]]],[["Ident",["SimpleLocal","signature"],null],["PrimType",["Bystrx_typ",64]]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","IsNotVoided"],null],[["Ident",["SimpleLocal","cheque_hash"],null],["Ident",["SimpleLocal","pubkey"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","IsValidSignature"],null],[["Ident",["SimpleLocal","void"],null],["Ident",["SimpleLocal","cheque_hash"],null],["Ident",["SimpleLocal","pubkey"],null],["Ident",["SimpleLocal","signature"],null]]],null],[["MapUpdate",["Ident",["SimpleLocal","voided_cheques"],null],[["Ident",["SimpleLocal","pubkey"],null],["Ident",["SimpleLocal","cheque_hash"],null]],["Ident",["SimpleLocal","true"],null]],null],[["Bind",["Ident",["SimpleLocal","from"],null],[["Builtin",[["Builtin_schnorr_get_address"],null],[],[["Ident",["SimpleLocal","pubkey"],null]]],null]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","VoidChequeSuccess"]],["initiator",["MVar",["Ident",["SimpleLocal","_sender"],null]]],["sender",["MVar",["Ident",["SimpleLocal","from"],null]]],["cheque_hash",["MVar",["Ident",["SimpleLocal","cheque_hash"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","SetTokenProxy"],null],"comp_params":[[["Ident",["SimpleLocal","address"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","IsOwner"],null],[["Ident",["SimpleLocal","_sender"],null]]],null],[["Load",["Ident",["SimpleLocal","t"],null],["Ident",["SimpleLocal","token_proxy"],null]],null],[["MatchStmt",["Ident",["SimpleLocal","t"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Wildcard"]]],[[["Bind",["Ident",["SimpleLocal","err"],null],[["Constr",["Ident",["SimpleLocal","CodeTokenProxyAlreadySet"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","ThrowError"],null],[["Ident",["SimpleLocal","err"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","new_token_proxy"],null],[["Constr",["Ident",["SimpleLocal","Some"],null],[["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","address"],null]]],null]],null],[["Store",["Ident",["SimpleLocal","token_proxy"],null],["Ident",["SimpleLocal","new_token_proxy"],null]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","SetTokenProxySuccess"]],["token_proxy",["MVar",["Ident",["SimpleLocal","address"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","TransferOwnership"],null],"comp_params":[[["Ident",["SimpleLocal","new_owner"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","IsOwner"],null],[["Ident",["SimpleLocal","_sender"],null]]],null],[["Bind",["Ident",["SimpleLocal","o"],null],[["Constr",["Ident",["SimpleLocal","Some"],null],[["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","new_owner"],null]]],null]],null],[["Store",["Ident",["SimpleLocal","pending_owner"],null],["Ident",["SimpleLocal","o"],null]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","OwnershipTransferInitiated"]],["current_owner",["MVar",["Ident",["SimpleLocal","_sender"],null]]],["pending_owner",["MVar",["Ident",["SimpleLocal","new_owner"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","AcceptOwnership"],null],"comp_params":[],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","IsPendingOwner"],null],[["Ident",["SimpleLocal","_sender"],null]]],null],[["Load",["Ident",["SimpleLocal","previous_current_owner"],null],["Ident",["SimpleLocal","current_owner"],null]],null],[["Bind",["Ident",["SimpleLocal","o"],null],[["Constr",["Ident",["SimpleLocal","Some"],null],[["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","_sender"],null]]],null]],null],[["Store",["Ident",["SimpleLocal","current_owner"],null],["Ident",["SimpleLocal","o"],null]],null],[["Store",["Ident",["SimpleLocal","pending_owner"],null],["Ident",["SimpleLocal","none"],null]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","OwnershipTransferAccepted"]],["previous_current_owner",["MVar",["Ident",["SimpleLocal","previous_current_owner"],null]]],["current_owner",["MVar",["Ident",["SimpleLocal","_sender"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","RevokeOwnership"],null],"comp_params":[],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","IsOwner"],null],[["Ident",["SimpleLocal","_sender"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","NoPendingOwner"],null],[]],null],[["Store",["Ident",["SimpleLocal","current_owner"],null],["Ident",["SimpleLocal","none"],null]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","OwnershipRevoked"]],["current_owner",["MVar",["Ident",["SimpleLocal","_sender"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","TransferFromSuccessCallBack"],null],"comp_params":[[["Ident",["SimpleLocal","from"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","recipient"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","token_id"],null],["PrimType",["Uint_typ",["Bits256"]]]]],"comp_body":[],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","ZRC6_TransferFromCallback"],null],"comp_params":[[["Ident",["SimpleLocal","from"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","to"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","token_id"],null],["PrimType",["Uint_typ",["Bits256"]]]]],"comp_body":[],"comp_return":null}]}} diff --git a/tests/formatter/to_json/codehash.t/run.t b/tests/formatter/to_json/codehash.t/run.t index 4c6d7c866..c112a2629 100644 --- a/tests/formatter/to_json/codehash.t/run.t +++ b/tests/formatter/to_json/codehash.t/run.t @@ -1,2 +1,2 @@ $ scilla-fmt --json --deannot codehash.scilla - {"smver":0,"libs":null,"elibs":[],"contr":{"cname":["Ident",["SimpleLocal","Codehash"],null],"cparams":[],"cconstraint":[["Literal",{"name":["SimpleLocal","True"],"types":[],"lits":[]}],null],"cfields":[],"ccomps":[{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","foo"],null],"comp_params":[[["Ident",["SimpleLocal","addr"],null],["Address","Address"]]],"comp_body":[[["RemoteLoad",["Ident",["SimpleLocal","bar"],null],["Ident",["SimpleLocal","addr"],null],["Ident",["SimpleLocal","_codehash"],null]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","Success"]],["bar",["MVar",["Ident",["SimpleLocal","bar"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","foo2"],null],"comp_params":[[["Ident",["SimpleLocal","addr"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["TypeCast",["Ident",["SimpleLocal","addr_"],null],["Ident",["SimpleLocal","addr"],null],["Address","Address"]],null],[["MatchStmt",["Ident",["SimpleLocal","addr_"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","addr__"],null]]]],[[["RemoteLoad",["Ident",["SimpleLocal","bar"],null],["Ident",["SimpleLocal","addr__"],null],["Ident",["SimpleLocal","_codehash"],null]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","Success"]],["bar",["MVar",["Ident",["SimpleLocal","bar"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","Failure"]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","foo3"],null],"comp_params":[[["Ident",["SimpleLocal","addr"],null],["Address","Address"]]],"comp_body":[[["RemoteLoad",["Ident",["SimpleLocal","bar"],null],["Ident",["SimpleLocal","addr"],null],["Ident",["SimpleLocal","_codehash"],null]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","Success"]],["bar",["MVar",["Ident",["SimpleLocal","bar"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","foo4"],null],"comp_params":[[["Ident",["SimpleLocal","addr"],null],["Address","Address"]]],"comp_body":[[["RemoteLoad",["Ident",["SimpleLocal","bar"],null],["Ident",["SimpleLocal","addr"],null],["Ident",["SimpleLocal","_codehash"],null]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","Success"]],["bar",["MVar",["Ident",["SimpleLocal","bar"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null}]}} + {"smver":0,"libs":null,"elibs":[],"contr":{"cname":["Ident",["SimpleLocal","Codehash"],null],"cparams":[],"cconstraint":[["Literal",{"name":["SimpleLocal","True"],"types":[],"lits":[]}],null],"cfields":[],"ccomps":[{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","foo"],null],"comp_params":[[["Ident",["SimpleLocal","addr"],null],["Address","Address"]]],"comp_body":[[["RemoteLoad",["Ident",["SimpleLocal","bar"],null],["Ident",["SimpleLocal","addr"],null],["Ident",["SimpleLocal","_codehash"],null],["Mutable"]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","Success"]],["bar",["MVar",["Ident",["SimpleLocal","bar"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","foo2"],null],"comp_params":[[["Ident",["SimpleLocal","addr"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["TypeCast",["Ident",["SimpleLocal","addr_"],null],["Ident",["SimpleLocal","addr"],null],["Address","Address"]],null],[["MatchStmt",["Ident",["SimpleLocal","addr_"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","addr__"],null]]]],[[["RemoteLoad",["Ident",["SimpleLocal","bar"],null],["Ident",["SimpleLocal","addr__"],null],["Ident",["SimpleLocal","_codehash"],null],["Mutable"]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","Success"]],["bar",["MVar",["Ident",["SimpleLocal","bar"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","Failure"]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","foo3"],null],"comp_params":[[["Ident",["SimpleLocal","addr"],null],["Address","Address"]]],"comp_body":[[["RemoteLoad",["Ident",["SimpleLocal","bar"],null],["Ident",["SimpleLocal","addr"],null],["Ident",["SimpleLocal","_codehash"],null],["Mutable"]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","Success"]],["bar",["MVar",["Ident",["SimpleLocal","bar"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","foo4"],null],"comp_params":[[["Ident",["SimpleLocal","addr"],null],["Address","Address"]]],"comp_body":[[["RemoteLoad",["Ident",["SimpleLocal","bar"],null],["Ident",["SimpleLocal","addr"],null],["Ident",["SimpleLocal","_codehash"],null],["Mutable"]],null],[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_eventname",["MLit","Success"]],["bar",["MVar",["Ident",["SimpleLocal","bar"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null}]}} diff --git a/tests/formatter/to_json/crowdfunding_governor.t/run.t b/tests/formatter/to_json/crowdfunding_governor.t/run.t index 2c30e12e7..6586e1eca 100644 --- a/tests/formatter/to_json/crowdfunding_governor.t/run.t +++ b/tests/formatter/to_json/crowdfunding_governor.t/run.t @@ -1,2 +1,2 @@ $ scilla-fmt --json --deannot crowdfunding_governor.scilla - {"smver":0,"libs":{"lname":["Ident",["SimpleLocal","CrowdfundingGovernor"],null],"lentries":[["LibVar",["Ident",["SimpleLocal","zero"],null],null,[["Literal","0"],null]],["LibVar",["Ident",["SimpleLocal","one_msg"],null],null,[["Fun",["Ident",["SimpleLocal","msg"],null],["PrimType",["Msg_typ"]],[["Let",["Ident",["SimpleLocal","nil_msg"],null],null,[["Constr",["Ident",["SimpleLocal","Nil"],null],[["PrimType",["Msg_typ"]]],[]],null],[["Constr",["Ident",["SimpleLocal","Cons"],null],[["PrimType",["Msg_typ"]]],[["Ident",["SimpleLocal","msg"],null],["Ident",["SimpleLocal","nil_msg"],null]]],null]],null]],null]],["LibVar",["Ident",["SimpleLocal","deadline_passed"],null],null,[["Fun",["Ident",["SimpleLocal","cur_block"],null],["PrimType",["Bnum_typ"]],[["Fun",["Ident",["SimpleLocal","max_block"],null],["PrimType",["Bnum_typ"]],[["Builtin",[["Builtin_blt"],null],[],[["Ident",["SimpleLocal","max_block"],null],["Ident",["SimpleLocal","cur_block"],null]]],null]],null]],null]],["LibVar",["Ident",["SimpleLocal","target_not_reached"],null],null,[["Fun",["Ident",["SimpleLocal","balance"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Fun",["Ident",["SimpleLocal","goal"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Builtin",[["Builtin_lt"],null],[],[["Ident",["SimpleLocal","balance"],null],["Ident",["SimpleLocal","goal"],null]]],null]],null]],null]],["LibTyp",["Ident",["SimpleLocal","Error"],null],[{"cname":["Ident",["SimpleLocal","SenderIsNotContractOwner"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","SenderAlreadyDonated"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","SenderHasNotDonated"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","DeadlineHasNotPassedYet"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","DeadlineHasPassed"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","TargetIsReached"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","TargetIsNotReached"],null],"c_arg_types":[]}]],["LibVar",["Ident",["SimpleLocal","make_error"],null],null,[["Fun",["Ident",["SimpleLocal","result"],null],["ADT",["Ident",["SimpleLocal","Error"],{"fname":"","lnum":0,"cnum":0}],[]],[["Let",["Ident",["SimpleLocal","result_code"],null],null,[["MatchExpr",["Ident",["SimpleLocal","result"],null],[[["Constructor",["Ident",["SimpleLocal","SenderIsNotContractOwner"],null],[]],[["Literal","-1"],null]],[["Constructor",["Ident",["SimpleLocal","SenderAlreadyDonated"],null],[]],[["Literal","-2"],null]],[["Constructor",["Ident",["SimpleLocal","SenderHasNotDonated"],null],[]],[["Literal","-3"],null]],[["Constructor",["Ident",["SimpleLocal","DeadlineHasNotPassedYet"],null],[]],[["Literal","-4"],null]],[["Constructor",["Ident",["SimpleLocal","DeadlineHasPassed"],null],[]],[["Literal","-5"],null]],[["Constructor",["Ident",["SimpleLocal","TargetIsReached"],null],[]],[["Literal","-6"],null]],[["Constructor",["Ident",["SimpleLocal","TargetIsNotReached"],null],[]],[["Literal","-7"],null]]]],null],[["Message",[["_exception",["MLit","Error"]],["code",["MVar",["Ident",["SimpleLocal","result_code"],null]]]]],null]],null]],null]]]},"elibs":[],"contr":{"cname":["Ident",["SimpleLocal","CrowdfundingGovernor"],null],"cparams":[[["Ident",["SimpleLocal","contract_owner"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","max_block"],null],["PrimType",["Bnum_typ"]]],[["Ident",["SimpleLocal","goal"],null],["PrimType",["Uint_typ",["Bits128"]]]],[["Ident",["SimpleLocal","storage"],null],["Address","Address"]]],"cconstraint":[["Let",["Ident",["SimpleLocal","zero"],null],null,[["Literal","0"],null],[["Builtin",[["Builtin_lt"],null],[],[["Ident",["SimpleLocal","zero"],null],["Ident",["SimpleLocal","goal"],null]]],null]],null],"cfields":[],"ccomps":[{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","Throw"],null],"comp_params":[[["Ident",["SimpleLocal","error"],null],["ADT",["Ident",["SimpleLocal","Error"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","e"],null],[["App",["Ident",["SimpleLocal","make_error"],null],[["Ident",["SimpleLocal","error"],null]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","RequireContractOwner"],null],"comp_params":[],"comp_body":[[["Bind",["Ident",["SimpleLocal","is_contract_owner"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","contract_owner"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_contract_owner"],null],[[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Constr",["Ident",["SimpleLocal","SenderIsNotContractOwner"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","Throw"],null],[["Ident",["SimpleLocal","e"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","SetBackersKey"],null],"comp_params":[[["Ident",["SimpleLocal","key"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","val"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","msg"],null],[["Message",[["_tag",["MLit","SetBackersKey"]],["_recipient",["MVar",["Ident",["SimpleLocal","storage"],null]]],["_amount",["MVar",["Ident",["SimpleLocal","zero"],null]]],["key",["MVar",["Ident",["SimpleLocal","key"],null]]],["val",["MVar",["Ident",["SimpleLocal","val"],null]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","DeleteBackersKey"],null],"comp_params":[[["Ident",["SimpleLocal","key"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","msg"],null],[["Message",[["_tag",["MLit","DeleteBackersKey"]],["_recipient",["MVar",["Ident",["SimpleLocal","storage"],null]]],["_amount",["MVar",["Ident",["SimpleLocal","zero"],null]]],["key",["MVar",["Ident",["SimpleLocal","key"],null]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","RequireBeforeDeadline"],null],"comp_params":[],"comp_body":[[["ReadFromBC",["Ident",["SimpleLocal","blk"],null],["CurBlockNum"]],null],[["Bind",["Ident",["SimpleLocal","after_deadline"],null],[["App",["Ident",["SimpleLocal","deadline_passed"],null],[["Ident",["SimpleLocal","blk"],null],["Ident",["SimpleLocal","max_block"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","after_deadline"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Constr",["Ident",["SimpleLocal","DeadlineHasPassed"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","Throw"],null],[["Ident",["SimpleLocal","e"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","RequireAfterDeadline"],null],"comp_params":[],"comp_body":[[["ReadFromBC",["Ident",["SimpleLocal","blk"],null],["CurBlockNum"]],null],[["Bind",["Ident",["SimpleLocal","after_deadline"],null],[["App",["Ident",["SimpleLocal","deadline_passed"],null],[["Ident",["SimpleLocal","blk"],null],["Ident",["SimpleLocal","max_block"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","after_deadline"],null],[[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Constr",["Ident",["SimpleLocal","DeadlineHasNotPassedYet"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","Throw"],null],[["Ident",["SimpleLocal","e"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","RequireTargetNotReached"],null],"comp_params":[],"comp_body":[[["Load",["Ident",["SimpleLocal","bal"],null],["Ident",["SimpleLocal","_balance"],null]],null],[["Bind",["Ident",["SimpleLocal","is_target_not_reached"],null],[["App",["Ident",["SimpleLocal","target_not_reached"],null],[["Ident",["SimpleLocal","bal"],null],["Ident",["SimpleLocal","goal"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_target_not_reached"],null],[[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Constr",["Ident",["SimpleLocal","TargetIsReached"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","Throw"],null],[["Ident",["SimpleLocal","e"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","RequireTargetReached"],null],"comp_params":[],"comp_body":[[["Load",["Ident",["SimpleLocal","bal"],null],["Ident",["SimpleLocal","_balance"],null]],null],[["Bind",["Ident",["SimpleLocal","is_target_not_reached"],null],[["App",["Ident",["SimpleLocal","target_not_reached"],null],[["Ident",["SimpleLocal","bal"],null],["Ident",["SimpleLocal","goal"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_target_not_reached"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Constr",["Ident",["SimpleLocal","TargetIsNotReached"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","Throw"],null],[["Ident",["SimpleLocal","e"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","RequireSenderHasNotDonated"],null],"comp_params":[],"comp_body":[[["RemoteMapGet",["Ident",["SimpleLocal","already_donated"],null],["Ident",["SimpleLocal","storage"],null],["Ident",["SimpleLocal","backers"],null],[["Ident",["SimpleLocal","_sender"],null]],false],null],[["MatchStmt",["Ident",["SimpleLocal","already_donated"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Constr",["Ident",["SimpleLocal","SenderAlreadyDonated"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","Throw"],null],[["Ident",["SimpleLocal","e"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","SendFunds"],null],"comp_params":[[["Ident",["SimpleLocal","recipient"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","amount"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","msg"],null],[["Message",[["_tag",["MLit","AddFunds"]],["_recipient",["MVar",["Ident",["SimpleLocal","recipient"],null]]],["_amount",["MVar",["Ident",["SimpleLocal","amount"],null]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","Donate"],null],"comp_params":[],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","RequireBeforeDeadline"],null],[]],null],[["CallProc",null,["Ident",["SimpleLocal","RequireSenderHasNotDonated"],null],[]],null],[["AcceptPayment"],null],[["CallProc",null,["Ident",["SimpleLocal","SetBackersKey"],null],[["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","_amount"],null]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","GetFunds"],null],"comp_params":[],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","RequireContractOwner"],null],[]],null],[["CallProc",null,["Ident",["SimpleLocal","RequireAfterDeadline"],null],[]],null],[["CallProc",null,["Ident",["SimpleLocal","RequireTargetReached"],null],[]],null],[["Load",["Ident",["SimpleLocal","amount"],null],["Ident",["SimpleLocal","_balance"],null]],null],[["CallProc",null,["Ident",["SimpleLocal","SendFunds"],null],[["Ident",["SimpleLocal","contract_owner"],null],["Ident",["SimpleLocal","amount"],null]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","ClaimBack"],null],"comp_params":[],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","RequireAfterDeadline"],null],[]],null],[["CallProc",null,["Ident",["SimpleLocal","RequireTargetNotReached"],null],[]],null],[["RemoteMapGet",["Ident",["SimpleLocal","oamount"],null],["Ident",["SimpleLocal","storage"],null],["Ident",["SimpleLocal","backers"],null],[["Ident",["SimpleLocal","_sender"],null]],true],null],[["MatchStmt",["Ident",["SimpleLocal","oamount"],null],[[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Constr",["Ident",["SimpleLocal","SenderHasNotDonated"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","Throw"],null],[["Ident",["SimpleLocal","e"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","amount"],null]]]],[[["CallProc",null,["Ident",["SimpleLocal","SendFunds"],null],[["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","amount"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","DeleteBackersKey"],null],[["Ident",["SimpleLocal","_sender"],null]]],null]]]]],null]],"comp_return":null}]}} + {"smver":0,"libs":{"lname":["Ident",["SimpleLocal","CrowdfundingGovernor"],null],"lentries":[["LibVar",["Ident",["SimpleLocal","zero"],null],null,[["Literal","0"],null]],["LibVar",["Ident",["SimpleLocal","one_msg"],null],null,[["Fun",["Ident",["SimpleLocal","msg"],null],["PrimType",["Msg_typ"]],[["Let",["Ident",["SimpleLocal","nil_msg"],null],null,[["Constr",["Ident",["SimpleLocal","Nil"],null],[["PrimType",["Msg_typ"]]],[]],null],[["Constr",["Ident",["SimpleLocal","Cons"],null],[["PrimType",["Msg_typ"]]],[["Ident",["SimpleLocal","msg"],null],["Ident",["SimpleLocal","nil_msg"],null]]],null]],null]],null]],["LibVar",["Ident",["SimpleLocal","deadline_passed"],null],null,[["Fun",["Ident",["SimpleLocal","cur_block"],null],["PrimType",["Bnum_typ"]],[["Fun",["Ident",["SimpleLocal","max_block"],null],["PrimType",["Bnum_typ"]],[["Builtin",[["Builtin_blt"],null],[],[["Ident",["SimpleLocal","max_block"],null],["Ident",["SimpleLocal","cur_block"],null]]],null]],null]],null]],["LibVar",["Ident",["SimpleLocal","target_not_reached"],null],null,[["Fun",["Ident",["SimpleLocal","balance"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Fun",["Ident",["SimpleLocal","goal"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Builtin",[["Builtin_lt"],null],[],[["Ident",["SimpleLocal","balance"],null],["Ident",["SimpleLocal","goal"],null]]],null]],null]],null]],["LibTyp",["Ident",["SimpleLocal","Error"],null],[{"cname":["Ident",["SimpleLocal","SenderIsNotContractOwner"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","SenderAlreadyDonated"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","SenderHasNotDonated"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","DeadlineHasNotPassedYet"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","DeadlineHasPassed"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","TargetIsReached"],null],"c_arg_types":[]},{"cname":["Ident",["SimpleLocal","TargetIsNotReached"],null],"c_arg_types":[]}]],["LibVar",["Ident",["SimpleLocal","make_error"],null],null,[["Fun",["Ident",["SimpleLocal","result"],null],["ADT",["Ident",["SimpleLocal","Error"],{"fname":"","lnum":0,"cnum":0}],[]],[["Let",["Ident",["SimpleLocal","result_code"],null],null,[["MatchExpr",["Ident",["SimpleLocal","result"],null],[[["Constructor",["Ident",["SimpleLocal","SenderIsNotContractOwner"],null],[]],[["Literal","-1"],null]],[["Constructor",["Ident",["SimpleLocal","SenderAlreadyDonated"],null],[]],[["Literal","-2"],null]],[["Constructor",["Ident",["SimpleLocal","SenderHasNotDonated"],null],[]],[["Literal","-3"],null]],[["Constructor",["Ident",["SimpleLocal","DeadlineHasNotPassedYet"],null],[]],[["Literal","-4"],null]],[["Constructor",["Ident",["SimpleLocal","DeadlineHasPassed"],null],[]],[["Literal","-5"],null]],[["Constructor",["Ident",["SimpleLocal","TargetIsReached"],null],[]],[["Literal","-6"],null]],[["Constructor",["Ident",["SimpleLocal","TargetIsNotReached"],null],[]],[["Literal","-7"],null]]]],null],[["Message",[["_exception",["MLit","Error"]],["code",["MVar",["Ident",["SimpleLocal","result_code"],null]]]]],null]],null]],null]]]},"elibs":[],"contr":{"cname":["Ident",["SimpleLocal","CrowdfundingGovernor"],null],"cparams":[[["Ident",["SimpleLocal","contract_owner"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","max_block"],null],["PrimType",["Bnum_typ"]]],[["Ident",["SimpleLocal","goal"],null],["PrimType",["Uint_typ",["Bits128"]]]],[["Ident",["SimpleLocal","storage"],null],["Address","Address"]]],"cconstraint":[["Let",["Ident",["SimpleLocal","zero"],null],null,[["Literal","0"],null],[["Builtin",[["Builtin_lt"],null],[],[["Ident",["SimpleLocal","zero"],null],["Ident",["SimpleLocal","goal"],null]]],null]],null],"cfields":[],"ccomps":[{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","Throw"],null],"comp_params":[[["Ident",["SimpleLocal","error"],null],["ADT",["Ident",["SimpleLocal","Error"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","e"],null],[["App",["Ident",["SimpleLocal","make_error"],null],[["Ident",["SimpleLocal","error"],null]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","RequireContractOwner"],null],"comp_params":[],"comp_body":[[["Bind",["Ident",["SimpleLocal","is_contract_owner"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","contract_owner"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_contract_owner"],null],[[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Constr",["Ident",["SimpleLocal","SenderIsNotContractOwner"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","Throw"],null],[["Ident",["SimpleLocal","e"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","SetBackersKey"],null],"comp_params":[[["Ident",["SimpleLocal","key"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","val"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","msg"],null],[["Message",[["_tag",["MLit","SetBackersKey"]],["_recipient",["MVar",["Ident",["SimpleLocal","storage"],null]]],["_amount",["MVar",["Ident",["SimpleLocal","zero"],null]]],["key",["MVar",["Ident",["SimpleLocal","key"],null]]],["val",["MVar",["Ident",["SimpleLocal","val"],null]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","DeleteBackersKey"],null],"comp_params":[[["Ident",["SimpleLocal","key"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","msg"],null],[["Message",[["_tag",["MLit","DeleteBackersKey"]],["_recipient",["MVar",["Ident",["SimpleLocal","storage"],null]]],["_amount",["MVar",["Ident",["SimpleLocal","zero"],null]]],["key",["MVar",["Ident",["SimpleLocal","key"],null]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","RequireBeforeDeadline"],null],"comp_params":[],"comp_body":[[["ReadFromBC",["Ident",["SimpleLocal","blk"],null],["CurBlockNum"]],null],[["Bind",["Ident",["SimpleLocal","after_deadline"],null],[["App",["Ident",["SimpleLocal","deadline_passed"],null],[["Ident",["SimpleLocal","blk"],null],["Ident",["SimpleLocal","max_block"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","after_deadline"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Constr",["Ident",["SimpleLocal","DeadlineHasPassed"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","Throw"],null],[["Ident",["SimpleLocal","e"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","RequireAfterDeadline"],null],"comp_params":[],"comp_body":[[["ReadFromBC",["Ident",["SimpleLocal","blk"],null],["CurBlockNum"]],null],[["Bind",["Ident",["SimpleLocal","after_deadline"],null],[["App",["Ident",["SimpleLocal","deadline_passed"],null],[["Ident",["SimpleLocal","blk"],null],["Ident",["SimpleLocal","max_block"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","after_deadline"],null],[[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Constr",["Ident",["SimpleLocal","DeadlineHasNotPassedYet"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","Throw"],null],[["Ident",["SimpleLocal","e"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","RequireTargetNotReached"],null],"comp_params":[],"comp_body":[[["Load",["Ident",["SimpleLocal","bal"],null],["Ident",["SimpleLocal","_balance"],null]],null],[["Bind",["Ident",["SimpleLocal","is_target_not_reached"],null],[["App",["Ident",["SimpleLocal","target_not_reached"],null],[["Ident",["SimpleLocal","bal"],null],["Ident",["SimpleLocal","goal"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_target_not_reached"],null],[[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Constr",["Ident",["SimpleLocal","TargetIsReached"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","Throw"],null],[["Ident",["SimpleLocal","e"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","RequireTargetReached"],null],"comp_params":[],"comp_body":[[["Load",["Ident",["SimpleLocal","bal"],null],["Ident",["SimpleLocal","_balance"],null]],null],[["Bind",["Ident",["SimpleLocal","is_target_not_reached"],null],[["App",["Ident",["SimpleLocal","target_not_reached"],null],[["Ident",["SimpleLocal","bal"],null],["Ident",["SimpleLocal","goal"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_target_not_reached"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Constr",["Ident",["SimpleLocal","TargetIsNotReached"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","Throw"],null],[["Ident",["SimpleLocal","e"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","RequireSenderHasNotDonated"],null],"comp_params":[],"comp_body":[[["RemoteMapGet",["Ident",["SimpleLocal","already_donated"],null],["Ident",["SimpleLocal","storage"],null],["Ident",["SimpleLocal","backers"],null],["Mutable"],[["Ident",["SimpleLocal","_sender"],null]],false],null],[["MatchStmt",["Ident",["SimpleLocal","already_donated"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Constr",["Ident",["SimpleLocal","SenderAlreadyDonated"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","Throw"],null],[["Ident",["SimpleLocal","e"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","SendFunds"],null],"comp_params":[[["Ident",["SimpleLocal","recipient"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","amount"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","msg"],null],[["Message",[["_tag",["MLit","AddFunds"]],["_recipient",["MVar",["Ident",["SimpleLocal","recipient"],null]]],["_amount",["MVar",["Ident",["SimpleLocal","amount"],null]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","Donate"],null],"comp_params":[],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","RequireBeforeDeadline"],null],[]],null],[["CallProc",null,["Ident",["SimpleLocal","RequireSenderHasNotDonated"],null],[]],null],[["AcceptPayment"],null],[["CallProc",null,["Ident",["SimpleLocal","SetBackersKey"],null],[["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","_amount"],null]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","GetFunds"],null],"comp_params":[],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","RequireContractOwner"],null],[]],null],[["CallProc",null,["Ident",["SimpleLocal","RequireAfterDeadline"],null],[]],null],[["CallProc",null,["Ident",["SimpleLocal","RequireTargetReached"],null],[]],null],[["Load",["Ident",["SimpleLocal","amount"],null],["Ident",["SimpleLocal","_balance"],null]],null],[["CallProc",null,["Ident",["SimpleLocal","SendFunds"],null],[["Ident",["SimpleLocal","contract_owner"],null],["Ident",["SimpleLocal","amount"],null]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","ClaimBack"],null],"comp_params":[],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","RequireAfterDeadline"],null],[]],null],[["CallProc",null,["Ident",["SimpleLocal","RequireTargetNotReached"],null],[]],null],[["RemoteMapGet",["Ident",["SimpleLocal","oamount"],null],["Ident",["SimpleLocal","storage"],null],["Ident",["SimpleLocal","backers"],null],["Mutable"],[["Ident",["SimpleLocal","_sender"],null]],true],null],[["MatchStmt",["Ident",["SimpleLocal","oamount"],null],[[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Constr",["Ident",["SimpleLocal","SenderHasNotDonated"],null],[],[]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","Throw"],null],[["Ident",["SimpleLocal","e"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","amount"],null]]]],[[["CallProc",null,["Ident",["SimpleLocal","SendFunds"],null],[["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","amount"],null]]],null],[["CallProc",null,["Ident",["SimpleLocal","DeleteBackersKey"],null],[["Ident",["SimpleLocal","_sender"],null]]],null]]]]],null]],"comp_return":null}]}} diff --git a/tests/formatter/to_json/polymorphic_address.t/run.t b/tests/formatter/to_json/polymorphic_address.t/run.t index eed4f40c9..5e14fb5b0 100644 --- a/tests/formatter/to_json/polymorphic_address.t/run.t +++ b/tests/formatter/to_json/polymorphic_address.t/run.t @@ -1,2 +1,2 @@ $ scilla-fmt --json --deannot polymorphic_address.scilla - {"smver":0,"libs":{"lname":["Ident",["SimpleLocal","AddressListTraversalLib"],null],"lentries":[["LibVar",["Ident",["SimpleLocal","f"],null],["PolyFun","'A",["FunType",["Address","Address"],["Address","Address"]]],[["TFun",["Ident",["SimpleLocal","'A"],null],[["Fun",["Ident",["SimpleLocal","x"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","x"],null]],null]],null]],null]]]},"elibs":[[["Ident",["SimpleLocal","ListUtils"],null],null]],"contr":{"cname":["Ident",["SimpleLocal","AddressListTraversal"],null],"cparams":[],"cconstraint":[["Literal",{"name":["SimpleLocal","True"],"types":[],"lits":[]}],null],"cfields":[[["Ident",["SimpleLocal","res_1"],null],["PrimType",["Uint_typ",["Bits32"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","res_2"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]]],"ccomps":[{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","Test1"],null],"comp_params":[[["Ident",["SimpleLocal","param1"],null],["Address","Address"]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","f_spec"],null],[["TApp",["Ident",["SimpleLocal","f"],null],[["PrimType",["Uint_typ",["Bits32"]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","p1"],null],[["App",["Ident",["SimpleLocal","f_spec"],null],[["Ident",["SimpleLocal","param1"],null]]],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","res"],null],["Ident",["SimpleLocal","p1"],null],["Ident",["SimpleLocal","f"],null]],null],[["Store",["Ident",["SimpleLocal","res_1"],null],["Ident",["SimpleLocal","res"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","Test2"],null],"comp_params":[[["Ident",["SimpleLocal","param1"],null],["Address","Address"]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","f_spec"],null],[["TApp",["Ident",["SimpleLocal","f"],null],[["PrimType",["Uint_typ",["Bits128"]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","p1"],null],[["App",["Ident",["SimpleLocal","f_spec"],null],[["Ident",["SimpleLocal","param1"],null]]],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","res"],null],["Ident",["SimpleLocal","p1"],null],["Ident",["SimpleLocal","f"],null]],null],[["Store",["Ident",["SimpleLocal","res_2"],null],["Ident",["SimpleLocal","res"],null]],null]],"comp_return":null}]}} + {"smver":0,"libs":{"lname":["Ident",["SimpleLocal","AddressListTraversalLib"],null],"lentries":[["LibVar",["Ident",["SimpleLocal","f"],null],["PolyFun","'A",["FunType",["Address","Address"],["Address","Address"]]],[["TFun",["Ident",["SimpleLocal","'A"],null],[["Fun",["Ident",["SimpleLocal","x"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","x"],null]],null]],null]],null]]]},"elibs":[[["Ident",["SimpleLocal","ListUtils"],null],null]],"contr":{"cname":["Ident",["SimpleLocal","AddressListTraversal"],null],"cparams":[],"cconstraint":[["Literal",{"name":["SimpleLocal","True"],"types":[],"lits":[]}],null],"cfields":[[["Ident",["SimpleLocal","res_1"],null],["PrimType",["Uint_typ",["Bits32"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","res_2"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]]],"ccomps":[{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","Test1"],null],"comp_params":[[["Ident",["SimpleLocal","param1"],null],["Address","Address"]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","f_spec"],null],[["TApp",["Ident",["SimpleLocal","f"],null],[["PrimType",["Uint_typ",["Bits32"]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","p1"],null],[["App",["Ident",["SimpleLocal","f_spec"],null],[["Ident",["SimpleLocal","param1"],null]]],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","res"],null],["Ident",["SimpleLocal","p1"],null],["Ident",["SimpleLocal","f"],null],["Mutable"]],null],[["Store",["Ident",["SimpleLocal","res_1"],null],["Ident",["SimpleLocal","res"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","Test2"],null],"comp_params":[[["Ident",["SimpleLocal","param1"],null],["Address","Address"]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","f_spec"],null],[["TApp",["Ident",["SimpleLocal","f"],null],[["PrimType",["Uint_typ",["Bits128"]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","p1"],null],[["App",["Ident",["SimpleLocal","f_spec"],null],[["Ident",["SimpleLocal","param1"],null]]],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","res"],null],["Ident",["SimpleLocal","p1"],null],["Ident",["SimpleLocal","f"],null],["Mutable"]],null],[["Store",["Ident",["SimpleLocal","res_2"],null],["Ident",["SimpleLocal","res"],null]],null]],"comp_return":null}]}} diff --git a/tests/formatter/to_json/remote_state_reads.t/run.t b/tests/formatter/to_json/remote_state_reads.t/run.t index e3339a6f8..52a3e99b7 100644 --- a/tests/formatter/to_json/remote_state_reads.t/run.t +++ b/tests/formatter/to_json/remote_state_reads.t/run.t @@ -1,2 +1,2 @@ $ scilla-fmt --json --deannot remote_state_reads.scilla - {"smver":0,"libs":{"lname":["Ident",["SimpleLocal","RRLib"],null],"lentries":[["LibTyp",["Ident",["SimpleLocal","AddressADT"],null],[{"cname":["Ident",["SimpleLocal","Address1"],null],"c_arg_types":[["Address","Address"]]},{"cname":["Ident",["SimpleLocal","Address2"],null],"c_arg_types":[["Address","Address"]]}]]]},"elibs":[],"contr":{"cname":["Ident",["SimpleLocal","RRContract"],null],"cparams":[[["Ident",["SimpleLocal","cparam1"],null],["Address","Address"]],[["Ident",["SimpleLocal","cparam2"],null],["Address","Address"]],[["Ident",["SimpleLocal","cparam3"],null],["Address","Address"]]],"cconstraint":[["Literal",{"name":["SimpleLocal","True"],"types":[],"lits":[]}],null],"cfields":[[["Ident",["SimpleLocal","assign_test_1"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","assign_test_2"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","assign_test_3"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","assign_test_4"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","assign_test_5"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","assign_test_6"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","assign_test_7"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","assign_test_8"],null],["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]],[["Constr",["Ident",["SimpleLocal","Address1"],null],[],[["Ident",["SimpleLocal","cparam1"],null]]],null]],[["Ident",["SimpleLocal","assign_test_9"],null],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]]],[["Constr",["Ident",["SimpleLocal","Nil"],null],[["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]],[]],null]],[["Ident",["SimpleLocal","assign_test_10"],null],["MapType",["PrimType",["Uint_typ",["Bits128"]]],["MapType",["PrimType",["Uint_typ",["Bits128"]]],["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]]],[["Literal",{"mtype":[["PrimType",["Uint_typ",["Bits128"]]],["MapType",["PrimType",["Uint_typ",["Bits128"]]],["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]]],"data":[]}],null]],[["Ident",["SimpleLocal","remote_reads_test_res_1_1"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","remote_reads_test_res_2_1"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_1"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_3"],null],["PrimType",["Uint_typ",["Bits32"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_4"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_5"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_6"],null],["MapType",["Address","Address"],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Literal",{"mtype":[["Address","Address"],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]],"data":[]}],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_7"],null],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]],[["Constr",["Ident",["SimpleLocal","True"],null],[],[]],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_8"],null],["ADT",["Ident",["SimpleLocal","Option"],{"fname":"","lnum":0,"cnum":0}],[["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],[["Let",["Ident",["SimpleLocal","x"],null],null,[["Constr",["Ident",["SimpleLocal","True"],null],[],[]],null],[["Constr",["Ident",["SimpleLocal","Some"],null],[["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","x"],null]]],null]],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_9"],null],["MapType",["PrimType",["Uint_typ",["Bits32"]]],["MapType",["Address","Address"],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],[["Literal",{"mtype":[["PrimType",["Uint_typ",["Bits32"]]],["MapType",["Address","Address"],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],"data":[]}],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_10"],null],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]],[["Constr",["Ident",["SimpleLocal","False"],null],[],[]],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_11"],null],["ADT",["Ident",["SimpleLocal","Option"],{"fname":"","lnum":0,"cnum":0}],[["MapType",["Address","Address"],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]]],[["Constr",["Ident",["SimpleLocal","None"],null],[["MapType",["Address","Address"],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],[]],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_12"],null],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]],[["Constr",["Ident",["SimpleLocal","False"],null],[],[]],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_13"],null],["ADT",["Ident",["SimpleLocal","Option"],{"fname":"","lnum":0,"cnum":0}],[["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],[["Constr",["Ident",["SimpleLocal","None"],null],[["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]],[]],null]],[["Ident",["SimpleLocal","sender_balance_pre"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","sender_balance_mid"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","sender_balance_post"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]]],"ccomps":[{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","RemoteReadsTest"],null],"comp_params":[[["Ident",["SimpleLocal","remote1"],null],["Address","Address"]],[["Ident",["SimpleLocal","remote2"],null],["Address","Address"]],[["Ident",["SimpleLocal","remote3"],null],["Address","Address"]]],"comp_body":[[["RemoteLoad",["Ident",["SimpleLocal","tmp_1_1"],null],["Ident",["SimpleLocal","remote1"],null],["Ident",["SimpleLocal","_balance"],null]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_1_1"],null],["Ident",["SimpleLocal","tmp_1_1"],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","tmp_2_1"],null],["Ident",["SimpleLocal","remote2"],null],["Ident",["SimpleLocal","_balance"],null]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_2_1"],null],["Ident",["SimpleLocal","tmp_2_1"],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","tmp_3_1"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","_balance"],null]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_1"],null],["Ident",["SimpleLocal","tmp_3_1"],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","tmp_3_3"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","transactionCount"],null]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_3"],null],["Ident",["SimpleLocal","tmp_3_3"],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","tmp_3_4"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","admin"],null]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_4"],null],["Ident",["SimpleLocal","tmp_3_4"],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","tmp_3_5"],null],["Ident",["SimpleLocal","tmp_3_4"],null],["Ident",["SimpleLocal","_balance"],null]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_5"],null],["Ident",["SimpleLocal","tmp_3_5"],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","tmp_3_6"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","owners"],null]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_6"],null],["Ident",["SimpleLocal","tmp_3_6"],null]],null],[["RemoteMapGet",["Ident",["SimpleLocal","tmp_3_7"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","owners"],null],[["Ident",["SimpleLocal","_sender"],null]],false],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_7"],null],["Ident",["SimpleLocal","tmp_3_7"],null]],null],[["RemoteMapGet",["Ident",["SimpleLocal","tmp_3_8"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","owners"],null],[["Ident",["SimpleLocal","_sender"],null]],true],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_8"],null],["Ident",["SimpleLocal","tmp_3_8"],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","tmp_3_9"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","signatures"],null]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_9"],null],["Ident",["SimpleLocal","tmp_3_9"],null]],null],[["Bind",["Ident",["SimpleLocal","x"],null],[["Literal","0"],null]],null],[["RemoteMapGet",["Ident",["SimpleLocal","tmp_3_10"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","signatures"],null],[["Ident",["SimpleLocal","x"],null]],false],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_10"],null],["Ident",["SimpleLocal","tmp_3_10"],null]],null],[["RemoteMapGet",["Ident",["SimpleLocal","tmp_3_11"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","signatures"],null],[["Ident",["SimpleLocal","x"],null]],true],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_11"],null],["Ident",["SimpleLocal","tmp_3_11"],null]],null],[["RemoteMapGet",["Ident",["SimpleLocal","tmp_3_12"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","signatures"],null],[["Ident",["SimpleLocal","x"],null],["Ident",["SimpleLocal","_origin"],null]],false],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_12"],null],["Ident",["SimpleLocal","tmp_3_12"],null]],null],[["RemoteMapGet",["Ident",["SimpleLocal","tmp_3_13"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","signatures"],null],[["Ident",["SimpleLocal","x"],null],["Ident",["SimpleLocal","_origin"],null]],true],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_13"],null],["Ident",["SimpleLocal","tmp_3_13"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","RemoteReadsADTTest"],null],"comp_params":[[["Ident",["SimpleLocal","list1"],null],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["Address","Address"]]]],[["Ident",["SimpleLocal","list2"],null],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["Address","Address"]]]],[["Ident",["SimpleLocal","list3"],null],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["Address","Address"]]]],[["Ident",["SimpleLocal","pair1"],null],["ADT",["Ident",["SimpleLocal","Pair"],{"fname":"","lnum":0,"cnum":0}],[["Address","Address"],["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]]]],[["Ident",["SimpleLocal","adt1"],null],["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","remote1"],null],["Address","Address"]]],"comp_body":[],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","OutgoingMsgTest"],null],"comp_params":[],"comp_body":[[["Bind",["Ident",["SimpleLocal","msg"],null],[["Message",[["_tag",["MLit",""]],["_recipient",["MVar",["Ident",["SimpleLocal","_sender"],null]]],["_amount",["MLit","0"]],["param",["MVar",["Ident",["SimpleLocal","cparam3"],null]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["Let",["Ident",["SimpleLocal","n"],null],null,[["Constr",["Ident",["SimpleLocal","Nil"],null],[["PrimType",["Msg_typ"]]],[]],null],[["Constr",["Ident",["SimpleLocal","Cons"],null],[["PrimType",["Msg_typ"]]],[["Ident",["SimpleLocal","msg"],null],["Ident",["SimpleLocal","n"],null]]],null]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null],[["Bind",["Ident",["SimpleLocal","e1"],null],[["Message",[["_eventname",["MLit","TestEvent"]],["info",["MVar",["Ident",["SimpleLocal","cparam2"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e1"],null]],null],[["Bind",["Ident",["SimpleLocal","e2"],null],[["Message",[["_eventname",["MLit","TestEvent"]],["info",["MVar",["Ident",["SimpleLocal","cparam3"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e2"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","ExceptionTest"],null],"comp_params":[],"comp_body":[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_exception",["MLit","TestException"]],["value",["MVar",["Ident",["SimpleLocal","cparam3"],null]]]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","AssignTest"],null],"comp_params":[],"comp_body":[[["Bind",["Ident",["SimpleLocal","x"],null],[["Constr",["Ident",["SimpleLocal","Address2"],null],[],[["Ident",["SimpleLocal","cparam3"],null]]],null]],null],[["Store",["Ident",["SimpleLocal","assign_test_8"],null],["Ident",["SimpleLocal","x"],null]],null],[["Bind",["Ident",["SimpleLocal","y"],null],[["Let",["Ident",["SimpleLocal","n"],null],null,[["Constr",["Ident",["SimpleLocal","Nil"],null],[["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]],[]],null],[["Constr",["Ident",["SimpleLocal","Cons"],null],[["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","x"],null],["Ident",["SimpleLocal","n"],null]]],null]],null]],null],[["Store",["Ident",["SimpleLocal","assign_test_9"],null],["Ident",["SimpleLocal","y"],null]],null],[["Bind",["Ident",["SimpleLocal","z"],null],[["Let",["Ident",["SimpleLocal","n"],null],null,[["Literal",{"mtype":[["PrimType",["Uint_typ",["Bits128"]]],["MapType",["PrimType",["Uint_typ",["Bits128"]]],["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]]],"data":[]}],null],[["Let",["Ident",["SimpleLocal","sub_n"],null],null,[["Literal",{"mtype":[["PrimType",["Uint_typ",["Bits128"]]],["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]],"data":[]}],null],[["Let",["Ident",["SimpleLocal","sub_k"],null],null,[["Literal","0"],null],[["Let",["Ident",["SimpleLocal","sub_res"],null],null,[["Builtin",[["Builtin_put"],null],[],[["Ident",["SimpleLocal","sub_n"],null],["Ident",["SimpleLocal","sub_k"],null],["Ident",["SimpleLocal","x"],null]]],null],[["Builtin",[["Builtin_put"],null],[],[["Ident",["SimpleLocal","n"],null],["Ident",["SimpleLocal","sub_k"],null],["Ident",["SimpleLocal","sub_res"],null]]],null]],null]],null]],null]],null]],null],[["Store",["Ident",["SimpleLocal","assign_test_10"],null],["Ident",["SimpleLocal","z"],null]],null],[["Bind",["Ident",["SimpleLocal","k1"],null],[["Literal","1"],null]],null],[["Bind",["Ident",["SimpleLocal","k2"],null],[["Literal","42"],null]],null],[["MapUpdate",["Ident",["SimpleLocal","assign_test_10"],null],[["Ident",["SimpleLocal","k1"],null],["Ident",["SimpleLocal","k2"],null]],["Ident",["SimpleLocal","x"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","SenderBalanceTest"],null],"comp_params":[],"comp_body":[[["RemoteLoad",["Ident",["SimpleLocal","pre"],null],["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","_balance"],null]],null],[["Store",["Ident",["SimpleLocal","sender_balance_pre"],null],["Ident",["SimpleLocal","pre"],null]],null],[["AcceptPayment"],null],[["RemoteLoad",["Ident",["SimpleLocal","mid"],null],["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","_balance"],null]],null],[["Store",["Ident",["SimpleLocal","sender_balance_mid"],null],["Ident",["SimpleLocal","mid"],null]],null],[["AcceptPayment"],null],[["RemoteLoad",["Ident",["SimpleLocal","post"],null],["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","_balance"],null]],null],[["Store",["Ident",["SimpleLocal","sender_balance_post"],null],["Ident",["SimpleLocal","post"],null]],null]],"comp_return":null}]}} + {"smver":0,"libs":{"lname":["Ident",["SimpleLocal","RRLib"],null],"lentries":[["LibTyp",["Ident",["SimpleLocal","AddressADT"],null],[{"cname":["Ident",["SimpleLocal","Address1"],null],"c_arg_types":[["Address","Address"]]},{"cname":["Ident",["SimpleLocal","Address2"],null],"c_arg_types":[["Address","Address"]]}]]]},"elibs":[],"contr":{"cname":["Ident",["SimpleLocal","RRContract"],null],"cparams":[[["Ident",["SimpleLocal","cparam1"],null],["Address","Address"]],[["Ident",["SimpleLocal","cparam2"],null],["Address","Address"]],[["Ident",["SimpleLocal","cparam3"],null],["Address","Address"]]],"cconstraint":[["Literal",{"name":["SimpleLocal","True"],"types":[],"lits":[]}],null],"cfields":[[["Ident",["SimpleLocal","assign_test_1"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","assign_test_2"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","assign_test_3"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","assign_test_4"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","assign_test_5"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","assign_test_6"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","assign_test_7"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","assign_test_8"],null],["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]],[["Constr",["Ident",["SimpleLocal","Address1"],null],[],[["Ident",["SimpleLocal","cparam1"],null]]],null]],[["Ident",["SimpleLocal","assign_test_9"],null],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]]],[["Constr",["Ident",["SimpleLocal","Nil"],null],[["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]],[]],null]],[["Ident",["SimpleLocal","assign_test_10"],null],["MapType",["PrimType",["Uint_typ",["Bits128"]]],["MapType",["PrimType",["Uint_typ",["Bits128"]]],["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]]],[["Literal",{"mtype":[["PrimType",["Uint_typ",["Bits128"]]],["MapType",["PrimType",["Uint_typ",["Bits128"]]],["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]]],"data":[]}],null]],[["Ident",["SimpleLocal","remote_reads_test_res_1_1"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","remote_reads_test_res_2_1"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_1"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_3"],null],["PrimType",["Uint_typ",["Bits32"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_4"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","cparam3"],null]],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_5"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_6"],null],["MapType",["Address","Address"],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Literal",{"mtype":[["Address","Address"],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]],"data":[]}],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_7"],null],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]],[["Constr",["Ident",["SimpleLocal","True"],null],[],[]],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_8"],null],["ADT",["Ident",["SimpleLocal","Option"],{"fname":"","lnum":0,"cnum":0}],[["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],[["Let",["Ident",["SimpleLocal","x"],null],null,[["Constr",["Ident",["SimpleLocal","True"],null],[],[]],null],[["Constr",["Ident",["SimpleLocal","Some"],null],[["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","x"],null]]],null]],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_9"],null],["MapType",["PrimType",["Uint_typ",["Bits32"]]],["MapType",["Address","Address"],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],[["Literal",{"mtype":[["PrimType",["Uint_typ",["Bits32"]]],["MapType",["Address","Address"],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],"data":[]}],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_10"],null],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]],[["Constr",["Ident",["SimpleLocal","False"],null],[],[]],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_11"],null],["ADT",["Ident",["SimpleLocal","Option"],{"fname":"","lnum":0,"cnum":0}],[["MapType",["Address","Address"],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]]],[["Constr",["Ident",["SimpleLocal","None"],null],[["MapType",["Address","Address"],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],[]],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_12"],null],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]],[["Constr",["Ident",["SimpleLocal","False"],null],[],[]],null]],[["Ident",["SimpleLocal","remote_reads_test_res_3_13"],null],["ADT",["Ident",["SimpleLocal","Option"],{"fname":"","lnum":0,"cnum":0}],[["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],[["Constr",["Ident",["SimpleLocal","None"],null],[["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]],[]],null]],[["Ident",["SimpleLocal","sender_balance_pre"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","sender_balance_mid"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]],[["Ident",["SimpleLocal","sender_balance_post"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Literal","0"],null]]],"ccomps":[{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","RemoteReadsTest"],null],"comp_params":[[["Ident",["SimpleLocal","remote1"],null],["Address","Address"]],[["Ident",["SimpleLocal","remote2"],null],["Address","Address"]],[["Ident",["SimpleLocal","remote3"],null],["Address","Address"]]],"comp_body":[[["RemoteLoad",["Ident",["SimpleLocal","tmp_1_1"],null],["Ident",["SimpleLocal","remote1"],null],["Ident",["SimpleLocal","_balance"],null],["Mutable"]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_1_1"],null],["Ident",["SimpleLocal","tmp_1_1"],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","tmp_2_1"],null],["Ident",["SimpleLocal","remote2"],null],["Ident",["SimpleLocal","_balance"],null],["Mutable"]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_2_1"],null],["Ident",["SimpleLocal","tmp_2_1"],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","tmp_3_1"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","_balance"],null],["Mutable"]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_1"],null],["Ident",["SimpleLocal","tmp_3_1"],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","tmp_3_3"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","transactionCount"],null],["Mutable"]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_3"],null],["Ident",["SimpleLocal","tmp_3_3"],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","tmp_3_4"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","admin"],null],["Mutable"]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_4"],null],["Ident",["SimpleLocal","tmp_3_4"],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","tmp_3_5"],null],["Ident",["SimpleLocal","tmp_3_4"],null],["Ident",["SimpleLocal","_balance"],null],["Mutable"]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_5"],null],["Ident",["SimpleLocal","tmp_3_5"],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","tmp_3_6"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","owners"],null],["Mutable"]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_6"],null],["Ident",["SimpleLocal","tmp_3_6"],null]],null],[["RemoteMapGet",["Ident",["SimpleLocal","tmp_3_7"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","owners"],null],["Mutable"],[["Ident",["SimpleLocal","_sender"],null]],false],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_7"],null],["Ident",["SimpleLocal","tmp_3_7"],null]],null],[["RemoteMapGet",["Ident",["SimpleLocal","tmp_3_8"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","owners"],null],["Mutable"],[["Ident",["SimpleLocal","_sender"],null]],true],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_8"],null],["Ident",["SimpleLocal","tmp_3_8"],null]],null],[["RemoteLoad",["Ident",["SimpleLocal","tmp_3_9"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","signatures"],null],["Mutable"]],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_9"],null],["Ident",["SimpleLocal","tmp_3_9"],null]],null],[["Bind",["Ident",["SimpleLocal","x"],null],[["Literal","0"],null]],null],[["RemoteMapGet",["Ident",["SimpleLocal","tmp_3_10"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","signatures"],null],["Mutable"],[["Ident",["SimpleLocal","x"],null]],false],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_10"],null],["Ident",["SimpleLocal","tmp_3_10"],null]],null],[["RemoteMapGet",["Ident",["SimpleLocal","tmp_3_11"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","signatures"],null],["Mutable"],[["Ident",["SimpleLocal","x"],null]],true],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_11"],null],["Ident",["SimpleLocal","tmp_3_11"],null]],null],[["RemoteMapGet",["Ident",["SimpleLocal","tmp_3_12"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","signatures"],null],["Mutable"],[["Ident",["SimpleLocal","x"],null],["Ident",["SimpleLocal","_origin"],null]],false],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_12"],null],["Ident",["SimpleLocal","tmp_3_12"],null]],null],[["RemoteMapGet",["Ident",["SimpleLocal","tmp_3_13"],null],["Ident",["SimpleLocal","remote3"],null],["Ident",["SimpleLocal","signatures"],null],["Mutable"],[["Ident",["SimpleLocal","x"],null],["Ident",["SimpleLocal","_origin"],null]],true],null],[["Store",["Ident",["SimpleLocal","remote_reads_test_res_3_13"],null],["Ident",["SimpleLocal","tmp_3_13"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","RemoteReadsADTTest"],null],"comp_params":[[["Ident",["SimpleLocal","list1"],null],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["Address","Address"]]]],[["Ident",["SimpleLocal","list2"],null],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["Address","Address"]]]],[["Ident",["SimpleLocal","list3"],null],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["Address","Address"]]]],[["Ident",["SimpleLocal","pair1"],null],["ADT",["Ident",["SimpleLocal","Pair"],{"fname":"","lnum":0,"cnum":0}],[["Address","Address"],["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]]]],[["Ident",["SimpleLocal","adt1"],null],["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","remote1"],null],["Address","Address"]]],"comp_body":[],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","OutgoingMsgTest"],null],"comp_params":[],"comp_body":[[["Bind",["Ident",["SimpleLocal","msg"],null],[["Message",[["_tag",["MLit",""]],["_recipient",["MVar",["Ident",["SimpleLocal","_sender"],null]]],["_amount",["MLit","0"]],["param",["MVar",["Ident",["SimpleLocal","cparam3"],null]]]]],null]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["Let",["Ident",["SimpleLocal","n"],null],null,[["Constr",["Ident",["SimpleLocal","Nil"],null],[["PrimType",["Msg_typ"]]],[]],null],[["Constr",["Ident",["SimpleLocal","Cons"],null],[["PrimType",["Msg_typ"]]],[["Ident",["SimpleLocal","msg"],null],["Ident",["SimpleLocal","n"],null]]],null]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null],[["Bind",["Ident",["SimpleLocal","e1"],null],[["Message",[["_eventname",["MLit","TestEvent"]],["info",["MVar",["Ident",["SimpleLocal","cparam2"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e1"],null]],null],[["Bind",["Ident",["SimpleLocal","e2"],null],[["Message",[["_eventname",["MLit","TestEvent"]],["info",["MVar",["Ident",["SimpleLocal","cparam3"],null]]]]],null]],null],[["CreateEvnt",["Ident",["SimpleLocal","e2"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","ExceptionTest"],null],"comp_params":[],"comp_body":[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_exception",["MLit","TestException"]],["value",["MVar",["Ident",["SimpleLocal","cparam3"],null]]]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","AssignTest"],null],"comp_params":[],"comp_body":[[["Bind",["Ident",["SimpleLocal","x"],null],[["Constr",["Ident",["SimpleLocal","Address2"],null],[],[["Ident",["SimpleLocal","cparam3"],null]]],null]],null],[["Store",["Ident",["SimpleLocal","assign_test_8"],null],["Ident",["SimpleLocal","x"],null]],null],[["Bind",["Ident",["SimpleLocal","y"],null],[["Let",["Ident",["SimpleLocal","n"],null],null,[["Constr",["Ident",["SimpleLocal","Nil"],null],[["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]],[]],null],[["Constr",["Ident",["SimpleLocal","Cons"],null],[["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","x"],null],["Ident",["SimpleLocal","n"],null]]],null]],null]],null],[["Store",["Ident",["SimpleLocal","assign_test_9"],null],["Ident",["SimpleLocal","y"],null]],null],[["Bind",["Ident",["SimpleLocal","z"],null],[["Let",["Ident",["SimpleLocal","n"],null],null,[["Literal",{"mtype":[["PrimType",["Uint_typ",["Bits128"]]],["MapType",["PrimType",["Uint_typ",["Bits128"]]],["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]]],"data":[]}],null],[["Let",["Ident",["SimpleLocal","sub_n"],null],null,[["Literal",{"mtype":[["PrimType",["Uint_typ",["Bits128"]]],["ADT",["Ident",["SimpleLocal","AddressADT"],{"fname":"","lnum":0,"cnum":0}],[]]],"data":[]}],null],[["Let",["Ident",["SimpleLocal","sub_k"],null],null,[["Literal","0"],null],[["Let",["Ident",["SimpleLocal","sub_res"],null],null,[["Builtin",[["Builtin_put"],null],[],[["Ident",["SimpleLocal","sub_n"],null],["Ident",["SimpleLocal","sub_k"],null],["Ident",["SimpleLocal","x"],null]]],null],[["Builtin",[["Builtin_put"],null],[],[["Ident",["SimpleLocal","n"],null],["Ident",["SimpleLocal","sub_k"],null],["Ident",["SimpleLocal","sub_res"],null]]],null]],null]],null]],null]],null]],null],[["Store",["Ident",["SimpleLocal","assign_test_10"],null],["Ident",["SimpleLocal","z"],null]],null],[["Bind",["Ident",["SimpleLocal","k1"],null],[["Literal","1"],null]],null],[["Bind",["Ident",["SimpleLocal","k2"],null],[["Literal","42"],null]],null],[["MapUpdate",["Ident",["SimpleLocal","assign_test_10"],null],[["Ident",["SimpleLocal","k1"],null],["Ident",["SimpleLocal","k2"],null]],["Ident",["SimpleLocal","x"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","SenderBalanceTest"],null],"comp_params":[],"comp_body":[[["RemoteLoad",["Ident",["SimpleLocal","pre"],null],["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","_balance"],null],["Mutable"]],null],[["Store",["Ident",["SimpleLocal","sender_balance_pre"],null],["Ident",["SimpleLocal","pre"],null]],null],[["AcceptPayment"],null],[["RemoteLoad",["Ident",["SimpleLocal","mid"],null],["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","_balance"],null],["Mutable"]],null],[["Store",["Ident",["SimpleLocal","sender_balance_mid"],null],["Ident",["SimpleLocal","mid"],null]],null],[["AcceptPayment"],null],[["RemoteLoad",["Ident",["SimpleLocal","post"],null],["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","_balance"],null],["Mutable"]],null],[["Store",["Ident",["SimpleLocal","sender_balance_post"],null],["Ident",["SimpleLocal","post"],null]],null]],"comp_return":null}]}} diff --git a/tests/formatter/to_json/simple-dex-remote-reads.t/run.t b/tests/formatter/to_json/simple-dex-remote-reads.t/run.t index 171ec5efe..e9e897a26 100644 --- a/tests/formatter/to_json/simple-dex-remote-reads.t/run.t +++ b/tests/formatter/to_json/simple-dex-remote-reads.t/run.t @@ -1,2 +1,2 @@ $ scilla-fmt --json --deannot simple-dex-remote-reads.scilla - {"smver":0,"libs":{"lname":["Ident",["SimpleLocal","SimpleExchangeLib"],null],"lentries":[["LibTyp",["Ident",["SimpleLocal","Order"],null],[{"cname":["Ident",["SimpleLocal","Order"],null],"c_arg_types":[["PrimType",["Bystrx_typ",20]],["Address","Address"],["PrimType",["Uint_typ",["Bits128"]]],["Address","Address"],["PrimType",["Uint_typ",["Bits128"]]]]}]],["LibVar",["Ident",["SimpleLocal","true"],null],null,[["Constr",["Ident",["SimpleLocal","True"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","false"],null],null,[["Constr",["Ident",["SimpleLocal","False"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","zero"],null],null,[["Literal","0"],null]],["LibVar",["Ident",["SimpleLocal","one"],null],null,[["Literal","1"],null]],["LibVar",["Ident",["SimpleLocal","one_msg"],null],["FunType",["PrimType",["Msg_typ"]],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["PrimType",["Msg_typ"]]]]],[["Fun",["Ident",["SimpleLocal","msg"],null],["PrimType",["Msg_typ"]],[["Let",["Ident",["SimpleLocal","mty"],null],null,[["Constr",["Ident",["SimpleLocal","Nil"],null],[["PrimType",["Msg_typ"]]],[]],null],[["Constr",["Ident",["SimpleLocal","Cons"],null],[["PrimType",["Msg_typ"]]],[["Ident",["SimpleLocal","msg"],null],["Ident",["SimpleLocal","mty"],null]]],null]],null]],null]],["LibVar",["Ident",["SimpleLocal","two_msgs"],null],["FunType",["PrimType",["Msg_typ"]],["FunType",["PrimType",["Msg_typ"]],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["PrimType",["Msg_typ"]]]]]],[["Fun",["Ident",["SimpleLocal","msg1"],null],["PrimType",["Msg_typ"]],[["Fun",["Ident",["SimpleLocal","msg2"],null],["PrimType",["Msg_typ"]],[["Let",["Ident",["SimpleLocal","first"],null],null,[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg1"],null]]],null],[["Constr",["Ident",["SimpleLocal","Cons"],null],[["PrimType",["Msg_typ"]]],[["Ident",["SimpleLocal","msg2"],null],["Ident",["SimpleLocal","first"],null]]],null]],null]],null]],null]],["LibVar",["Ident",["SimpleLocal","mk_transfer_msg"],null],["FunType",["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Uint_typ",["Bits128"]]],["PrimType",["Msg_typ"]]]]]]],[["Fun",["Ident",["SimpleLocal","transfer_from"],null],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]],[["Fun",["Ident",["SimpleLocal","token_address"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","from"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","to"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","amount"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Let",["Ident",["SimpleLocal","tag"],null],null,[["MatchExpr",["Ident",["SimpleLocal","transfer_from"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[["Literal","TransferFrom"],null]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[["Literal","Transfer"],null]]]],null],[["Message",[["_recipient",["MVar",["Ident",["SimpleLocal","token_address"],null]]],["_tag",["MVar",["Ident",["SimpleLocal","tag"],null]]],["_amount",["MLit","0"]],["from",["MVar",["Ident",["SimpleLocal","from"],null]]],["to",["MVar",["Ident",["SimpleLocal","to"],null]]],["amount",["MVar",["Ident",["SimpleLocal","amount"],null]]]]],null]],null]],null]],null]],null]],null]],null]],["LibVar",["Ident",["SimpleLocal","mk_place_order_msg"],null],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Uint_typ",["Bits128"]]],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["PrimType",["Msg_typ"]]]]]]]],[["Fun",["Ident",["SimpleLocal","token_address"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","from"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","to"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","amount"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Let",["Ident",["SimpleLocal","msg"],null],null,[["App",["Ident",["SimpleLocal","mk_transfer_msg"],null],[["Ident",["SimpleLocal","true"],null],["Ident",["SimpleLocal","token_address"],null],["Ident",["SimpleLocal","from"],null],["Ident",["SimpleLocal","to"],null],["Ident",["SimpleLocal","amount"],null]]],null],[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg"],null]]],null]],null]],null]],null]],null]],null]],["LibVar",["Ident",["SimpleLocal","mk_make_order_msgs"],null],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Uint_typ",["Bits128"]]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Uint_typ",["Bits128"]]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Bystrx_typ",20]],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["PrimType",["Msg_typ"]]]]]]]]]]],[["Fun",["Ident",["SimpleLocal","token_sell_address"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","sell_amount"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Fun",["Ident",["SimpleLocal","token_buy_address"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","buy_amount"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Fun",["Ident",["SimpleLocal","this_address"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","order_placer"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","order_maker"],null],["PrimType",["Bystrx_typ",20]],[["Let",["Ident",["SimpleLocal","sell_msg"],null],null,[["App",["Ident",["SimpleLocal","mk_transfer_msg"],null],[["Ident",["SimpleLocal","false"],null],["Ident",["SimpleLocal","token_sell_address"],null],["Ident",["SimpleLocal","this_address"],null],["Ident",["SimpleLocal","order_maker"],null],["Ident",["SimpleLocal","sell_amount"],null]]],null],[["Let",["Ident",["SimpleLocal","buy_msg"],null],null,[["App",["Ident",["SimpleLocal","mk_transfer_msg"],null],[["Ident",["SimpleLocal","true"],null],["Ident",["SimpleLocal","token_buy_address"],null],["Ident",["SimpleLocal","order_maker"],null],["Ident",["SimpleLocal","order_placer"],null],["Ident",["SimpleLocal","buy_amount"],null]]],null],[["App",["Ident",["SimpleLocal","two_msgs"],null],[["Ident",["SimpleLocal","sell_msg"],null],["Ident",["SimpleLocal","buy_msg"],null]]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]]]},"elibs":[[["Ident",["SimpleLocal","IntUtils"],null],null]],"contr":{"cname":["Ident",["SimpleLocal","SimpleExchange"],null],"cparams":[[["Ident",["SimpleLocal","initial_admin"],null],["Address","Address"]]],"cconstraint":[["Literal",{"name":["SimpleLocal","True"],"types":[],"lits":[]}],null],"cfields":[[["Ident",["SimpleLocal","admin"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","initial_admin"],null]],null]],[["Ident",["SimpleLocal","listed_tokens"],null],["MapType",["PrimType",["String_typ"]],["Address","Address"]],[["Literal",{"mtype":[["PrimType",["String_typ"]],["Address","Address"]],"data":[]}],null]],[["Ident",["SimpleLocal","active_orders"],null],["MapType",["PrimType",["Uint_typ",["Bits128"]]],["ADT",["Ident",["SimpleLocal","Order"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Literal",{"mtype":[["PrimType",["Uint_typ",["Bits128"]]],["ADT",["Ident",["SimpleLocal","Order"],{"fname":"","lnum":0,"cnum":0}],[]]],"data":[]}],null]],[["Ident",["SimpleLocal","next_order_no"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Var",["Ident",["SimpleLocal","zero"],null]],null]]],"ccomps":[{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","ThrowListingStatusException"],null],"comp_params":[[["Ident",["SimpleLocal","token_code"],null],["PrimType",["String_typ"]]],[["Ident",["SimpleLocal","expected_status"],null],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","actual_status"],null],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_exception",["MLit","UnexpectedListingStatus"]],["token_code",["MVar",["Ident",["SimpleLocal","token_code"],null]]],["expected",["MVar",["Ident",["SimpleLocal","expected_status"],null]]],["actual",["MVar",["Ident",["SimpleLocal","actual_status"],null]]]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","ThrowInsufficientAllowanceException"],null],"comp_params":[[["Ident",["SimpleLocal","token"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","expected"],null],["PrimType",["Uint_typ",["Bits128"]]]],[["Ident",["SimpleLocal","actual"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_exception",["MLit","InsufficientAllowance"]],["token",["MVar",["Ident",["SimpleLocal","token"],null]]],["expected",["MVar",["Ident",["SimpleLocal","expected"],null]]],["actual",["MVar",["Ident",["SimpleLocal","actual"],null]]]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","CheckSenderIsAdmin"],null],"comp_params":[],"comp_body":[[["Load",["Ident",["SimpleLocal","current_admin"],null],["Ident",["SimpleLocal","admin"],null]],null],[["Bind",["Ident",["SimpleLocal","is_admin"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","current_admin"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_admin"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_exception",["MLit","SenderIsNotAdmin"]]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","SetAdmin"],null],"comp_params":[[["Ident",["SimpleLocal","new_admin"],null],["Address","Address"]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","CheckSenderIsAdmin"],null],[]],null],[["Store",["Ident",["SimpleLocal","admin"],null],["Ident",["SimpleLocal","new_admin"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","CheckIsTokenUnlisted"],null],"comp_params":[[["Ident",["SimpleLocal","token_code"],null],["PrimType",["String_typ"]]]],"comp_body":[[["MapGet",["Ident",["SimpleLocal","token_code_is_listed"],null],["Ident",["SimpleLocal","listed_tokens"],null],[["Ident",["SimpleLocal","token_code"],null]],false],null],[["MatchStmt",["Ident",["SimpleLocal","token_code_is_listed"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[[["CallProc",null,["Ident",["SimpleLocal","ThrowListingStatusException"],null],[["Ident",["SimpleLocal","token_code"],null],["Ident",["SimpleLocal","false"],null],["Ident",["SimpleLocal","token_code_is_listed"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","ListToken"],null],"comp_params":[[["Ident",["SimpleLocal","token_code"],null],["PrimType",["String_typ"]]],[["Ident",["SimpleLocal","new_token"],null],["Address","Address"]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","CheckSenderIsAdmin"],null],[]],null],[["CallProc",null,["Ident",["SimpleLocal","CheckIsTokenUnlisted"],null],[["Ident",["SimpleLocal","token_code"],null]]],null],[["MapUpdate",["Ident",["SimpleLocal","listed_tokens"],null],[["Ident",["SimpleLocal","token_code"],null]],["Ident",["SimpleLocal","new_token"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","CheckAllowance"],null],"comp_params":[[["Ident",["SimpleLocal","token"],null],["Address","Address"]],[["Ident",["SimpleLocal","expected"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["RemoteMapGet",["Ident",["SimpleLocal","actual_opt"],null],["Ident",["SimpleLocal","token"],null],["Ident",["SimpleLocal","allowances"],null],[["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","_this_address"],null]],true],null],[["Bind",["Ident",["SimpleLocal","actual"],null],[["MatchExpr",["Ident",["SimpleLocal","actual_opt"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","x"],null]]]],[["Var",["Ident",["SimpleLocal","x"],null]],null]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[["Var",["Ident",["SimpleLocal","zero"],null]],null]]]],null]],null],[["Bind",["Ident",["SimpleLocal","is_sufficient"],null],[["App",["Ident",["SimpleLocal","uint128_le"],null],[["Ident",["SimpleLocal","expected"],null],["Ident",["SimpleLocal","actual"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_sufficient"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["CallProc",null,["Ident",["SimpleLocal","ThrowInsufficientAllowanceException"],null],[["Ident",["SimpleLocal","token"],null],["Ident",["SimpleLocal","expected"],null],["Ident",["SimpleLocal","actual"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","AddOrder"],null],"comp_params":[[["Ident",["SimpleLocal","order"],null],["ADT",["Ident",["SimpleLocal","Order"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["Load",["Ident",["SimpleLocal","order_no"],null],["Ident",["SimpleLocal","next_order_no"],null]],null],[["MapUpdate",["Ident",["SimpleLocal","active_orders"],null],[["Ident",["SimpleLocal","order_no"],null]],["Ident",["SimpleLocal","order"],null]],null],[["Bind",["Ident",["SimpleLocal","new_order_no"],null],[["Builtin",[["Builtin_add"],null],[],[["Ident",["SimpleLocal","order_no"],null],["Ident",["SimpleLocal","one"],null]]],null]],null],[["Store",["Ident",["SimpleLocal","next_order_no"],null],["Ident",["SimpleLocal","new_order_no"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","PlaceOrder"],null],"comp_params":[[["Ident",["SimpleLocal","token_code_sell"],null],["PrimType",["String_typ"]]],[["Ident",["SimpleLocal","sell_amount"],null],["PrimType",["Uint_typ",["Bits128"]]]],[["Ident",["SimpleLocal","token_code_buy"],null],["PrimType",["String_typ"]]],[["Ident",["SimpleLocal","buy_amount"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["MapGet",["Ident",["SimpleLocal","token_sell_opt"],null],["Ident",["SimpleLocal","listed_tokens"],null],[["Ident",["SimpleLocal","token_code_sell"],null]],true],null],[["MapGet",["Ident",["SimpleLocal","token_buy_opt"],null],["Ident",["SimpleLocal","listed_tokens"],null],[["Ident",["SimpleLocal","token_code_buy"],null]],true],null],[["MatchStmt",["Ident",["SimpleLocal","token_sell_opt"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","token_sell"],null]]]],[[["MatchStmt",["Ident",["SimpleLocal","token_buy_opt"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","token_buy"],null]]]],[[["CallProc",null,["Ident",["SimpleLocal","CheckAllowance"],null],[["Ident",["SimpleLocal","token_sell"],null],["Ident",["SimpleLocal","sell_amount"],null]]],null],[["Bind",["Ident",["SimpleLocal","msg"],null],[["App",["Ident",["SimpleLocal","mk_place_order_msg"],null],[["Ident",["SimpleLocal","token_sell"],null],["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","_this_address"],null],["Ident",["SimpleLocal","sell_amount"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msg"],null]],null],[["Bind",["Ident",["SimpleLocal","order"],null],[["Constr",["Ident",["SimpleLocal","Order"],null],[],[["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","token_sell"],null],["Ident",["SimpleLocal","sell_amount"],null],["Ident",["SimpleLocal","token_buy"],null],["Ident",["SimpleLocal","buy_amount"],null]]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","AddOrder"],null],[["Ident",["SimpleLocal","order"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["CallProc",null,["Ident",["SimpleLocal","ThrowListingStatusException"],null],[["Ident",["SimpleLocal","token_code_buy"],null],["Ident",["SimpleLocal","true"],null],["Ident",["SimpleLocal","false"],null]]],null]]]]],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["CallProc",null,["Ident",["SimpleLocal","ThrowListingStatusException"],null],[["Ident",["SimpleLocal","token_code_sell"],null],["Ident",["SimpleLocal","true"],null],["Ident",["SimpleLocal","false"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","MatchOrder"],null],"comp_params":[[["Ident",["SimpleLocal","order_id"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["MapGet",["Ident",["SimpleLocal","order"],null],["Ident",["SimpleLocal","active_orders"],null],[["Ident",["SimpleLocal","order_id"],null]],true],null],[["MatchStmt",["Ident",["SimpleLocal","order"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Constructor",["Ident",["SimpleLocal","Order"],null],[["Binder",["Ident",["SimpleLocal","order_placer"],null]],["Binder",["Ident",["SimpleLocal","sell_token"],null]],["Binder",["Ident",["SimpleLocal","sell_amount"],null]],["Binder",["Ident",["SimpleLocal","buy_token"],null]],["Binder",["Ident",["SimpleLocal","buy_amount"],null]]]]]],[[["CallProc",null,["Ident",["SimpleLocal","CheckAllowance"],null],[["Ident",["SimpleLocal","buy_token"],null],["Ident",["SimpleLocal","buy_amount"],null]]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["App",["Ident",["SimpleLocal","mk_make_order_msgs"],null],[["Ident",["SimpleLocal","sell_token"],null],["Ident",["SimpleLocal","sell_amount"],null],["Ident",["SimpleLocal","buy_token"],null],["Ident",["SimpleLocal","buy_amount"],null],["Ident",["SimpleLocal","_this_address"],null],["Ident",["SimpleLocal","order_placer"],null],["Ident",["SimpleLocal","_sender"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null],[["MapUpdate",["Ident",["SimpleLocal","active_orders"],null],[["Ident",["SimpleLocal","order_id"],null]],null],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_exception",["MLit","UnknownOrder"]],["order_id",["MVar",["Ident",["SimpleLocal","order_id"],null]]]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","CheckInitiator"],null],"comp_params":[[["Ident",["SimpleLocal","initiator"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","initiator_is_this"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","initiator"],null],["Ident",["SimpleLocal","_this_address"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","initiator_is_this"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_exception",["MLit","UnexpecedTransfer"]],["token_address",["MVar",["Ident",["SimpleLocal","_sender"],null]]],["initiator",["MVar",["Ident",["SimpleLocal","initiator"],null]]]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","RecipientAcceptTransferFrom"],null],"comp_params":[[["Ident",["SimpleLocal","initiator"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","sender"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","recipient"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","amount"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","CheckInitiator"],null],[["Ident",["SimpleLocal","initiator"],null]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","TransferFromSuccessCallBack"],null],"comp_params":[[["Ident",["SimpleLocal","initiator"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","sender"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","recipient"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","amount"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","CheckInitiator"],null],[["Ident",["SimpleLocal","initiator"],null]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","TransferSuccessCallBack"],null],"comp_params":[[["Ident",["SimpleLocal","initiator"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","sender"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","recipient"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","amount"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","CheckInitiator"],null],[["Ident",["SimpleLocal","initiator"],null]]],null]],"comp_return":null}]}} + {"smver":0,"libs":{"lname":["Ident",["SimpleLocal","SimpleExchangeLib"],null],"lentries":[["LibTyp",["Ident",["SimpleLocal","Order"],null],[{"cname":["Ident",["SimpleLocal","Order"],null],"c_arg_types":[["PrimType",["Bystrx_typ",20]],["Address","Address"],["PrimType",["Uint_typ",["Bits128"]]],["Address","Address"],["PrimType",["Uint_typ",["Bits128"]]]]}]],["LibVar",["Ident",["SimpleLocal","true"],null],null,[["Constr",["Ident",["SimpleLocal","True"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","false"],null],null,[["Constr",["Ident",["SimpleLocal","False"],null],[],[]],null]],["LibVar",["Ident",["SimpleLocal","zero"],null],null,[["Literal","0"],null]],["LibVar",["Ident",["SimpleLocal","one"],null],null,[["Literal","1"],null]],["LibVar",["Ident",["SimpleLocal","one_msg"],null],["FunType",["PrimType",["Msg_typ"]],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["PrimType",["Msg_typ"]]]]],[["Fun",["Ident",["SimpleLocal","msg"],null],["PrimType",["Msg_typ"]],[["Let",["Ident",["SimpleLocal","mty"],null],null,[["Constr",["Ident",["SimpleLocal","Nil"],null],[["PrimType",["Msg_typ"]]],[]],null],[["Constr",["Ident",["SimpleLocal","Cons"],null],[["PrimType",["Msg_typ"]]],[["Ident",["SimpleLocal","msg"],null],["Ident",["SimpleLocal","mty"],null]]],null]],null]],null]],["LibVar",["Ident",["SimpleLocal","two_msgs"],null],["FunType",["PrimType",["Msg_typ"]],["FunType",["PrimType",["Msg_typ"]],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["PrimType",["Msg_typ"]]]]]],[["Fun",["Ident",["SimpleLocal","msg1"],null],["PrimType",["Msg_typ"]],[["Fun",["Ident",["SimpleLocal","msg2"],null],["PrimType",["Msg_typ"]],[["Let",["Ident",["SimpleLocal","first"],null],null,[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg1"],null]]],null],[["Constr",["Ident",["SimpleLocal","Cons"],null],[["PrimType",["Msg_typ"]]],[["Ident",["SimpleLocal","msg2"],null],["Ident",["SimpleLocal","first"],null]]],null]],null]],null]],null]],["LibVar",["Ident",["SimpleLocal","mk_transfer_msg"],null],["FunType",["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Uint_typ",["Bits128"]]],["PrimType",["Msg_typ"]]]]]]],[["Fun",["Ident",["SimpleLocal","transfer_from"],null],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]],[["Fun",["Ident",["SimpleLocal","token_address"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","from"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","to"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","amount"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Let",["Ident",["SimpleLocal","tag"],null],null,[["MatchExpr",["Ident",["SimpleLocal","transfer_from"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[["Literal","TransferFrom"],null]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[["Literal","Transfer"],null]]]],null],[["Message",[["_recipient",["MVar",["Ident",["SimpleLocal","token_address"],null]]],["_tag",["MVar",["Ident",["SimpleLocal","tag"],null]]],["_amount",["MLit","0"]],["from",["MVar",["Ident",["SimpleLocal","from"],null]]],["to",["MVar",["Ident",["SimpleLocal","to"],null]]],["amount",["MVar",["Ident",["SimpleLocal","amount"],null]]]]],null]],null]],null]],null]],null]],null]],null]],["LibVar",["Ident",["SimpleLocal","mk_place_order_msg"],null],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Uint_typ",["Bits128"]]],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["PrimType",["Msg_typ"]]]]]]]],[["Fun",["Ident",["SimpleLocal","token_address"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","from"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","to"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","amount"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Let",["Ident",["SimpleLocal","msg"],null],null,[["App",["Ident",["SimpleLocal","mk_transfer_msg"],null],[["Ident",["SimpleLocal","true"],null],["Ident",["SimpleLocal","token_address"],null],["Ident",["SimpleLocal","from"],null],["Ident",["SimpleLocal","to"],null],["Ident",["SimpleLocal","amount"],null]]],null],[["App",["Ident",["SimpleLocal","one_msg"],null],[["Ident",["SimpleLocal","msg"],null]]],null]],null]],null]],null]],null]],null]],["LibVar",["Ident",["SimpleLocal","mk_make_order_msgs"],null],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Uint_typ",["Bits128"]]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Uint_typ",["Bits128"]]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Bystrx_typ",20]],["FunType",["PrimType",["Bystrx_typ",20]],["ADT",["Ident",["SimpleLocal","List"],{"fname":"","lnum":0,"cnum":0}],[["PrimType",["Msg_typ"]]]]]]]]]]],[["Fun",["Ident",["SimpleLocal","token_sell_address"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","sell_amount"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Fun",["Ident",["SimpleLocal","token_buy_address"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","buy_amount"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Fun",["Ident",["SimpleLocal","this_address"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","order_placer"],null],["PrimType",["Bystrx_typ",20]],[["Fun",["Ident",["SimpleLocal","order_maker"],null],["PrimType",["Bystrx_typ",20]],[["Let",["Ident",["SimpleLocal","sell_msg"],null],null,[["App",["Ident",["SimpleLocal","mk_transfer_msg"],null],[["Ident",["SimpleLocal","false"],null],["Ident",["SimpleLocal","token_sell_address"],null],["Ident",["SimpleLocal","this_address"],null],["Ident",["SimpleLocal","order_maker"],null],["Ident",["SimpleLocal","sell_amount"],null]]],null],[["Let",["Ident",["SimpleLocal","buy_msg"],null],null,[["App",["Ident",["SimpleLocal","mk_transfer_msg"],null],[["Ident",["SimpleLocal","true"],null],["Ident",["SimpleLocal","token_buy_address"],null],["Ident",["SimpleLocal","order_maker"],null],["Ident",["SimpleLocal","order_placer"],null],["Ident",["SimpleLocal","buy_amount"],null]]],null],[["App",["Ident",["SimpleLocal","two_msgs"],null],[["Ident",["SimpleLocal","sell_msg"],null],["Ident",["SimpleLocal","buy_msg"],null]]],null]],null]],null]],null]],null]],null]],null]],null]],null]],null]]]},"elibs":[[["Ident",["SimpleLocal","IntUtils"],null],null]],"contr":{"cname":["Ident",["SimpleLocal","SimpleExchange"],null],"cparams":[[["Ident",["SimpleLocal","initial_admin"],null],["Address","Address"]]],"cconstraint":[["Literal",{"name":["SimpleLocal","True"],"types":[],"lits":[]}],null],"cfields":[[["Ident",["SimpleLocal","admin"],null],["Address","Address"],[["Var",["Ident",["SimpleLocal","initial_admin"],null]],null]],[["Ident",["SimpleLocal","listed_tokens"],null],["MapType",["PrimType",["String_typ"]],["Address","Address"]],[["Literal",{"mtype":[["PrimType",["String_typ"]],["Address","Address"]],"data":[]}],null]],[["Ident",["SimpleLocal","active_orders"],null],["MapType",["PrimType",["Uint_typ",["Bits128"]]],["ADT",["Ident",["SimpleLocal","Order"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Literal",{"mtype":[["PrimType",["Uint_typ",["Bits128"]]],["ADT",["Ident",["SimpleLocal","Order"],{"fname":"","lnum":0,"cnum":0}],[]]],"data":[]}],null]],[["Ident",["SimpleLocal","next_order_no"],null],["PrimType",["Uint_typ",["Bits128"]]],[["Var",["Ident",["SimpleLocal","zero"],null]],null]]],"ccomps":[{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","ThrowListingStatusException"],null],"comp_params":[[["Ident",["SimpleLocal","token_code"],null],["PrimType",["String_typ"]]],[["Ident",["SimpleLocal","expected_status"],null],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]],[["Ident",["SimpleLocal","actual_status"],null],["ADT",["Ident",["SimpleLocal","Bool"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_exception",["MLit","UnexpectedListingStatus"]],["token_code",["MVar",["Ident",["SimpleLocal","token_code"],null]]],["expected",["MVar",["Ident",["SimpleLocal","expected_status"],null]]],["actual",["MVar",["Ident",["SimpleLocal","actual_status"],null]]]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","ThrowInsufficientAllowanceException"],null],"comp_params":[[["Ident",["SimpleLocal","token"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","expected"],null],["PrimType",["Uint_typ",["Bits128"]]]],[["Ident",["SimpleLocal","actual"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_exception",["MLit","InsufficientAllowance"]],["token",["MVar",["Ident",["SimpleLocal","token"],null]]],["expected",["MVar",["Ident",["SimpleLocal","expected"],null]]],["actual",["MVar",["Ident",["SimpleLocal","actual"],null]]]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","CheckSenderIsAdmin"],null],"comp_params":[],"comp_body":[[["Load",["Ident",["SimpleLocal","current_admin"],null],["Ident",["SimpleLocal","admin"],null]],null],[["Bind",["Ident",["SimpleLocal","is_admin"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","current_admin"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_admin"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_exception",["MLit","SenderIsNotAdmin"]]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","SetAdmin"],null],"comp_params":[[["Ident",["SimpleLocal","new_admin"],null],["Address","Address"]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","CheckSenderIsAdmin"],null],[]],null],[["Store",["Ident",["SimpleLocal","admin"],null],["Ident",["SimpleLocal","new_admin"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","CheckIsTokenUnlisted"],null],"comp_params":[[["Ident",["SimpleLocal","token_code"],null],["PrimType",["String_typ"]]]],"comp_body":[[["MapGet",["Ident",["SimpleLocal","token_code_is_listed"],null],["Ident",["SimpleLocal","listed_tokens"],null],[["Ident",["SimpleLocal","token_code"],null]],false],null],[["MatchStmt",["Ident",["SimpleLocal","token_code_is_listed"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[[["CallProc",null,["Ident",["SimpleLocal","ThrowListingStatusException"],null],[["Ident",["SimpleLocal","token_code"],null],["Ident",["SimpleLocal","false"],null],["Ident",["SimpleLocal","token_code_is_listed"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","ListToken"],null],"comp_params":[[["Ident",["SimpleLocal","token_code"],null],["PrimType",["String_typ"]]],[["Ident",["SimpleLocal","new_token"],null],["Address","Address"]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","CheckSenderIsAdmin"],null],[]],null],[["CallProc",null,["Ident",["SimpleLocal","CheckIsTokenUnlisted"],null],[["Ident",["SimpleLocal","token_code"],null]]],null],[["MapUpdate",["Ident",["SimpleLocal","listed_tokens"],null],[["Ident",["SimpleLocal","token_code"],null]],["Ident",["SimpleLocal","new_token"],null]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","CheckAllowance"],null],"comp_params":[[["Ident",["SimpleLocal","token"],null],["Address","Address"]],[["Ident",["SimpleLocal","expected"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["RemoteMapGet",["Ident",["SimpleLocal","actual_opt"],null],["Ident",["SimpleLocal","token"],null],["Ident",["SimpleLocal","allowances"],null],["Mutable"],[["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","_this_address"],null]],true],null],[["Bind",["Ident",["SimpleLocal","actual"],null],[["MatchExpr",["Ident",["SimpleLocal","actual_opt"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","x"],null]]]],[["Var",["Ident",["SimpleLocal","x"],null]],null]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[["Var",["Ident",["SimpleLocal","zero"],null]],null]]]],null]],null],[["Bind",["Ident",["SimpleLocal","is_sufficient"],null],[["App",["Ident",["SimpleLocal","uint128_le"],null],[["Ident",["SimpleLocal","expected"],null],["Ident",["SimpleLocal","actual"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","is_sufficient"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["CallProc",null,["Ident",["SimpleLocal","ThrowInsufficientAllowanceException"],null],[["Ident",["SimpleLocal","token"],null],["Ident",["SimpleLocal","expected"],null],["Ident",["SimpleLocal","actual"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","AddOrder"],null],"comp_params":[[["Ident",["SimpleLocal","order"],null],["ADT",["Ident",["SimpleLocal","Order"],{"fname":"","lnum":0,"cnum":0}],[]]]],"comp_body":[[["Load",["Ident",["SimpleLocal","order_no"],null],["Ident",["SimpleLocal","next_order_no"],null]],null],[["MapUpdate",["Ident",["SimpleLocal","active_orders"],null],[["Ident",["SimpleLocal","order_no"],null]],["Ident",["SimpleLocal","order"],null]],null],[["Bind",["Ident",["SimpleLocal","new_order_no"],null],[["Builtin",[["Builtin_add"],null],[],[["Ident",["SimpleLocal","order_no"],null],["Ident",["SimpleLocal","one"],null]]],null]],null],[["Store",["Ident",["SimpleLocal","next_order_no"],null],["Ident",["SimpleLocal","new_order_no"],null]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","PlaceOrder"],null],"comp_params":[[["Ident",["SimpleLocal","token_code_sell"],null],["PrimType",["String_typ"]]],[["Ident",["SimpleLocal","sell_amount"],null],["PrimType",["Uint_typ",["Bits128"]]]],[["Ident",["SimpleLocal","token_code_buy"],null],["PrimType",["String_typ"]]],[["Ident",["SimpleLocal","buy_amount"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["MapGet",["Ident",["SimpleLocal","token_sell_opt"],null],["Ident",["SimpleLocal","listed_tokens"],null],[["Ident",["SimpleLocal","token_code_sell"],null]],true],null],[["MapGet",["Ident",["SimpleLocal","token_buy_opt"],null],["Ident",["SimpleLocal","listed_tokens"],null],[["Ident",["SimpleLocal","token_code_buy"],null]],true],null],[["MatchStmt",["Ident",["SimpleLocal","token_sell_opt"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","token_sell"],null]]]],[[["MatchStmt",["Ident",["SimpleLocal","token_buy_opt"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Binder",["Ident",["SimpleLocal","token_buy"],null]]]],[[["CallProc",null,["Ident",["SimpleLocal","CheckAllowance"],null],[["Ident",["SimpleLocal","token_sell"],null],["Ident",["SimpleLocal","sell_amount"],null]]],null],[["Bind",["Ident",["SimpleLocal","msg"],null],[["App",["Ident",["SimpleLocal","mk_place_order_msg"],null],[["Ident",["SimpleLocal","token_sell"],null],["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","_this_address"],null],["Ident",["SimpleLocal","sell_amount"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msg"],null]],null],[["Bind",["Ident",["SimpleLocal","order"],null],[["Constr",["Ident",["SimpleLocal","Order"],null],[],[["Ident",["SimpleLocal","_sender"],null],["Ident",["SimpleLocal","token_sell"],null],["Ident",["SimpleLocal","sell_amount"],null],["Ident",["SimpleLocal","token_buy"],null],["Ident",["SimpleLocal","buy_amount"],null]]],null]],null],[["CallProc",null,["Ident",["SimpleLocal","AddOrder"],null],[["Ident",["SimpleLocal","order"],null]]],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["CallProc",null,["Ident",["SimpleLocal","ThrowListingStatusException"],null],[["Ident",["SimpleLocal","token_code_buy"],null],["Ident",["SimpleLocal","true"],null],["Ident",["SimpleLocal","false"],null]]],null]]]]],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["CallProc",null,["Ident",["SimpleLocal","ThrowListingStatusException"],null],[["Ident",["SimpleLocal","token_code_sell"],null],["Ident",["SimpleLocal","true"],null],["Ident",["SimpleLocal","false"],null]]],null]]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","MatchOrder"],null],"comp_params":[[["Ident",["SimpleLocal","order_id"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["MapGet",["Ident",["SimpleLocal","order"],null],["Ident",["SimpleLocal","active_orders"],null],[["Ident",["SimpleLocal","order_id"],null]],true],null],[["MatchStmt",["Ident",["SimpleLocal","order"],null],[[["Constructor",["Ident",["SimpleLocal","Some"],null],[["Constructor",["Ident",["SimpleLocal","Order"],null],[["Binder",["Ident",["SimpleLocal","order_placer"],null]],["Binder",["Ident",["SimpleLocal","sell_token"],null]],["Binder",["Ident",["SimpleLocal","sell_amount"],null]],["Binder",["Ident",["SimpleLocal","buy_token"],null]],["Binder",["Ident",["SimpleLocal","buy_amount"],null]]]]]],[[["CallProc",null,["Ident",["SimpleLocal","CheckAllowance"],null],[["Ident",["SimpleLocal","buy_token"],null],["Ident",["SimpleLocal","buy_amount"],null]]],null],[["Bind",["Ident",["SimpleLocal","msgs"],null],[["App",["Ident",["SimpleLocal","mk_make_order_msgs"],null],[["Ident",["SimpleLocal","sell_token"],null],["Ident",["SimpleLocal","sell_amount"],null],["Ident",["SimpleLocal","buy_token"],null],["Ident",["SimpleLocal","buy_amount"],null],["Ident",["SimpleLocal","_this_address"],null],["Ident",["SimpleLocal","order_placer"],null],["Ident",["SimpleLocal","_sender"],null]]],null]],null],[["SendMsgs",["Ident",["SimpleLocal","msgs"],null]],null],[["MapUpdate",["Ident",["SimpleLocal","active_orders"],null],[["Ident",["SimpleLocal","order_id"],null]],null],null]]],[["Constructor",["Ident",["SimpleLocal","None"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_exception",["MLit","UnknownOrder"]],["order_id",["MVar",["Ident",["SimpleLocal","order_id"],null]]]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompProc"],"comp_name":["Ident",["SimpleLocal","CheckInitiator"],null],"comp_params":[[["Ident",["SimpleLocal","initiator"],null],["PrimType",["Bystrx_typ",20]]]],"comp_body":[[["Bind",["Ident",["SimpleLocal","initiator_is_this"],null],[["Builtin",[["Builtin_eq"],null],[],[["Ident",["SimpleLocal","initiator"],null],["Ident",["SimpleLocal","_this_address"],null]]],null]],null],[["MatchStmt",["Ident",["SimpleLocal","initiator_is_this"],null],[[["Constructor",["Ident",["SimpleLocal","True"],null],[]],[]],[["Constructor",["Ident",["SimpleLocal","False"],null],[]],[[["Bind",["Ident",["SimpleLocal","e"],null],[["Message",[["_exception",["MLit","UnexpecedTransfer"]],["token_address",["MVar",["Ident",["SimpleLocal","_sender"],null]]],["initiator",["MVar",["Ident",["SimpleLocal","initiator"],null]]]]],null]],null],[["Throw",["Ident",["SimpleLocal","e"],null]],null]]]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","RecipientAcceptTransferFrom"],null],"comp_params":[[["Ident",["SimpleLocal","initiator"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","sender"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","recipient"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","amount"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","CheckInitiator"],null],[["Ident",["SimpleLocal","initiator"],null]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","TransferFromSuccessCallBack"],null],"comp_params":[[["Ident",["SimpleLocal","initiator"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","sender"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","recipient"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","amount"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","CheckInitiator"],null],[["Ident",["SimpleLocal","initiator"],null]]],null]],"comp_return":null},{"comp_type":["CompTrans"],"comp_name":["Ident",["SimpleLocal","TransferSuccessCallBack"],null],"comp_params":[[["Ident",["SimpleLocal","initiator"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","sender"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","recipient"],null],["PrimType",["Bystrx_typ",20]]],[["Ident",["SimpleLocal","amount"],null],["PrimType",["Uint_typ",["Bits128"]]]]],"comp_body":[[["CallProc",null,["Ident",["SimpleLocal","CheckInitiator"],null],[["Ident",["SimpleLocal","initiator"],null]]],null]],"comp_return":null}]}}