|
14 | 14 | )
|
15 | 15 | (call %init_peer_id% ("getDataSrv" "service_id") [] service_id)
|
16 | 16 | )
|
17 |
| - (xor |
18 |
| - (par |
19 |
| - (seq |
20 |
| - (seq |
21 |
| - (call -relay- ("op" "string_to_b58") [topic] k) |
22 |
| - (call -relay- ("kad" "neighborhood") [k [] []] nodes) |
23 |
| - ) |
24 |
| - (call %init_peer_id% ("op" "noop") []) |
25 |
| - ) |
26 |
| - (seq |
27 |
| - (fold nodes n |
28 |
| - (par |
| 17 | + (new $results |
| 18 | + (seq |
| 19 | + (xor |
| 20 | + (par |
| 21 | + (seq |
29 | 22 | (seq
|
30 |
| - (seq |
31 |
| - (call -relay- ("op" "noop") []) |
32 |
| - (xor |
| 23 | + (call -relay- ("op" "string_to_b58") [topic] k) |
| 24 | + (call -relay- ("kad" "neighborhood") [k [] []] nodes) |
| 25 | + ) |
| 26 | + (call %init_peer_id% ("op" "noop") []) |
| 27 | + ) |
| 28 | + (seq |
| 29 | + (fold nodes n |
| 30 | + (par |
| 31 | + (seq |
33 | 32 | (seq
|
34 |
| - (seq |
35 |
| - (seq |
36 |
| - (call n ("peer" "timestamp_sec") [] t) |
37 |
| - (call n ("aqua-dht" "register_key") [topic t false 0]) |
38 |
| - ) |
39 |
| - (call n ("aqua-dht" "put_value") [topic value t relay_id service_id 0] result) |
40 |
| - ) |
| 33 | + (call -relay- ("op" "noop") []) |
41 | 34 | (xor
|
42 |
| - (match result.$.success! true |
43 |
| - (xor |
| 35 | + (seq |
| 36 | + (seq |
44 | 37 | (seq
|
45 |
| - (seq |
46 |
| - (ap result $results) |
47 |
| - (call -relay- ("op" "noop") []) |
48 |
| - ) |
| 38 | + (call n ("peer" "timestamp_sec") [] t) |
| 39 | + (call n ("aqua-dht" "register_key") [topic t false 0]) |
| 40 | + ) |
| 41 | + (call n ("aqua-dht" "put_value") [topic value t relay_id service_id 0] result) |
| 42 | + ) |
| 43 | + (xor |
| 44 | + (match result.$.success! true |
49 | 45 | (xor
|
50 |
| - (call %init_peer_id% ("callbackSrv" "progress") [n]) |
51 |
| - (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) |
| 46 | + (seq |
| 47 | + (seq |
| 48 | + (ap result $results) |
| 49 | + (call -relay- ("op" "noop") []) |
| 50 | + ) |
| 51 | + (xor |
| 52 | + (call %init_peer_id% ("callbackSrv" "progress") [n]) |
| 53 | + (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) |
| 54 | + ) |
| 55 | + ) |
| 56 | + (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) |
52 | 57 | )
|
53 | 58 | )
|
54 |
| - (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) |
| 59 | + (null) |
55 | 60 | )
|
56 | 61 | )
|
57 | 62 | (null)
|
58 | 63 | )
|
59 | 64 | )
|
60 |
| - (null) |
| 65 | + (call %init_peer_id% ("op" "noop") []) |
61 | 66 | )
|
| 67 | + (next n) |
62 | 68 | )
|
63 |
| - (call %init_peer_id% ("op" "noop") []) |
64 | 69 | )
|
65 |
| - (next n) |
| 70 | + (call %init_peer_id% ("op" "noop") []) |
66 | 71 | )
|
67 | 72 | )
|
68 |
| - (call %init_peer_id% ("op" "noop") []) |
| 73 | + (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3]) |
69 | 74 | )
|
| 75 | + (call %init_peer_id% ("op" "identity") [$results.$.[0]!] results-fix) |
70 | 76 | )
|
71 |
| - (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3]) |
72 | 77 | )
|
73 | 78 | )
|
74 | 79 | (xor
|
75 |
| - (call %init_peer_id% ("callbackSrv" "response") [$results.$.[0]!]) |
| 80 | + (call %init_peer_id% ("callbackSrv" "response") [results-fix]) |
76 | 81 | (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 4])
|
77 | 82 | )
|
78 | 83 | )
|
|
0 commit comments