tx · FBECEvUH7S8VhUQREgemG2ZWchtJvRc3sA5seKNpCnUU

3MwPfAfkrELWorzsNx3KyZU525FZksSmRq9:  -0.01400000 Waves

2019.12.01 14:16 [789490] smart account 3MwPfAfkrELWorzsNx3KyZU525FZksSmRq9 > SELF 0.00000000 Waves

{ "type": 13, "id": "FBECEvUH7S8VhUQREgemG2ZWchtJvRc3sA5seKNpCnUU", "fee": 1400000, "feeAssetId": null, "timestamp": 1575199036282, "version": 1, "sender": "3MwPfAfkrELWorzsNx3KyZU525FZksSmRq9", "senderPublicKey": "xdeD5P7gGVng1RJJ4k7QRv7jMHJERkQnH2AJwLUV2Ju", "proofs": [ "3aA9upiPpHk5Fnjqk4dcuxYr2SGdGqP1tubKb8WFLFBbmtDrZE7bth2H6AryyBysa9eVj4BziKTp9CoZ9x8RY5si" ], "script": "base64:AAIDAAAAAAAAACEIARIFCgMICAgSBAoCCAgSBAoCCAgSBAoCCAgSBAoCCAgAAAAHAQAAAANnZXQAAAACAAAABGpzb24AAAADa2V5AwMJAQAAAAIhPQAAAAIJAAEvAAAAAgUAAAAEanNvbgAAAAAAAAAAAQIAAAABewkBAAAAAiE9AAAAAgkAAS8AAAACBQAAAARqc29uAAAAAAAAAAABAgAAAAFdBwkAAAIAAAABAgAAAAAEAAAACGtleUluZGV4CQEAAAAFdmFsdWUAAAABCQAEswAAAAIFAAAABGpzb24JAAEsAAAAAgkAASwAAAACAgAAAAEiBQAAAANrZXkCAAAAAiI6BAAAAARkYXRhCQABMAAAAAIFAAAABGpzb24JAABkAAAAAgkAAGQAAAACBQAAAAhrZXlJbmRleAkAATEAAAABBQAAAANrZXkAAAAAAAAAAAMFAAAABGRhdGEBAAAAEGdldEpzb25CZWZvcmVLZXkAAAACAAAABGpzb24AAAADa2V5AwMJAQAAAAIhPQAAAAIJAAEvAAAAAgUAAAAEanNvbgAAAAAAAAAAAQIAAAABewkBAAAAAiE9AAAAAgkAAS8AAAACBQAAAARqc29uAAAAAAAAAAABAgAAAAFd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ubyBjaGFuZ2VzCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAAhuZXd2YWx1ZQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAA92YWx1ZUJlZm9yZUpzb24CAAAAASIFAAAACG5ld1ZhbHVlAgAAAAEiBQAAAA52YWx1ZUFmdGVySnNvbgUAAAADbmlsAAAAAWkBAAAAB3Rlc3RHZXQAAAACAAAABGpzb24AAAADa2V5CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAARqc29uCQEAAAADZ2V0AAAAAgUAAAAEanNvbgUAAAADa2V5BQAAAANuaWwAAAABaQEAAAASdGVzdEdldFZhbHVlU3RyaW5nAAAAAgAAAARqc29uAAAAA2tleQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAEanNvbgkBAAAADmdldFZhbHVlU3RyaW5nAAAAAQkBAAAAA2dldAAAAAIFAAAABGpzb24FAAAAA2tleQUAAAADbmlsAAAAAWkBAAAAD3Rlc3RHZXRWYWx1ZUludAAAAAIAAAAEanNvbgAAAANrZXkJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABGpzb24JAQAAAAtnZXRWYWx1ZUludAAAAAEJAQAAAANnZXQAAAACBQAAAARqc29uBQAAAANrZXkFAAAAA25pbAAAAAFpAQAAABB0ZXN0R2V0VmFsdWVCb29sAAAAAgAAAARqc29uAAAAA2tleQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAEanNvbgkBAAAADGdldFZhbHVlQm9vbAAAAAEJAQAAAANnZXQAAAACBQAAAARqc29uBQAAAANrZXkFAAAAA25pbAAAAAC6EDZ3", "chainId": 84, "height": 789490, "spentComplexity": 0 } View: original | compacted Prev: DzXtPr94keo1K5Rf44ztzAXBZA8CNhoX5nLZG2wxHdJT Next: H62kTtcZ2nW5Z1x1WkvqmpnVHYZU6gJaprRC29VnSjdn Diff:
OldNewDifferences
1818 then throw("")
1919 else {
2020 let keyIndex = value(indexOf(json, (("\"" + key) + "\":")))
21- let data = take(json, keyIndex)
21+ let data = take(json, ((keyIndex + size(key)) + 3))
2222 data
2323 }
2424
2929 then throw("")
3030 else {
3131 let keyIndex = value(indexOf(json, (("\"" + key) + "\":")))
32- let data = takeRight(json, (((keyIndex + size(key)) + 3) + size(newValue)))
32+ let data = takeRight(json, (size(json) - (((keyIndex + size(key)) + 3) + size(newValue))))
3333 data
3434 }
3535
6767 let valueInJson = getValueString(get(valueJSON, key))
6868 if ((valueInJson == newValue))
6969 then throw("same value so no changes")
70- else WriteSet([DataEntry("newvalue", ((valueBeforeJson + newValue) + valueAfterJson))])
70+ else WriteSet([DataEntry("newvalue", ((((valueBeforeJson + "\"") + newValue) + "\"") + valueAfterJson))])
7171 }
7272
7373
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func get (json,key) = if (if ((take(json, 1) != "{"))
55 then (take(json, 1) != "]")
66 else false)
77 then throw("")
88 else {
99 let keyIndex = value(indexOf(json, (("\"" + key) + "\":")))
1010 let data = drop(json, ((keyIndex + size(key)) + 3))
1111 data
1212 }
1313
1414
1515 func getJsonBeforeKey (json,key) = if (if ((take(json, 1) != "{"))
1616 then (take(json, 1) != "]")
1717 else false)
1818 then throw("")
1919 else {
2020 let keyIndex = value(indexOf(json, (("\"" + key) + "\":")))
21- let data = take(json, keyIndex)
21+ let data = take(json, ((keyIndex + size(key)) + 3))
2222 data
2323 }
2424
2525
2626 func getJsonAfterKey (json,key,newValue) = if (if ((take(json, 1) != "{"))
2727 then (take(json, 1) != "]")
2828 else false)
2929 then throw("")
3030 else {
3131 let keyIndex = value(indexOf(json, (("\"" + key) + "\":")))
32- let data = takeRight(json, (((keyIndex + size(key)) + 3) + size(newValue)))
32+ let data = takeRight(json, (size(json) - (((keyIndex + size(key)) + 3) + size(newValue))))
3333 data
3434 }
3535
3636
3737 func getValueString (json) = take(drop(json, 1), value(indexOf(drop(json, 1), "\"")))
3838
3939
4040 func getValueIntOrBool (json) = {
4141 let indexSymbolOne = value(indexOf(json, "}"))
4242 let indexSymbolTwo = value(indexOf(json, ","))
4343 if ((indexSymbolTwo > indexSymbolOne))
4444 then take(json, indexSymbolOne)
4545 else take(json, indexSymbolTwo)
4646 }
4747
4848
4949 func getValueInt (json) = parseIntValue(getValueIntOrBool(json))
5050
5151
5252 func getValueBool (json) = if ((getValueIntOrBool(json) == "true"))
5353 then true
5454 else false
5555
5656
5757 @Callable(i)
5858 func testUpdateJsonKeyValue (jsonKey,key,newValue) = {
5959 let valueJSON = match getString(this, jsonKey) {
6060 case s: String =>
6161 s
6262 case _ =>
6363 throw("The key doesn't exist")
6464 }
6565 let valueBeforeJson = getJsonBeforeKey(valueJSON, key)
6666 let valueAfterJson = getJsonAfterKey(valueJSON, key, newValue)
6767 let valueInJson = getValueString(get(valueJSON, key))
6868 if ((valueInJson == newValue))
6969 then throw("same value so no changes")
70- else WriteSet([DataEntry("newvalue", ((valueBeforeJson + newValue) + valueAfterJson))])
70+ else WriteSet([DataEntry("newvalue", ((((valueBeforeJson + "\"") + newValue) + "\"") + valueAfterJson))])
7171 }
7272
7373
7474
7575 @Callable(i)
7676 func testGet (json,key) = WriteSet([DataEntry("json", get(json, key))])
7777
7878
7979
8080 @Callable(i)
8181 func testGetValueString (json,key) = WriteSet([DataEntry("json", getValueString(get(json, key)))])
8282
8383
8484
8585 @Callable(i)
8686 func testGetValueInt (json,key) = WriteSet([DataEntry("json", getValueInt(get(json, key)))])
8787
8888
8989
9090 @Callable(i)
9191 func testGetValueBool (json,key) = WriteSet([DataEntry("json", getValueBool(get(json, key)))])
9292
9393

github/deemru/w8io/169f3d6 
45.50 ms