; This file is auto-generated. Do not edit manually: changes may be erased. ; Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. ; If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues ; Aqua version: 0.10.3 (xor (seq (seq (seq (call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-) (call %init_peer_id% ("getDataSrv" "spell_id") [] spell_id) ) (call %init_peer_id% ("getDataSrv" "api_endpoint") [] api_endpoint) ) (new $deals_update (seq (seq (new $block (new $is_ok-0 (seq (seq (seq (seq (call %init_peer_id% ("fluence_aurora_connector" "latest_block_number") [api_endpoint] result) (xor (match result.$.success! false (ap false $is_ok-0) ) (seq (ap result.$.result! $block) (ap true $is_ok-0) ) ) ) (canon %init_peer_id% $block #-block-fix-0) ) (ap #-block-fix-0 -block-flat-0) ) (new $is_ok-0_test (seq (seq (seq (call %init_peer_id% ("math" "add") [0 1] is_ok-0_incr) (fold $is_ok-0 is_ok-0_fold_var (seq (seq (ap is_ok-0_fold_var $is_ok-0_test) (canon %init_peer_id% $is_ok-0_test #is_ok-0_iter_canon) ) (xor (match #is_ok-0_iter_canon.length is_ok-0_incr (null) ) (next is_ok-0_fold_var) ) ) (never) ) ) (canon %init_peer_id% $is_ok-0_test #is_ok-0_result_canon) ) (ap #is_ok-0_result_canon is_ok-0_gate) ) ) ) ) ) (call %init_peer_id% (spell_id "list_get_strings") ["joined_deals"] list) ) (xor (match list.$.success! false (xor (seq (seq (seq (seq (new $array-inline (seq (seq (ap "can't restrive joined deals" $array-inline) (ap list.$.error! $array-inline) ) (canon %init_peer_id% $array-inline #array-inline-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title) ) (call %init_peer_id% ("run-console" "print") [title #array-inline-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-0] msg_str) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str]) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) ) ) (seq (seq (seq (fold list.$.strings! joined_deal_str-0 (seq (seq (seq (call %init_peer_id% ("json" "parse") [joined_deal_str-0] joined_deal) (new $status (new $result-0 (seq (seq (seq (seq (call %init_peer_id% (spell_id "get_string") [joined_deal.$.deal_id!] value) (xor (match value.$.success! false (ap false $status) ) (xor (match value.$.absent! true (ap false $status) ) (seq (ap value.$.str! $result-0) (ap true $status) ) ) ) ) (canon %init_peer_id% $result-0 #-result-fix-0) ) (ap #-result-fix-0 -result-flat-0) ) (new $status_test (seq (seq (seq (call %init_peer_id% ("math" "add") [0 1] status_incr) (fold $status status_fold_var (seq (seq (ap status_fold_var $status_test) (canon %init_peer_id% $status_test #status_iter_canon) ) (xor (match #status_iter_canon.length status_incr (null) ) (next status_fold_var) ) ) (never) ) ) (canon %init_peer_id% $status_test #status_result_canon) ) (ap #status_result_canon status_gate) ) ) ) ) ) ) (xor (match status_gate.$.[0]! false (xor (seq (seq (seq (seq (new $array-inline-1 (seq (seq (seq (ap "can't find state of the deal" $array-inline-1) (ap joined_deal.$.deal_id! $array-inline-1) ) (ap "; broken invariant, check poll_new_deals" $array-inline-1) ) (canon %init_peer_id% $array-inline-1 #array-inline-1-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-0) ) (call %init_peer_id% ("run-console" "print") [title-0 #array-inline-1-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-1-0] msg_str-0) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-0]) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) ) ) (seq (seq (seq (call %init_peer_id% ("json" "parse") [-result-flat-0.$.[0]!] deal_state) (call %init_peer_id% ("json" "obj") ["deal_id" joined_deal.$.deal_id! "worker_id" joined_deal.$.worker_id!] DealInfo_obj) ) (call %init_peer_id% ("json" "obj") ["deal_info" DealInfo_obj "from_block" deal_state.$.from_block!] DealUpdate_obj) ) (ap DealUpdate_obj $deals_update) ) ) ) (next joined_deal_str-0) ) ) (canon %init_peer_id% $deals_update #deals_update_canon) ) (call %init_peer_id% ("fluence_aurora_connector" "poll_deals_latest_update_batch") [api_endpoint #deals_update_canon] updated_deals) ) (xor (match updated_deals.$.success! false (xor (seq (seq (seq (seq (new $array-inline-2 (seq (seq (ap "can't download deals updates" $array-inline-2) (ap updated_deals.$.error.[0]! $array-inline-2) ) (canon %init_peer_id% $array-inline-2 #array-inline-2-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-1) ) (call %init_peer_id% ("run-console" "print") [title-1 #array-inline-2-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-2-0] msg_str-1) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-1]) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3]) ) ) (fold updated_deals.$.result! updated_deal-0 (seq (xor (match updated_deal-0.$.success! false (xor (seq (seq (seq (seq (seq (new $array-inline-3 (seq (seq (seq (ap "error retrieving deal update" $array-inline-3) (ap updated_deal-0.$.deal_info.deal_id! $array-inline-3) ) (ap updated_deal-0.$.error! $array-inline-3) ) (canon %init_peer_id% $array-inline-3 #array-inline-3-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-2) ) (call %init_peer_id% ("run-console" "print") [title-2 #array-inline-3-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-3-0] msg_str-2) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-2]) ) (xor (match is_ok-0_gate.$.[0]! true (xor (xor (seq (seq (null) (new $is (seq (seq (call %init_peer_id% ("fluence_aurora_connector" "blocks_diff") [updated_deal-0.$.to_block! -block-flat-0.$.[0]!] diff) (xor (match diff 0 (ap false $is) ) (ap true $is) ) ) (new $is_test (seq (seq (seq (call %init_peer_id% ("math" "add") [0 1] is_incr) (fold $is is_fold_var (seq (seq (ap is_fold_var $is_test) (canon %init_peer_id% $is_test #is_iter_canon) ) (xor (match #is_iter_canon.length is_incr (null) ) (next is_fold_var) ) ) (never) ) ) (canon %init_peer_id% $is_test #is_result_canon) ) (ap #is_result_canon is_gate) ) ) ) ) ) (match is_gate.$.[0]! true (xor (seq (seq (seq (seq (seq (seq (seq (new $array-inline-4 (seq (seq (seq (ap "update from_block: [new from_block, latest_block]" $array-inline-4) (ap updated_deal-0.$.to_block! $array-inline-4) ) (ap -block-flat-0 $array-inline-4) ) (canon %init_peer_id% $array-inline-4 #array-inline-4-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-3) ) (call %init_peer_id% ("run-console" "print") [title-3 #array-inline-4-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-4-0] msg_str-3) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-3]) ) (call %init_peer_id% ("json" "obj") ["from_block" updated_deal-0.$.to_block!] DealState_obj) ) (call %init_peer_id% ("json" "stringify") [DealState_obj] msg) ) (call %init_peer_id% (spell_id "set_string") [updated_deal-0.$.deal_info.deal_id! msg]) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 4]) ) ) ) (call %init_peer_id% ("op" "noop") []) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 5]) ) ) (call %init_peer_id% ("op" "noop") []) ) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 6]) ) ) (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (new $array-inline-5 (seq (seq (seq (seq (ap "found update for deal" $array-inline-5) (ap updated_deal-0.$.deal_info.deal_id! $array-inline-5) ) (ap "from block" $array-inline-5) ) (ap updated_deal-0.$.result.[0].block_number! $array-inline-5) ) (canon %init_peer_id% $array-inline-5 #array-inline-5-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-4) ) (call %init_peer_id% ("run-console" "print") [title-4 #array-inline-5-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-5-0] msg_str-4) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-4]) ) (call %init_peer_id% ("json" "obj") ["from_block" updated_deal-0.$.result.[0].next_block_number!] DealState_obj-0) ) (call %init_peer_id% ("json" "stringify") [DealState_obj-0] msg-2) ) (call %init_peer_id% (spell_id "set_string") [updated_deal-0.$.deal_info.deal_id! msg-2]) ) (new $array-inline-6 (seq (seq (ap "sending the latest update to the worker" $array-inline-6) (ap updated_deal-0.$.deal_info! $array-inline-6) ) (canon %init_peer_id% $array-inline-6 #array-inline-6-0) ) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-5) ) (call %init_peer_id% ("run-console" "print") [title-5 #array-inline-6-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-6-0] msg_str-5) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-5]) ) (call -relay- ("op" "noop") []) ) (xor (seq (seq (call updated_deal-0.$.deal_info.worker_id! ("json" "stringify") [updated_deal-0.$.result.[0].info.app_cid!] app_cid) (call updated_deal-0.$.deal_info.worker_id! ("worker-spell" "set_string") ["worker_def_cid" app_cid]) ) (call -relay- ("op" "noop") []) ) (seq (call -relay- ("op" "noop") []) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 7]) ) ) ) ) (next updated_deal-0) ) ) ) ) ) ) ) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 8]) )