tx · 5tNSZkqNw31guhiDBftFS9n98kLpUzWRhMRfuamMaMEs 3MyZr42eC2kca59w82tafyemrC7V2b97yxN: -0.01000000 Waves 2022.07.06 14:17 [2127754] smart account 3MyZr42eC2kca59w82tafyemrC7V2b97yxN > SELF 0.00000000 Waves
{ "type": 13, "id": "5tNSZkqNw31guhiDBftFS9n98kLpUzWRhMRfuamMaMEs", "fee": 1000000, "feeAssetId": null, "timestamp": 1657106253954, "version": 2, "chainId": 84, "sender": "3MyZr42eC2kca59w82tafyemrC7V2b97yxN", "senderPublicKey": "4gLjFBxeVDJ31pmQaSSAuf5ZiLHzuSGQP6Vk6EHepAiy", "proofs": [ "55YSdajXdDxVLmYuNUsc5SUqNxEKGXwPrm5zEEumTMZ75Jm2vLDZpV3F9DJ123WdjNECCJvUaXbtpz9B3tFFugPD" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIIAQAAAAAAAAABAAAAAWkBAAAAGmluc2VydEludG9Tb3J0ZWRMaW5rZWRMaXN0AAAAAgAAAA1zb3J0ZWRMaXN0U3RyAAAACG5ld0VudHJ5BAAAAAhpZHhBcnJheQkABEwAAAACAAAAAAAAAAAACQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAAAgkABEwAAAACAAAAAAAAAAADCQAETAAAAAIAAAAAAAAAAAQJAARMAAAAAgAAAAAAAAAABQkABEwAAAACAAAAAAAAAAAGCQAETAAAAAIAAAAAAAAAAAcJAARMAAAAAgAAAAAAAAAACAkABEwAAAACAAAAAAAAAAAJCQAETAAAAAIAAAAAAAAAAAoJAARMAAAAAgAAAAAAAAAACwkABEwAAAACAAAAAAAAAAAMCQAETAAAAAIAAAAAAAAAAA0JAARMAAAAAgAAAAAAAAAADgkABEwAAAACAAAAAAAAAAAPCQAETAAAAAIAAAAAAAAAABAJAARMAAAAAgAAAAAAAAAAEQkABEwAAAACAAAAAAAAAAASCQAETAAAAAIAAAAAAAAAABMFAAAAA25pbAQAAAAKc29ydGVkTGlzdAk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AAAARAAAAAAAAAAASAAAAAAAAAAATAAAAAAAAAAAUCQAFFAAAAAIFAAAAA25pbAUAAAASbW9kaWZpZWRTb3J0ZWRMaXN0AAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkbZ7U+", "height": 2127754, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DmuuVeDPUk8ux45jNoVesGQv4gNCkPY7vtzak6TL9bRZ Next: EmEc73AeJFuth5FRNU8rjDQgfVyfbwJvPpiu6wCh6ENn Diff:
Old | New | Differences | |
---|---|---|---|
10 | 10 | if ((size(sortedList) >= size(idxArray))) | |
11 | 11 | then throw("passed sortedList size is too long...") | |
12 | 12 | else { | |
13 | - | func internalInsert ( | |
14 | - | then | |
13 | + | func internalInsert (tupleResult,idx) = if ((idx >= size(sortedList))) | |
14 | + | then tupleResult | |
15 | 15 | else { | |
16 | 16 | let val = sortedList[idx] | |
17 | + | let newSortedList = tupleResult._1 | |
17 | 18 | if (((idx + 1) == size(newSortedList))) | |
18 | - | then if ((newEntry >= parseIntValue(val))) | |
19 | - | then ((newSortedList :+ val) :+ toString(newEntry)) | |
20 | - | else ((newSortedList :+ toString(newEntry)) :+ val) | |
19 | + | then if ((tupleResult._2 == false)) | |
20 | + | then if ((newEntry >= parseIntValue(val))) | |
21 | + | then $Tuple2(((newSortedList :+ val) :+ toString(newEntry)), true) | |
22 | + | else $Tuple2(((newSortedList :+ toString(newEntry)) :+ val), true) | |
23 | + | else $Tuple2((newSortedList :+ val), true) | |
21 | 24 | else if ((newEntry >= parseIntValue(val))) | |
22 | - | then (newSortedList :+ val) | |
23 | - | else ((newSortedList :+ toString(newEntry)) :+ val) | |
25 | + | then $Tuple2((newSortedList :+ val), false) | |
26 | + | else $Tuple2(((newSortedList :+ toString(newEntry)) :+ val), true) | |
24 | 27 | } | |
25 | 28 | ||
26 | 29 | let modifiedSortedList = { | |
27 | 30 | let $l = idxArray | |
28 | 31 | let $s = size($l) | |
29 | - | let $acc0 = nil | |
32 | + | let $acc0 = $Tuple2(nil, false) | |
30 | 33 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
31 | 34 | then $a | |
32 | 35 | else internalInsert($a, $l[$i]) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func insertIntoSortedLinkedList (sortedListStr,newEntry) = { | |
8 | 8 | let idxArray = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] | |
9 | 9 | let sortedList = split(sortedListStr, "__") | |
10 | 10 | if ((size(sortedList) >= size(idxArray))) | |
11 | 11 | then throw("passed sortedList size is too long...") | |
12 | 12 | else { | |
13 | - | func internalInsert ( | |
14 | - | then | |
13 | + | func internalInsert (tupleResult,idx) = if ((idx >= size(sortedList))) | |
14 | + | then tupleResult | |
15 | 15 | else { | |
16 | 16 | let val = sortedList[idx] | |
17 | + | let newSortedList = tupleResult._1 | |
17 | 18 | if (((idx + 1) == size(newSortedList))) | |
18 | - | then if ((newEntry >= parseIntValue(val))) | |
19 | - | then ((newSortedList :+ val) :+ toString(newEntry)) | |
20 | - | else ((newSortedList :+ toString(newEntry)) :+ val) | |
19 | + | then if ((tupleResult._2 == false)) | |
20 | + | then if ((newEntry >= parseIntValue(val))) | |
21 | + | then $Tuple2(((newSortedList :+ val) :+ toString(newEntry)), true) | |
22 | + | else $Tuple2(((newSortedList :+ toString(newEntry)) :+ val), true) | |
23 | + | else $Tuple2((newSortedList :+ val), true) | |
21 | 24 | else if ((newEntry >= parseIntValue(val))) | |
22 | - | then (newSortedList :+ val) | |
23 | - | else ((newSortedList :+ toString(newEntry)) :+ val) | |
25 | + | then $Tuple2((newSortedList :+ val), false) | |
26 | + | else $Tuple2(((newSortedList :+ toString(newEntry)) :+ val), true) | |
24 | 27 | } | |
25 | 28 | ||
26 | 29 | let modifiedSortedList = { | |
27 | 30 | let $l = idxArray | |
28 | 31 | let $s = size($l) | |
29 | - | let $acc0 = nil | |
32 | + | let $acc0 = $Tuple2(nil, false) | |
30 | 33 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
31 | 34 | then $a | |
32 | 35 | else internalInsert($a, $l[$i]) | |
33 | 36 | ||
34 | 37 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
35 | 38 | then $a | |
36 | 39 | else throw("List size exceeds 20") | |
37 | 40 | ||
38 | 41 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
39 | 42 | } | |
40 | 43 | $Tuple2(nil, modifiedSortedList) | |
41 | 44 | } | |
42 | 45 | } | |
43 | 46 | ||
44 | 47 | ||
45 | 48 | @Verifier(tx) | |
46 | 49 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
47 | 50 |
github/deemru/w8io/fabc49c 28.23 ms ◑