Skip to content

Commit

Permalink
AquaDHT tests: use Aqua with 'new' operator (#1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
folex authored Nov 15, 2021
1 parent 275c398 commit af2b678
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,40 @@
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(call %init_peer_id% ("getDataSrv" "topic") [] topic)
)
(xor
(seq
(new $res
(xor
(seq
(seq
(call -relay- ("op" "string_to_b58") [topic] k)
(call -relay- ("kad" "neighborhood") [k [] []] nodes)
)
(par
(seq
(fold nodes n
(par
(seq
(xor
(seq
(call n ("peer" "timestamp_sec") [] t)
(call n ("aqua-dht" "get_values") [topic t] $res)
(call -relay- ("op" "string_to_b58") [topic] k)
(call -relay- ("kad" "neighborhood") [k [] []] nodes)
)
(par
(seq
(fold nodes n
(par
(seq
(xor
(seq
(call n ("peer" "timestamp_sec") [] t)
(call n ("aqua-dht" "get_values") [topic t] $res)
)
(null)
)
(null)
(call -relay- ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
(next n)
)
(next n)
)
(call -relay- ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
(null)
)
(null)
)
(call -relay- ("aqua-dht" "merge_two") [$res.$.[0].result! $res.$.[1].result!] v)
)
(call -relay- ("aqua-dht" "merge_two") [$res.$.[0].result! $res.$.[1].result!] v)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(xor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,65 +14,70 @@
)
(call %init_peer_id% ("getDataSrv" "service_id") [] service_id)
)
(xor
(par
(seq
(seq
(call -relay- ("op" "string_to_b58") [topic] k)
(call -relay- ("kad" "neighborhood") [k [] []] nodes)
)
(call %init_peer_id% ("op" "noop") [])
)
(seq
(fold nodes n
(par
(new $results
(seq
(xor
(par
(seq
(seq
(seq
(call -relay- ("op" "noop") [])
(xor
(call -relay- ("op" "string_to_b58") [topic] k)
(call -relay- ("kad" "neighborhood") [k [] []] nodes)
)
(call %init_peer_id% ("op" "noop") [])
)
(seq
(fold nodes n
(par
(seq
(seq
(seq
(seq
(call n ("peer" "timestamp_sec") [] t)
(call n ("aqua-dht" "register_key") [topic t false 0])
)
(call n ("aqua-dht" "put_value") [topic value t relay_id service_id 0] result)
)
(call -relay- ("op" "noop") [])
(xor
(match result.$.success! true
(xor
(seq
(seq
(seq
(seq
(ap result $results)
(call -relay- ("op" "noop") [])
)
(call n ("peer" "timestamp_sec") [] t)
(call n ("aqua-dht" "register_key") [topic t false 0])
)
(call n ("aqua-dht" "put_value") [topic value t relay_id service_id 0] result)
)
(xor
(match result.$.success! true
(xor
(call %init_peer_id% ("callbackSrv" "progress") [n])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
(seq
(seq
(ap result $results)
(call -relay- ("op" "noop") [])
)
(xor
(call %init_peer_id% ("callbackSrv" "progress") [n])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
(null)
)
)
(null)
)
)
(null)
(call %init_peer_id% ("op" "noop") [])
)
(next n)
)
(call %init_peer_id% ("op" "noop") [])
)
(next n)
(call %init_peer_id% ("op" "noop") [])
)
)
(call %init_peer_id% ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
)
(call %init_peer_id% ("op" "identity") [$results.$.[0]!] results-fix)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [$results.$.[0]!])
(call %init_peer_id% ("callbackSrv" "response") [results-fix])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 4])
)
)
Expand Down

0 comments on commit af2b678

Please sign in to comment.