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