; 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 (seq (seq (call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-) (call %init_peer_id% ("getDataSrv" "spell_id") [] spell_id) ) (call %init_peer_id% ("getDataSrv" "info") [] info) ) (call %init_peer_id% ("getDataSrv" "from_block") [] from_block) ) (xor (new $from_block_init (seq (seq (seq (seq (seq (seq (new $result-0 (seq (seq (call %init_peer_id% (spell_id "get_u32") ["counter"] counter) (xor (match counter.$.success! true (ap counter.$.num! $result-0) ) (ap 0 $result-0) ) ) (new $result-0_test (seq (seq (seq (call %init_peer_id% ("math" "add") [0 1] result-0_incr) (fold $result-0 result-0_fold_var (seq (seq (ap result-0_fold_var $result-0_test) (canon %init_peer_id% $result-0_test #result-0_iter_canon) ) (xor (match #result-0_iter_canon.length result-0_incr (null) ) (next result-0_fold_var) ) ) (never) ) ) (canon %init_peer_id% $result-0_test #result-0_result_canon) ) (ap #result-0_result_canon result-0_gate) ) ) ) ) (xor (seq (call %init_peer_id% ("cmp" "gt") [result-0_gate.$.[0]! 1] gt) (match gt false (xor (seq (call %init_peer_id% ("fluence_aurora_connector" "latest_block_number") [info.$.api_endpoint!] bnumber) (xor (match bnumber.$.success! true (xor (seq (seq (seq (seq (seq (seq (seq (new $array-inline (seq (seq (seq (ap "update from_block to the latest block: [init, new]" $array-inline) (ap from_block $array-inline) ) (ap bnumber.$.result! $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% ("json" "stringify") [bnumber.$.result!] bnumber_str) ) (call %init_peer_id% (spell_id "set_string") ["from_block" bnumber_str]) ) (ap bnumber.$.result! $from_block_init) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) ) ) (call %init_peer_id% ("op" "noop") []) ) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) ) ) ) (call %init_peer_id% ("op" "noop") []) ) ) (ap from_block $from_block_init) ) (new $from_block_init_test (seq (seq (seq (call %init_peer_id% ("math" "add") [0 1] from_block_init_incr) (fold $from_block_init from_block_init_fold_var (seq (seq (ap from_block_init_fold_var $from_block_init_test) (canon %init_peer_id% $from_block_init_test #from_block_init_iter_canon) ) (xor (match #from_block_init_iter_canon.length from_block_init_incr (null) ) (next from_block_init_fold_var) ) ) (never) ) ) (canon %init_peer_id% $from_block_init_test #from_block_init_result_canon) ) (ap #from_block_init_result_canon from_block_init_gate) ) ) ) (null) ) (call %init_peer_id% ("fluence_aurora_connector" "poll_deals") [info.$.api_endpoint! info.$.address! from_block_init_gate.$.[0]!] result) ) (xor (match result.$.success! false (xor (seq (seq (seq (seq (new $array-inline-1 (seq (seq (ap "can't receive info about new deals" $array-inline-1) (ap result.$.error.[0]! $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% 3]) ) ) (seq (fold result.$.result! deal-0 (seq (seq (seq (seq (seq (seq (seq (seq (new $array-inline-2 (seq (seq (seq (seq (ap "found deal" $array-inline-2) (ap deal-0.$.info.deal_id! $array-inline-2) ) (ap "from block" $array-inline-2) ) (ap deal-0.$.block_number! $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]) ) (xor (seq (new $result-1 (seq (xor (seq (call %init_peer_id% ("worker" "get_peer_id") [deal-0.$.info.deal_id!] worker_id) (ap true $result-1) ) (ap false $result-1) ) (new $result-1_test (seq (seq (seq (call %init_peer_id% ("math" "add") [0 1] result-1_incr) (fold $result-1 result-1_fold_var (seq (seq (ap result-1_fold_var $result-1_test) (canon %init_peer_id% $result-1_test #result-1_iter_canon) ) (xor (match #result-1_iter_canon.length result-1_incr (null) ) (next result-1_fold_var) ) ) (never) ) ) (canon %init_peer_id% $result-1_test #result-1_result_canon) ) (ap #result-1_result_canon result-1_gate) ) ) ) ) (match result-1_gate.$.[0]! true (xor (seq (seq (seq (seq (new $array-inline-3 (seq (seq (seq (ap "worker for deal" $array-inline-3) (ap deal-0.$.info.deal_id! $array-inline-3) ) (ap "already created" $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]) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 4]) ) ) ) (xor (match true false (xor (seq (seq (seq (seq (new $array-inline-4 (seq (seq (seq (seq (ap "skipping deal for deal id" $array-inline-4) (ap deal-0.$.info.deal_id! $array-inline-4) ) (ap "from_block" $array-inline-4) ) (ap deal-0.$.block_number! $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% ("errorHandlingSrv" "error") [%last_error% 5]) ) ) (seq (seq (seq (seq (seq (seq (seq (new $array-inline-5 (seq (seq (seq (seq (ap "joining the deal" $array-inline-5) (ap deal-0.$.info.deal_id! $array-inline-5) ) (ap "from_block" $array-inline-5) ) (ap deal-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]) ) (null) ) (new $status (seq (seq (new $settings (new $result-2 (seq (seq (seq (seq (seq (seq (new $status-0 (new $result-3 (seq (seq (seq (seq (call %init_peer_id% (spell_id "get_string") ["worker_script"] value) (xor (match value.$.success! false (ap false $status-0) ) (xor (match value.$.absent! true (ap false $status-0) ) (seq (ap value.$.str! $result-3) (ap true $status-0) ) ) ) ) (canon %init_peer_id% $result-3 #-result-fix-0) ) (ap #-result-fix-0 -result-flat-0) ) (new $status-0_test (seq (seq (seq (call %init_peer_id% ("math" "add") [0 1] status-0_incr) (fold $status-0 status-0_fold_var (seq (seq (ap status-0_fold_var $status-0_test) (canon %init_peer_id% $status-0_test #status-0_iter_canon) ) (xor (match #status-0_iter_canon.length status-0_incr (null) ) (next status-0_fold_var) ) ) (never) ) ) (canon %init_peer_id% $status-0_test #status-0_result_canon) ) (ap #status-0_result_canon status-0_gate) ) ) ) ) ) (new $status-1 (new $result-4 (seq (seq (seq (seq (call %init_peer_id% (spell_id "get_string") ["worker_config"] value-0) (xor (match value-0.$.success! false (ap false $status-1) ) (xor (match value-0.$.absent! true (ap false $status-1) ) (seq (ap value-0.$.str! $result-4) (ap true $status-1) ) ) ) ) (canon %init_peer_id% $result-4 #-result-fix-0-0) ) (ap #-result-fix-0-0 -result-flat-0-0) ) (new $status-1_test (seq (seq (seq (call %init_peer_id% ("math" "add") [0 1] status-1_incr) (fold $status-1 status-1_fold_var (seq (seq (ap status-1_fold_var $status-1_test) (canon %init_peer_id% $status-1_test #status-1_iter_canon) ) (xor (match #status-1_iter_canon.length status-1_incr (null) ) (next status-1_fold_var) ) ) (never) ) ) (canon %init_peer_id% $status-1_test #status-1_result_canon) ) (ap #status-1_result_canon status-1_gate) ) ) ) ) ) ) (new $status-2 (new $result-5 (seq (seq (seq (seq (call %init_peer_id% (spell_id "get_string") ["worker_ipfs"] value-1) (xor (match value-1.$.success! false (ap false $status-2) ) (xor (match value-1.$.absent! true (ap false $status-2) ) (seq (ap value-1.$.str! $result-5) (ap true $status-2) ) ) ) ) (canon %init_peer_id% $result-5 #-result-fix-0-1) ) (ap #-result-fix-0-1 -result-flat-0-1) ) (new $status-2_test (seq (seq (seq (call %init_peer_id% ("math" "add") [0 1] status-2_incr) (fold $status-2 status-2_fold_var (seq (seq (ap status-2_fold_var $status-2_test) (canon %init_peer_id% $status-2_test #status-2_iter_canon) ) (xor (match #status-2_iter_canon.length status-2_incr (null) ) (next status-2_fold_var) ) ) (never) ) ) (canon %init_peer_id% $status-2_test #status-2_result_canon) ) (ap #status-2_result_canon status-2_gate) ) ) ) ) ) ) (xor (match status-0_gate.$.[0]! false (xor (seq (seq (seq (seq (seq (new $array-inline-6 (seq (ap "worker_script doesn't set" $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]) ) (ap false $result-2) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 6]) ) ) (xor (match status-1_gate.$.[0]! false (xor (seq (seq (seq (seq (seq (new $array-inline-7 (seq (ap "worker_config doesn't set" $array-inline-7) (canon %init_peer_id% $array-inline-7 #array-inline-7-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-6) ) (call %init_peer_id% ("run-console" "print") [title-6 #array-inline-7-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-7-0] msg_str-6) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-6]) ) (ap false $result-2) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 7]) ) ) (xor (match status-2_gate.$.[0]! false (xor (seq (seq (seq (seq (seq (new $array-inline-8 (seq (ap "worker_ipfs doesn't set" $array-inline-8) (canon %init_peer_id% $array-inline-8 #array-inline-8-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-7) ) (call %init_peer_id% ("run-console" "print") [title-7 #array-inline-8-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-8-0] msg_str-7) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-7]) ) (ap false $result-2) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 8]) ) ) (seq (seq (seq (seq (seq (call %init_peer_id% ("json" "parse") [-result-flat-0.$.[0]!] worker_script) (call %init_peer_id% ("json" "parse") [-result-flat-0-0.$.[0]!] worker_config) ) (call %init_peer_id% ("json" "parse") [-result-flat-0-1.$.[0]!] worker_ipfs) ) (call %init_peer_id% ("json" "obj") ["worker_config" worker_config "worker_ipfs" worker_ipfs "worker_script" worker_script] WorkerSettings_obj) ) (ap WorkerSettings_obj $settings) ) (ap true $result-2) ) ) ) ) ) (canon %init_peer_id% $settings #-settings-fix-0) ) (ap #-settings-fix-0 -settings-flat-0) ) (new $result-2_test (seq (seq (seq (call %init_peer_id% ("math" "add") [0 1] result-2_incr) (fold $result-2 result-2_fold_var (seq (seq (ap result-2_fold_var $result-2_test) (canon %init_peer_id% $result-2_test #result-2_iter_canon) ) (xor (match #result-2_iter_canon.length result-2_incr (null) ) (next result-2_fold_var) ) ) (never) ) ) (canon %init_peer_id% $result-2_test #result-2_result_canon) ) (ap #result-2_result_canon result-2_gate) ) ) ) ) ) (xor (match result-2_gate.$.[0]! false (ap false $status) ) (xor (seq (seq (call %init_peer_id% ("worker" "create") [deal-0.$.info.deal_id!] worker_id-0) (call -relay- ("op" "noop") []) ) (xor (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (call worker_id-0 ("json" "obj") ["deal_id" deal-0.$.info.deal_id! "ipfs" -settings-flat-0.$.[0].worker_ipfs! "worker_def_cid" deal-0.$.info.app_cid!] WorkerArgs_obj) (null) ) (call worker_id-0 ("spell" "install") [-settings-flat-0.$.[0].worker_script! WorkerArgs_obj -settings-flat-0.$.[0].worker_config!] worker_spell_id) ) (new $array-inline-9 (seq (seq (seq (seq (seq (seq (ap "created worker for deal" $array-inline-9) (ap deal-0.$.info.deal_id! $array-inline-9) ) (ap "spell_id" $array-inline-9) ) (ap worker_spell_id $array-inline-9) ) (ap "worker_id" $array-inline-9) ) (ap worker_id-0 $array-inline-9) ) (canon worker_id-0 $array-inline-9 #array-inline-9-0) ) ) ) (call -relay- ("op" "noop") []) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-8) ) (call %init_peer_id% ("run-console" "print") [title-8 #array-inline-9-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-9-0] msg_str-8) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-8]) ) (call -relay- ("op" "noop") []) ) (call worker_id-0 ("json" "obj") ["deal_id" deal-0.$.info.deal_id! "spell_id" worker_spell_id "worker_id" worker_id-0] JoinedDeal_obj) ) (call worker_id-0 ("json" "stringify") [JoinedDeal_obj] msg) ) (call worker_id-0 (spell_id "list_push_string") ["joined_deals" msg]) ) (call worker_id-0 ("json" "obj") ["from_block" deal-0.$.block_number!] DealState_obj) ) (call worker_id-0 ("json" "stringify") [DealState_obj] msg-0) ) (call worker_id-0 (spell_id "set_string") [deal-0.$.info.deal_id! msg-0]) ) (ap true $status) ) (call -relay- ("op" "noop") []) ) (seq (call -relay- ("op" "noop") []) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 9]) ) ) ) (seq (seq (seq (seq (seq (new $array-inline-10 (seq (seq (seq (seq (ap "cannot create worker" $array-inline-10) (ap deal-0.$.info.deal_id! $array-inline-10) ) (ap %last_error%.$.message! $array-inline-10) ) (ap "; skip" $array-inline-10) ) (canon %init_peer_id% $array-inline-10 #array-inline-10-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-9) ) (call %init_peer_id% ("run-console" "print") [title-9 #array-inline-10-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-10-0] msg_str-9) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-9]) ) (ap false $status) ) ) ) ) (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]! true (xor (seq (seq (seq (seq (new $array-inline-11 (seq (seq (ap "joined the deal" $array-inline-11) (ap deal-0.$.info.deal_id! $array-inline-11) ) (canon %init_peer_id% $array-inline-11 #array-inline-11-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-10) ) (call %init_peer_id% ("run-console" "print") [title-10 #array-inline-11-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-11-0] msg_str-10) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-10]) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 10]) ) ) (seq (seq (seq (seq (new $array-inline-12 (seq (seq (ap "couldn't join the deal" $array-inline-12) (ap deal-0.$.info.deal_id! $array-inline-12) ) (canon %init_peer_id% $array-inline-12 #array-inline-12-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-11) ) (call %init_peer_id% ("run-console" "print") [title-11 #array-inline-12-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-12-0] msg_str-11) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-11]) ) ) ) ) ) ) (call %init_peer_id% ("json" "stringify") [deal-0.$.next_block_number!] new_from_block) ) (call %init_peer_id% (spell_id "set_string") ["from_block" new_from_block]) ) (next deal-0) ) ) (xor (seq (seq (seq (seq (ap result.$.result! result_flat) (ap result_flat result_flat_to_functor) ) (ap result_flat_to_functor.length result_flat_length) ) (call %init_peer_id% ("cmp" "gt") [result_flat_length 1] gt-0) ) (match gt-0 false (xor (seq (seq (null) (new $need_update (seq (seq (new $block (new $is_ok-1 (seq (seq (seq (seq (call %init_peer_id% ("fluence_aurora_connector" "latest_block_number") [info.$.api_endpoint!] result-7) (xor (match result-7.$.success! false (ap false $is_ok-1) ) (seq (ap result-7.$.result! $block) (ap true $is_ok-1) ) ) ) (canon %init_peer_id% $block #-block-fix-0) ) (ap #-block-fix-0 -block-flat-0) ) (new $is_ok-1_test (seq (seq (seq (call %init_peer_id% ("math" "add") [0 1] is_ok-1_incr) (fold $is_ok-1 is_ok-1_fold_var (seq (seq (ap is_ok-1_fold_var $is_ok-1_test) (canon %init_peer_id% $is_ok-1_test #is_ok-1_iter_canon) ) (xor (match #is_ok-1_iter_canon.length is_ok-1_incr (null) ) (next is_ok-1_fold_var) ) ) (never) ) ) (canon %init_peer_id% $is_ok-1_test #is_ok-1_result_canon) ) (ap #is_ok-1_result_canon is_ok-1_gate) ) ) ) ) ) (xor (match is_ok-1_gate.$.[0]! true (xor (seq (new $is (seq (seq (call %init_peer_id% ("fluence_aurora_connector" "blocks_diff") [result.$.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) ) ) ) ) (ap is_gate.$.[0]! $need_update) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 11]) ) ) (ap false $need_update) ) ) (new $need_update_test (seq (seq (seq (call %init_peer_id% ("math" "add") [0 1] need_update_incr) (fold $need_update need_update_fold_var (seq (seq (ap need_update_fold_var $need_update_test) (canon %init_peer_id% $need_update_test #need_update_iter_canon) ) (xor (match #need_update_iter_canon.length need_update_incr (null) ) (next need_update_fold_var) ) ) (never) ) ) (canon %init_peer_id% $need_update_test #need_update_result_canon) ) (ap #need_update_result_canon need_update_gate) ) ) ) ) ) (xor (match need_update_gate.$.[0]! true (xor (seq (seq (seq (seq (seq (seq (new $array-inline-13 (seq (seq (seq (ap "updating outdated from_block: [previous from_block, new_from_block]" $array-inline-13) (ap from_block $array-inline-13) ) (ap result.$.to_block! $array-inline-13) ) (canon %init_peer_id% $array-inline-13 #array-inline-13-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-12) ) (call %init_peer_id% ("run-console" "print") [title-12 #array-inline-13-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-13-0] msg_str-12) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-12]) ) (call %init_peer_id% ("json" "stringify") [result.$.to_block!] to_block_str) ) (call %init_peer_id% (spell_id "set_string") ["from_block" to_block_str]) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 12]) ) ) (call %init_peer_id% ("op" "noop") []) ) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 13]) ) ) ) (call %init_peer_id% ("op" "noop") []) ) ) ) ) ) (call %init_peer_id% ("op" "noop") []) ) ) (new $deals_update (seq (seq (new $block-0 (new $is_ok-3 (seq (seq (seq (seq (call %init_peer_id% ("fluence_aurora_connector" "latest_block_number") [info.$.api_endpoint!] result-8) (xor (match result-8.$.success! false (ap false $is_ok-3) ) (seq (ap result-8.$.result! $block-0) (ap true $is_ok-3) ) ) ) (canon %init_peer_id% $block-0 #-block-fix-0-0) ) (ap #-block-fix-0-0 -block-flat-0-0) ) (new $is_ok-3_test (seq (seq (seq (call %init_peer_id% ("math" "add") [0 1] is_ok-3_incr) (fold $is_ok-3 is_ok-3_fold_var (seq (seq (ap is_ok-3_fold_var $is_ok-3_test) (canon %init_peer_id% $is_ok-3_test #is_ok-3_iter_canon) ) (xor (match #is_ok-3_iter_canon.length is_ok-3_incr (null) ) (next is_ok-3_fold_var) ) ) (never) ) ) (canon %init_peer_id% $is_ok-3_test #is_ok-3_result_canon) ) (ap #is_ok-3_result_canon is_ok-3_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-14 (seq (seq (ap "can't restrive joined deals" $array-inline-14) (ap list.$.error! $array-inline-14) ) (canon %init_peer_id% $array-inline-14 #array-inline-14-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-13) ) (call %init_peer_id% ("run-console" "print") [title-13 #array-inline-14-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-14-0] msg_str-13) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-13]) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 14]) ) ) (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-3 (new $result-9 (seq (seq (seq (seq (call %init_peer_id% (spell_id "get_string") [joined_deal.$.deal_id!] value-2) (xor (match value-2.$.success! false (ap false $status-3) ) (xor (match value-2.$.absent! true (ap false $status-3) ) (seq (ap value-2.$.str! $result-9) (ap true $status-3) ) ) ) ) (canon %init_peer_id% $result-9 #-result-fix-0-2) ) (ap #-result-fix-0-2 -result-flat-0-2) ) (new $status-3_test (seq (seq (seq (call %init_peer_id% ("math" "add") [0 1] status-3_incr) (fold $status-3 status-3_fold_var (seq (seq (ap status-3_fold_var $status-3_test) (canon %init_peer_id% $status-3_test #status-3_iter_canon) ) (xor (match #status-3_iter_canon.length status-3_incr (null) ) (next status-3_fold_var) ) ) (never) ) ) (canon %init_peer_id% $status-3_test #status-3_result_canon) ) (ap #status-3_result_canon status-3_gate) ) ) ) ) ) ) (xor (match status-3_gate.$.[0]! false (xor (seq (seq (seq (seq (new $array-inline-15 (seq (seq (seq (ap "can't find state of the deal" $array-inline-15) (ap joined_deal.$.deal_id! $array-inline-15) ) (ap "; broken invariant, check poll_new_deals" $array-inline-15) ) (canon %init_peer_id% $array-inline-15 #array-inline-15-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-14) ) (call %init_peer_id% ("run-console" "print") [title-14 #array-inline-15-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-15-0] msg_str-14) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-14]) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 15]) ) ) (seq (seq (seq (call %init_peer_id% ("json" "parse") [-result-flat-0-2.$.[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") [info.$.api_endpoint! #deals_update_canon] updated_deals) ) (xor (match updated_deals.$.success! false (xor (seq (seq (seq (seq (new $array-inline-16 (seq (seq (ap "can't download deals updates" $array-inline-16) (ap updated_deals.$.error.[0]! $array-inline-16) ) (canon %init_peer_id% $array-inline-16 #array-inline-16-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-15) ) (call %init_peer_id% ("run-console" "print") [title-15 #array-inline-16-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-16-0] msg_str-15) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-15]) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 16]) ) ) (fold updated_deals.$.result! updated_deal-0 (seq (xor (match updated_deal-0.$.success! false (xor (seq (seq (seq (seq (seq (new $array-inline-17 (seq (seq (seq (ap "error retrieving deal update" $array-inline-17) (ap updated_deal-0.$.deal_info.deal_id! $array-inline-17) ) (ap updated_deal-0.$.error! $array-inline-17) ) (canon %init_peer_id% $array-inline-17 #array-inline-17-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-16) ) (call %init_peer_id% ("run-console" "print") [title-16 #array-inline-17-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-17-0] msg_str-16) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-16]) ) (xor (match is_ok-3_gate.$.[0]! true (xor (xor (seq (seq (null) (new $is-0 (seq (seq (call %init_peer_id% ("fluence_aurora_connector" "blocks_diff") [updated_deal-0.$.to_block! -block-flat-0-0.$.[0]!] diff-0) (xor (match diff-0 0 (ap false $is-0) ) (ap true $is-0) ) ) (new $is-0_test (seq (seq (seq (call %init_peer_id% ("math" "add") [0 1] is-0_incr) (fold $is-0 is-0_fold_var (seq (seq (ap is-0_fold_var $is-0_test) (canon %init_peer_id% $is-0_test #is-0_iter_canon) ) (xor (match #is-0_iter_canon.length is-0_incr (null) ) (next is-0_fold_var) ) ) (never) ) ) (canon %init_peer_id% $is-0_test #is-0_result_canon) ) (ap #is-0_result_canon is-0_gate) ) ) ) ) ) (match is-0_gate.$.[0]! true (xor (seq (seq (seq (seq (seq (seq (seq (new $array-inline-18 (seq (seq (seq (ap "update from_block: [new from_block, latest_block]" $array-inline-18) (ap updated_deal-0.$.to_block! $array-inline-18) ) (ap -block-flat-0-0 $array-inline-18) ) (canon %init_peer_id% $array-inline-18 #array-inline-18-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-17) ) (call %init_peer_id% ("run-console" "print") [title-17 #array-inline-18-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-18-0] msg_str-17) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-17]) ) (call %init_peer_id% ("json" "obj") ["from_block" updated_deal-0.$.to_block!] DealState_obj-0) ) (call %init_peer_id% ("json" "stringify") [DealState_obj-0] msg-19) ) (call %init_peer_id% (spell_id "set_string") [updated_deal-0.$.deal_info.deal_id! msg-19]) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 17]) ) ) ) (call %init_peer_id% ("op" "noop") []) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 18]) ) ) (call %init_peer_id% ("op" "noop") []) ) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 19]) ) ) (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (seq (new $array-inline-19 (seq (seq (seq (seq (ap "found update for deal" $array-inline-19) (ap updated_deal-0.$.deal_info.deal_id! $array-inline-19) ) (ap "from block" $array-inline-19) ) (ap updated_deal-0.$.result.[0].block_number! $array-inline-19) ) (canon %init_peer_id% $array-inline-19 #array-inline-19-0) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-18) ) (call %init_peer_id% ("run-console" "print") [title-18 #array-inline-19-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-19-0] msg_str-18) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-18]) ) (call %init_peer_id% ("json" "obj") ["from_block" updated_deal-0.$.result.[0].next_block_number!] DealState_obj-1) ) (call %init_peer_id% ("json" "stringify") [DealState_obj-1] msg-22) ) (call %init_peer_id% (spell_id "set_string") [updated_deal-0.$.deal_info.deal_id! msg-22]) ) (new $array-inline-20 (seq (seq (ap "sending the latest update to the worker" $array-inline-20) (ap updated_deal-0.$.deal_info! $array-inline-20) ) (canon %init_peer_id% $array-inline-20 #array-inline-20-0) ) ) ) (call %init_peer_id% ("op" "concat_strings") ["decider <" spell_id ">"] title-19) ) (call %init_peer_id% ("run-console" "print") [title-19 #array-inline-20-0]) ) (call %init_peer_id% ("json" "stringify") [#array-inline-20-0] msg_str-19) ) (call %init_peer_id% (spell_id "list_push_string") ["logs" msg_str-19]) ) (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% 20]) ) ) ) ) (next updated_deal-0) ) ) ) ) ) ) ) ) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 21]) )