tx · CqxKxLgE9WGTo23kyKgAah2N8qP22fm6jyggB4NtWzzp 3N4upXkARvecPGQAtpSQ11CFASTFsvEPiP2: -0.01000000 Waves 2022.02.22 12:40 [1934695] smart account 3N4upXkARvecPGQAtpSQ11CFASTFsvEPiP2 > SELF 0.00000000 Waves
{ "type": 13, "id": "CqxKxLgE9WGTo23kyKgAah2N8qP22fm6jyggB4NtWzzp", "fee": 1000000, "feeAssetId": null, "timestamp": 1645522859859, "version": 2, "chainId": 84, "sender": "3N4upXkARvecPGQAtpSQ11CFASTFsvEPiP2", "senderPublicKey": "5dTGvAkGC1ryvEkRCst923pqULtN3qWs6XXueerWos1D", "proofs": [ "2QAYwCKHqpYzoA64nwFi85pgXNpuMQd68e8VgUzcQ5ZDtJ9W1yBKDcnave2fSATixnJVfZBEDKejJb5MT8CzzoVf" ], "script": "base64:AAIFAAAAAAAAAAwIAhIDCgEIEgMKAQgAAAAEAAAAAAdrZXlIZWFkAgAAAARoZWFkAQAAAAdrZXlQcmV2AAAAAQAAAAJpZAkAASwAAAACBQAAAAJpZAIAAAAGX19wcmV2AQAAAAdrZXlOZXh0AAAAAQAAAAJpZAkAASwAAAACBQAAAAJpZAIAAAAGX19uZXh0AAAAAARoZWFkCQAEHQAAAAIFAAAABHRoaXMFAAAAB2tleUhlYWQAAAACAAAAAWkBAAAABmluc2VydAAAAAEAAAACaWQEAAAACWNoZWNrTm9kZQMDAwkBAAAAAiE9AAAAAgUAAAACaWQFAAAABGhlYWQJAQAAAAEhAAAAAQkBAAAACWlzRGVmaW5lZAAAAAEJAQAAAAdrZXlQcmV2AAAAAQUAAAACaWQHCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABCQEAAAAHa2V5TmV4dAAAAAEFAAAAAmlkBwYJAAACAAAAAQIAAAALTm9kZSBleGlzdHMDCQAAAAAAAAIFAAAACWNoZWNrTm9kZQUAAAAJY2hlY2tOb2RlBAAAAAxzdGF0ZUNoYW5nZXMJAAROAAAAAgkABE4AA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EZWxldGVFbnRyeQAAAAEJAQAAAAdrZXlOZXh0AAAAAQUAAAACaWQFAAAAA25pbAMJAQAAAAlpc0RlZmluZWQAAAABBQAAAARuZXh0CQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAAB2tleUhlYWQJAQAAAAV2YWx1ZQAAAAEFAAAABG5leHQJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAAB2tleU5leHQAAAABBQAAAAJpZAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAAHa2V5UHJldgAAAAEJAQAAAAV2YWx1ZQAAAAEFAAAABG5leHQFAAAAA25pbAMJAQAAAAlpc0RlZmluZWQAAAABBQAAAARwcmV2CQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAQAAAAdrZXlQcmV2AAAAAQUAAAACaWQJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAAB2tleU5leHQAAAABCQEAAAAFdmFsdWUAAAABBQAAAARwcmV2BQAAAANuaWwDCQAAAAAAAAIFAAAAAmlkBQAAAARoZWFkCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAB2tleUhlYWQFAAAAA25pbAkAAAIAAAABAgAAAAxJbnZhbGlkIG5vZGUJAAUUAAAAAgUAAAAMc3RhdGVDaGFuZ2VzBQAAAAR1bml0AAAAAOv3E7I=", "height": 1934695, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 89qDxPZ5dGY41vX2PPfezQgysh8wfvbhY4NXD9noH17J Next: 55QwGJL2GfDa372q7XqupRoTpERwzpN7f9kmrjAM3Wrw Diff:
Old | New | Differences | |
---|---|---|---|
13 | 13 | ||
14 | 14 | @Callable(i) | |
15 | 15 | func insert (id) = { | |
16 | - | let stateChanges = ((nil ++ (if (isDefined(head)) | |
17 | - | then [StringEntry(keyNext(id), value(head)), StringEntry(keyPrev(value(head)), id)] | |
18 | - | else nil)) ++ [StringEntry(keyHead, id)]) | |
19 | - | $Tuple2(stateChanges, unit) | |
16 | + | let checkNode = if (if (if ((id != head)) | |
17 | + | then !(isDefined(keyPrev(id))) | |
18 | + | else false) | |
19 | + | then !(isDefined(keyNext(id))) | |
20 | + | else false) | |
21 | + | then true | |
22 | + | else throw("Node exists") | |
23 | + | if ((checkNode == checkNode)) | |
24 | + | then { | |
25 | + | let stateChanges = ((nil ++ (if (isDefined(head)) | |
26 | + | then [StringEntry(keyNext(id), value(head)), StringEntry(keyPrev(value(head)), id)] | |
27 | + | else nil)) ++ [StringEntry(keyHead, id)]) | |
28 | + | $Tuple2(stateChanges, unit) | |
29 | + | } | |
30 | + | else throw("Strict value is not equal to itself.") | |
20 | 31 | } | |
21 | 32 | ||
22 | 33 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let keyHead = "head" | |
5 | 5 | ||
6 | 6 | func keyPrev (id) = (id + "__prev") | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func keyNext (id) = (id + "__next") | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | let head = getString(this, keyHead) | |
13 | 13 | ||
14 | 14 | @Callable(i) | |
15 | 15 | func insert (id) = { | |
16 | - | let stateChanges = ((nil ++ (if (isDefined(head)) | |
17 | - | then [StringEntry(keyNext(id), value(head)), StringEntry(keyPrev(value(head)), id)] | |
18 | - | else nil)) ++ [StringEntry(keyHead, id)]) | |
19 | - | $Tuple2(stateChanges, unit) | |
16 | + | let checkNode = if (if (if ((id != head)) | |
17 | + | then !(isDefined(keyPrev(id))) | |
18 | + | else false) | |
19 | + | then !(isDefined(keyNext(id))) | |
20 | + | else false) | |
21 | + | then true | |
22 | + | else throw("Node exists") | |
23 | + | if ((checkNode == checkNode)) | |
24 | + | then { | |
25 | + | let stateChanges = ((nil ++ (if (isDefined(head)) | |
26 | + | then [StringEntry(keyNext(id), value(head)), StringEntry(keyPrev(value(head)), id)] | |
27 | + | else nil)) ++ [StringEntry(keyHead, id)]) | |
28 | + | $Tuple2(stateChanges, unit) | |
29 | + | } | |
30 | + | else throw("Strict value is not equal to itself.") | |
20 | 31 | } | |
21 | 32 | ||
22 | 33 | ||
23 | 34 | ||
24 | 35 | @Callable(i) | |
25 | 36 | func delete (id) = { | |
26 | 37 | let prev = getString(this, keyPrev(id)) | |
27 | 38 | let next = getString(this, keyNext(id)) | |
28 | 39 | let stateChanges = if (if (isDefined(prev)) | |
29 | 40 | then isDefined(next) | |
30 | 41 | else false) | |
31 | 42 | then [StringEntry(keyNext(value(prev)), value(next)), StringEntry(keyPrev(value(next)), value(prev)), DeleteEntry(keyPrev(id)), DeleteEntry(keyNext(id))] | |
32 | 43 | else if (isDefined(next)) | |
33 | 44 | then [StringEntry(keyHead, value(next)), DeleteEntry(keyNext(id)), DeleteEntry(keyPrev(value(next)))] | |
34 | 45 | else if (isDefined(prev)) | |
35 | 46 | then [DeleteEntry(keyPrev(id)), DeleteEntry(keyNext(value(prev)))] | |
36 | 47 | else if ((id == head)) | |
37 | 48 | then [DeleteEntry(keyHead)] | |
38 | 49 | else throw("Invalid node") | |
39 | 50 | $Tuple2(stateChanges, unit) | |
40 | 51 | } | |
41 | 52 | ||
42 | 53 |
github/deemru/w8io/169f3d6 28.58 ms ◑