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:AAIFAAAAAAAAAAwIAhIDCgEIEgMKAQgAAAAEAAAAAAdrZXlIZWFkAgAAAARoZWFkAQAAAAdrZXlQcmV2AAAAAQAAAAJpZAkAASwAAAACBQAAAAJpZAIAAAAGX19wcmV2AQAAAAdrZXlOZXh0AAAAAQAAAAJpZAkAASwAAAACBQAAAAJpZAIAAAAGX19uZXh0AAAAAARoZWFkCQAEHQAAAAIFAAAABHRoaXMFAAAAB2tleUhlYWQAAAACAAAAAWkBAAAABmluc2VydAAAAAEAAAACaWQEAAAACWNoZWNrTm9kZQMDAwkBAAAAAiE9AAAAAgUAAAACaWQFAAAABGhlYWQJAQAAAAEhAAAAAQkBAAAACWlzRGVmaW5lZAAAAAEJAQAAAAdrZXlQcmV2AAAAAQUAAAACaWQHCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABCQEAAAAHa2V5TmV4dAAAAAEFAAAAAmlkBwYJAAACAAAAAQIAAAALTm9kZSBleGlzdHMDCQAAAAAAAAIFAAAACWNoZWNrTm9kZQUAAAAJY2hlY2tOb2RlBAAAAAxzdGF0ZUNoYW5nZXMJAAROAAAAAgkABE4A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tEZWxldGVFbnRyeQAAAAEJAQAAAAdrZXlOZXh0AAAAAQUAAAACaWQFAAAAA25pbAMJAQAAAAlpc0RlZmluZWQAAAABBQAAAARuZXh0CQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAAB2tleUhlYWQJAQAAAAV2YWx1ZQAAAAEFAAAABG5leHQJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAAB2tleU5leHQAAAABBQAAAAJpZAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAAHa2V5UHJldgAAAAEJAQAAAAV2YWx1ZQAAAAEFAAAABG5leHQFAAAAA25pbAMJAQAAAAlpc0RlZmluZWQAAAABBQAAAARwcmV2CQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAQAAAAdrZXlQcmV2AAAAAQUAAAACaWQJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAAB2tleU5leHQAAAABCQEAAAAFdmFsdWUAAAABBQAAAARwcmV2BQAAAANuaWwDCQAAAAAAAAIFAAAAAmlkBQAAAARoZWFkCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAB2tleUhlYWQFAAAAA25pbAkAAAIAAAABAgAAAAxJbnZhbGlkIG5vZGUJAAUUAAAAAgUAAAAMc3RhdGVDaGFuZ2VzBQAAAAR1bml0AAAAAOv3E7I=", "height": 1934695, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 89qDxPZ5dGY41vX2PPfezQgysh8wfvbhY4NXD9noH17J Next: 55QwGJL2GfDa372q7XqupRoTpERwzpN7f9kmrjAM3Wrw Diff:
OldNewDifferences
1313
1414 @Callable(i)
1515 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.")
2031 }
2132
2233
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let keyHead = "head"
55
66 func keyPrev (id) = (id + "__prev")
77
88
99 func keyNext (id) = (id + "__next")
1010
1111
1212 let head = getString(this, keyHead)
1313
1414 @Callable(i)
1515 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.")
2031 }
2132
2233
2334
2435 @Callable(i)
2536 func delete (id) = {
2637 let prev = getString(this, keyPrev(id))
2738 let next = getString(this, keyNext(id))
2839 let stateChanges = if (if (isDefined(prev))
2940 then isDefined(next)
3041 else false)
3142 then [StringEntry(keyNext(value(prev)), value(next)), StringEntry(keyPrev(value(next)), value(prev)), DeleteEntry(keyPrev(id)), DeleteEntry(keyNext(id))]
3243 else if (isDefined(next))
3344 then [StringEntry(keyHead, value(next)), DeleteEntry(keyNext(id)), DeleteEntry(keyPrev(value(next)))]
3445 else if (isDefined(prev))
3546 then [DeleteEntry(keyPrev(id)), DeleteEntry(keyNext(value(prev)))]
3647 else if ((id == head))
3748 then [DeleteEntry(keyHead)]
3849 else throw("Invalid node")
3950 $Tuple2(stateChanges, unit)
4051 }
4152
4253

github/deemru/w8io/169f3d6 
28.58 ms