tx · 6uZxAZLecYiN59Mf9kgAmyUXQD1QXNZ71BuJhEfQpVrK 3NB5aspKqF3QnFUwAHVRq6vk6v2UqBGMMDy: -0.01000000 Waves 2022.02.09 10:45 [1915807] smart account 3NB5aspKqF3QnFUwAHVRq6vk6v2UqBGMMDy > SELF 0.00000000 Waves
{ "type": 13, "id": "6uZxAZLecYiN59Mf9kgAmyUXQD1QXNZ71BuJhEfQpVrK", "fee": 1000000, "feeAssetId": null, "timestamp": 1644392762171, "version": 2, "chainId": 84, "sender": "3NB5aspKqF3QnFUwAHVRq6vk6v2UqBGMMDy", "senderPublicKey": "4S8F79Me9f9R6fzGZZjKBNfF79og2MpdmnNgfxQpwNEF", "proofs": [ "2Q2NAgMoBn43XEvhpdzbNLuuFoaBBZ5qBp1Mr5ejHv4rSG5KWSbyFTu99x41GjLAFznaFxwUjWeVUMstFMmtPnjC" ], "script": "base64:AAIFAAAAAAAAABoIAhIECgIICBIDCgEIEgMKAQgSBAoCCBgSAAAAAAQAAAAACmVzdEVuQ291cnMCAAAACmVzdEVuQ291cnMAAAAADWNsYXNzZUVuQ291cnMCAAAADWNsYXNzZUVuQ291cnMAAAAAD25vZGVWYWxpZGF0cmljZQIAAAANdmFsaWRhdG9yTm9kZQEAAAAMZ2V0Q2xhc3NOYW1lAAAAAgAAAANub20AAAAKcHJvZmVzc2V1cgkAASwAAAACCQABLAAAAAIFAAAAA25vbQIAAAABXwkABCUAAAABBQAAAApwcm9mZXNzZXVyAAAABQAAAAFpAQAAABNjcmVhdGVPck1vZGlmeUNsYXNzAAAAAgAAAANub20AAAAGZWxldmVzCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAQAAAAxnZXRDbGFzc05hbWUAAAACBQAAAANub20IBQAAAAFpAAAABmNhbGxlcgUAAAAGZWxldmVzBQAAAANuaWwAAAABaQEAAAALZGVsZXRlQ2xhc3MAAAABAAAAA25vbQkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAAMZ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bkVudHJ5AAAAAgUAAAAKZXN0RW5Db3VycwYFAAAAA25pbAkAAAIAAAABAgAAABdJbmNvcnJlY3QgaW52b2tlIHJlc3VsdAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABaQEAAAAMYXJyZXRlckNvdXJzAAAAAAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACBQAAAA1jbGFzc2VFbkNvdXJzAgAAAAAJAARMAAAAAgkBAAAADEJvb2xlYW5FbnRyeQAAAAIFAAAACmVzdEVuQ291cnMHBQAAAANuaWwAAAAAO6VZEw==", "height": 1915807, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4kaotRMjVT8amCvF1AVBv4JujqcnRUuLUfimaUsZR2my Next: 3xVt2MPndzepGCPcokDPg1ZBfGGEzQ98ZgZHCvofZ3EA Diff:
Old | New | Differences | |
---|---|---|---|
8 | 8 | let nodeValidatrice = "validatorNode" | |
9 | 9 | ||
10 | 10 | func getClassName (nom,professeur) = ((nom + "_") + toString(professeur)) | |
11 | - | ||
12 | - | ||
13 | - | func validerEleve (acc,e) = { | |
14 | - | let studentAddress = addressFromStringValue(take(e, 35)) | |
15 | - | let studentStatus = takeRight(e, (size(e) - 34)) | |
16 | - | let res = invoke(studentAddress, "validationPresence", [studentStatus, getStringValue(nodeValidatrice)], nil) | |
17 | - | if ((res == res)) | |
18 | - | then true | |
19 | - | else throw("Strict value is not equal to itself.") | |
20 | - | } | |
21 | - | ||
22 | - | ||
23 | - | func testValid (e) = { | |
24 | - | let studentAddress = addressFromStringValue(take(e, 35)) | |
25 | - | let studentStatus = takeRight(e, (size(e) - 36)) | |
26 | - | unit | |
27 | - | } | |
28 | 11 | ||
29 | 12 | ||
30 | 13 | @Callable(i) | |
43 | 26 | ||
44 | 27 | ||
45 | 28 | @Callable(i) | |
46 | - | func faireAppel (classe,eleves) = { | |
47 | - | let leasedEtudiants = { | |
48 | - | let $l = eleves | |
49 | - | let $s = size($l) | |
50 | - | let $acc0 = nil | |
51 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
52 | - | then $a | |
53 | - | else validerEleve($a, $l[$i]) | |
54 | - | ||
55 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
56 | - | then $a | |
57 | - | else throw("List size exceeds 30") | |
58 | - | ||
59 | - | $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($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), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30) | |
60 | - | } | |
61 | - | [StringEntry(classeEnCours, getClassName(classe, i.caller)), BooleanEntry(estEnCours, true)] | |
62 | - | } | |
63 | - | ||
64 | - | ||
65 | - | ||
66 | - | @Callable(i) | |
67 | - | func faireAppelEleve () = { | |
68 | - | let res = invoke(addressFromStringValue("3N9bnBDbTLpgTYvhezFE8rSJyMEBBTH927Q"), "validationPresence", ["présent", getStringValue(nodeValidatrice)], nil) | |
29 | + | func faireAppelEleve (classe,adresses) = { | |
30 | + | let e = adresses[0] | |
31 | + | let list = removeByIndex(adresses, 0) | |
32 | + | let studentAddress = addressFromStringValue(take(e, 35)) | |
33 | + | let studentStatus = takeRight(e, (size(e) - 36)) | |
34 | + | let res = invoke(studentAddress, "validationPresence", [studentStatus, getStringValue(nodeValidatrice), list], nil) | |
69 | 35 | if ((res == res)) | |
70 | 36 | then match res { | |
71 | 37 | case t: Int => | |
72 | - | [ | |
38 | + | [StringEntry(classeEnCours, getClassName(classe, i.caller)), BooleanEntry(estEnCours, true)] | |
73 | 39 | case _ => | |
74 | 40 | throw("Incorrect invoke result") | |
75 | 41 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let estEnCours = "estEnCours" | |
5 | 5 | ||
6 | 6 | let classeEnCours = "classeEnCours" | |
7 | 7 | ||
8 | 8 | let nodeValidatrice = "validatorNode" | |
9 | 9 | ||
10 | 10 | func getClassName (nom,professeur) = ((nom + "_") + toString(professeur)) | |
11 | - | ||
12 | - | ||
13 | - | func validerEleve (acc,e) = { | |
14 | - | let studentAddress = addressFromStringValue(take(e, 35)) | |
15 | - | let studentStatus = takeRight(e, (size(e) - 34)) | |
16 | - | let res = invoke(studentAddress, "validationPresence", [studentStatus, getStringValue(nodeValidatrice)], nil) | |
17 | - | if ((res == res)) | |
18 | - | then true | |
19 | - | else throw("Strict value is not equal to itself.") | |
20 | - | } | |
21 | - | ||
22 | - | ||
23 | - | func testValid (e) = { | |
24 | - | let studentAddress = addressFromStringValue(take(e, 35)) | |
25 | - | let studentStatus = takeRight(e, (size(e) - 36)) | |
26 | - | unit | |
27 | - | } | |
28 | 11 | ||
29 | 12 | ||
30 | 13 | @Callable(i) | |
31 | 14 | func createOrModifyClass (nom,eleves) = [StringEntry(getClassName(nom, i.caller), eleves)] | |
32 | 15 | ||
33 | 16 | ||
34 | 17 | ||
35 | 18 | @Callable(i) | |
36 | 19 | func deleteClass (nom) = [DeleteEntry(getClassName(nom, i.caller))] | |
37 | 20 | ||
38 | 21 | ||
39 | 22 | ||
40 | 23 | @Callable(i) | |
41 | 24 | func ajouterValidateur (address) = [StringEntry(nodeValidatrice, address)] | |
42 | 25 | ||
43 | 26 | ||
44 | 27 | ||
45 | 28 | @Callable(i) | |
46 | - | func faireAppel (classe,eleves) = { | |
47 | - | let leasedEtudiants = { | |
48 | - | let $l = eleves | |
49 | - | let $s = size($l) | |
50 | - | let $acc0 = nil | |
51 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
52 | - | then $a | |
53 | - | else validerEleve($a, $l[$i]) | |
54 | - | ||
55 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
56 | - | then $a | |
57 | - | else throw("List size exceeds 30") | |
58 | - | ||
59 | - | $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($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), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30) | |
60 | - | } | |
61 | - | [StringEntry(classeEnCours, getClassName(classe, i.caller)), BooleanEntry(estEnCours, true)] | |
62 | - | } | |
63 | - | ||
64 | - | ||
65 | - | ||
66 | - | @Callable(i) | |
67 | - | func faireAppelEleve () = { | |
68 | - | let res = invoke(addressFromStringValue("3N9bnBDbTLpgTYvhezFE8rSJyMEBBTH927Q"), "validationPresence", ["présent", getStringValue(nodeValidatrice)], nil) | |
29 | + | func faireAppelEleve (classe,adresses) = { | |
30 | + | let e = adresses[0] | |
31 | + | let list = removeByIndex(adresses, 0) | |
32 | + | let studentAddress = addressFromStringValue(take(e, 35)) | |
33 | + | let studentStatus = takeRight(e, (size(e) - 36)) | |
34 | + | let res = invoke(studentAddress, "validationPresence", [studentStatus, getStringValue(nodeValidatrice), list], nil) | |
69 | 35 | if ((res == res)) | |
70 | 36 | then match res { | |
71 | 37 | case t: Int => | |
72 | - | [ | |
38 | + | [StringEntry(classeEnCours, getClassName(classe, i.caller)), BooleanEntry(estEnCours, true)] | |
73 | 39 | case _ => | |
74 | 40 | throw("Incorrect invoke result") | |
75 | 41 | } | |
76 | 42 | else throw("Strict value is not equal to itself.") | |
77 | 43 | } | |
78 | 44 | ||
79 | 45 | ||
80 | 46 | ||
81 | 47 | @Callable(i) | |
82 | 48 | func arreterCours () = [StringEntry(classeEnCours, ""), BooleanEntry(estEnCours, false)] | |
83 | 49 | ||
84 | 50 |
github/deemru/w8io/169f3d6 37.73 ms ◑