tx · BYtyTALN5L4TbLreTVuw4wpwNRCh9Jz8eCLTT7tToNJa 3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw: -0.00600000 Waves 2022.10.09 19:37 [2265040] smart account 3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw > SELF 0.00000000 Waves
{ "type": 13, "id": "BYtyTALN5L4TbLreTVuw4wpwNRCh9Jz8eCLTT7tToNJa", "fee": 600000, "feeAssetId": null, "timestamp": 1665333478321, "version": 2, "chainId": 84, "sender": "3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw", "senderPublicKey": "6NSakbUsm1WyESQ8yj3qpc1kQUfHWNd5C6CHVpbs4X7c", "proofs": [ "5ipHWnwJYn5ewbeaUnEZzpe4yMrw4A6rP8EJdqmbfj4jDGNAG6m7eWvuf6X1XtMzWEXpQVFY8C3sxju4JfLjvZB4" ], "script": "base64:AAIFAAAAAAAAABEIAhIDCgEIEgMKAQgSAwoBCAAAAAkBAAAAEGdldFN0cmluZ09yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZXNzIAkABCUAAAABBQAAAAdhZGRyZXNzAQAAABNwYXJzZUFkZHJlc3NPclRocm93AAAAAQAAAAxtYXliZUFkZHJlc3MJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABCYAAAABBQAAAAxtYXliZUFkZHJlc3MJAAEsAAAAAgkAASwAAAACAgAAABpDYW4ndCBwYXJzZSBhZGRyZXNzIGZyb20gJwUAAAAMbWF5YmVBZGRyZXNzAgAAAAEnAAAAAAxrZXlfcmVnaXN0cnkCAAAACHJlZ2lzdHJ5AAAAAAhyZWdpc3RyeQkBAAAAE3BhcnNlQW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ckbWF0Y2gwAgAAACIoU3RyaW5nLCBTdHJpbmcsIEludCwgSW50LCBTdHJpbmcpBwQAAAAKcmVnaXN0cmFudAgFAAAAByRtYXRjaDAAAAACXzEEAAAACXJlc29sdmVyXwgFAAAAByRtYXRjaDAAAAACXzIEAAAAC25hbWVDcmVhdGVkCAUAAAAHJG1hdGNoMAAAAAJfMwQAAAALbmFtZUV4cGlyZXMIBQAAAAckbWF0Y2gwAAAAAl80BAAAAAZzdGF0dXMIBQAAAAckbWF0Y2gwAAAAAl81CQAFFwAAAAUFAAAACnJlZ2lzdHJhbnQFAAAACXJlc29sdmVyXwUAAAALbmFtZUNyZWF0ZWQFAAAAC25hbWVFeHBpcmVzBQAAAAZzdGF0dXMFAAAABHVuaXQAAAAAPhNtNw==", "height": 2265040, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5xLu7GNtupcgoiKdovcPZ4eXmvpS5MBkPdr3bWFb3oLM Next: BUHtPL4tZ2UWSHGuCutBE5MX58q25rTBdnx1H9bZcaPu Diff:
Old | New | Differences | |
---|---|---|---|
23 | 23 | ||
24 | 24 | ||
25 | 25 | func m (n) = { | |
26 | - | let o = invoke(g, "owner", [n], nil) | |
27 | - | if ($isInstanceOf(o, "String")) | |
26 | + | let o = split(n, ".") | |
27 | + | let p = (size(o) - 1) | |
28 | + | let q = o[p] | |
29 | + | let r = makeString(removeByIndex(o, p), ".") | |
30 | + | $Tuple2(q, r) | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | func s (n) = { | |
35 | + | let t = m(n) | |
36 | + | let q = t._1 | |
37 | + | let r = t._2 | |
38 | + | let u = invoke(g, "resolver", [q], nil) | |
39 | + | if ($isInstanceOf(u, "String")) | |
28 | 40 | then { | |
29 | - | let | |
30 | - | | |
41 | + | let v = u | |
42 | + | $Tuple2(addressFromString(v), r) | |
31 | 43 | } | |
32 | - | else unit | |
44 | + | else $Tuple2(unit, n) | |
33 | 45 | } | |
34 | 46 | ||
35 | 47 | ||
36 | 48 | @Callable(i) | |
37 | - | func init ( | |
49 | + | func init (w) = valueOrElse(j([l(i)]), [StringEntry(f, w)]) | |
38 | 50 | ||
39 | 51 | ||
40 | 52 | ||
41 | 53 | @Callable(i) | |
42 | - | func addr (n) = $Tuple2(nil, m(n)) | |
54 | + | func resolve (n) = valueOrElse(j([if ((size(n) > 0)) | |
55 | + | then unit | |
56 | + | else throw("Name cannot be empty")]), { | |
57 | + | let x = s(n) | |
58 | + | let y = x._1 | |
59 | + | let r = x._2 | |
60 | + | if (if (!(isDefined(y))) | |
61 | + | then true | |
62 | + | else (size(r) == 0)) | |
63 | + | then $Tuple2(nil, unit) | |
64 | + | else $Tuple2(nil, { | |
65 | + | let u = invoke(value(y), "resolve", [value(r)], nil) | |
66 | + | if ($isInstanceOf(u, "String")) | |
67 | + | then { | |
68 | + | let z = u | |
69 | + | z | |
70 | + | } | |
71 | + | else unit | |
72 | + | }) | |
73 | + | }) | |
43 | 74 | ||
44 | 75 | ||
45 | 76 | ||
46 | 77 | @Callable(i) | |
47 | - | func resolve (r) = { | |
48 | - | let s = if ((size(r) == 0)) | |
49 | - | then throw("Name cannot be empty") | |
50 | - | else split(r, ".") | |
51 | - | let t = s[(size(s) - 1)] | |
52 | - | $Tuple2(nil, m(t)) | |
53 | - | } | |
54 | - | ||
55 | - | ||
56 | - | ||
57 | - | @Callable(i) | |
58 | - | func whoIs (r) = valueOrElse(j([if ((size(r) > 0)) | |
78 | + | func whoIs (n) = valueOrElse(j([if ((size(n) > 0)) | |
59 | 79 | then unit | |
60 | 80 | else throw("Name cannot be empty")]), { | |
61 | - | let s = split(r, ".") | |
62 | - | let t = s[(size(s) - 1)] | |
63 | - | let u = { | |
64 | - | let o = invoke(g, "owner", [t], nil) | |
65 | - | if ($isInstanceOf(o, "String")) | |
81 | + | let A = s(n) | |
82 | + | let y = A._1 | |
83 | + | let r = A._2 | |
84 | + | let q = m(n)._1 | |
85 | + | let B = { | |
86 | + | let u = invoke(g, "owner", [q], nil) | |
87 | + | if ($isInstanceOf(u, "String")) | |
66 | 88 | then { | |
67 | - | let | |
68 | - | | |
89 | + | let C = u | |
90 | + | C | |
69 | 91 | } | |
70 | 92 | else unit | |
71 | 93 | } | |
72 | - | let v = unit | |
73 | - | let w = { | |
74 | - | let o = invoke(g, "nameCreated", [t], nil) | |
75 | - | if ($isInstanceOf(o, "Int")) | |
76 | - | then { | |
77 | - | let x = o | |
78 | - | x | |
79 | - | } | |
80 | - | else unit | |
81 | - | } | |
82 | - | let y = { | |
83 | - | let o = invoke(g, "nameExpires", [t], nil) | |
84 | - | if ($isInstanceOf(o, "Int")) | |
85 | - | then { | |
86 | - | let z = o | |
87 | - | z | |
88 | - | } | |
89 | - | else unit | |
90 | - | } | |
91 | - | let A = { | |
92 | - | let o = invoke(g, "nameStatus", [t], nil) | |
93 | - | if ($isInstanceOf(o, "String")) | |
94 | - | then { | |
95 | - | let B = o | |
96 | - | B | |
97 | - | } | |
98 | - | else unit | |
99 | - | } | |
100 | - | $Tuple2(nil, $Tuple5(u, v, w, y, A)) | |
94 | + | let D = if (isDefined(B)) | |
95 | + | then "ACTIVE" | |
96 | + | else "NOT_REGISTERED" | |
97 | + | if (if (!(isDefined(y))) | |
98 | + | then true | |
99 | + | else (size(r) == 0)) | |
100 | + | then $Tuple2(nil, $Tuple5(B, y, unit, unit, D)) | |
101 | + | else $Tuple2(nil, { | |
102 | + | let u = invoke(value(y), "whoIs", [value(r)], nil) | |
103 | + | if (if (if (if ($isInstanceOf(u._1, "String")) | |
104 | + | then true | |
105 | + | else $isInstanceOf(u._1, "Unit")) | |
106 | + | then if (if ($isInstanceOf(u._2, "String")) | |
107 | + | then true | |
108 | + | else $isInstanceOf(u._2, "Unit")) | |
109 | + | then if (if ($isInstanceOf(u._3, "Int")) | |
110 | + | then true | |
111 | + | else $isInstanceOf(u._3, "Unit")) | |
112 | + | then if (if ($isInstanceOf(u._4, "Int")) | |
113 | + | then true | |
114 | + | else $isInstanceOf(u._4, "Unit")) | |
115 | + | then if ($isInstanceOf(u._5, "String")) | |
116 | + | then true | |
117 | + | else $isInstanceOf(u._5, "Unit") | |
118 | + | else false | |
119 | + | else false | |
120 | + | else false | |
121 | + | else false) | |
122 | + | then if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ($isInstanceOf(u, "(Unit, Unit, Unit, Unit, Unit)")) | |
123 | + | then true | |
124 | + | else $isInstanceOf(u, "(Unit, Unit, Unit, Unit, String)")) | |
125 | + | then true | |
126 | + | else $isInstanceOf(u, "(Unit, Unit, Unit, Int, Unit)")) | |
127 | + | then true | |
128 | + | else $isInstanceOf(u, "(Unit, Unit, Unit, Int, String)")) | |
129 | + | then true | |
130 | + | else $isInstanceOf(u, "(Unit, Unit, Int, Unit, Unit)")) | |
131 | + | then true | |
132 | + | else $isInstanceOf(u, "(Unit, Unit, Int, Unit, String)")) | |
133 | + | then true | |
134 | + | else $isInstanceOf(u, "(Unit, Unit, Int, Int, Unit)")) | |
135 | + | then true | |
136 | + | else $isInstanceOf(u, "(Unit, Unit, Int, Int, String)")) | |
137 | + | then true | |
138 | + | else $isInstanceOf(u, "(Unit, String, Unit, Unit, Unit)")) | |
139 | + | then true | |
140 | + | else $isInstanceOf(u, "(Unit, String, Unit, Unit, String)")) | |
141 | + | then true | |
142 | + | else $isInstanceOf(u, "(Unit, String, Unit, Int, Unit)")) | |
143 | + | then true | |
144 | + | else $isInstanceOf(u, "(Unit, String, Unit, Int, String)")) | |
145 | + | then true | |
146 | + | else $isInstanceOf(u, "(Unit, String, Int, Unit, Unit)")) | |
147 | + | then true | |
148 | + | else $isInstanceOf(u, "(Unit, String, Int, Unit, String)")) | |
149 | + | then true | |
150 | + | else $isInstanceOf(u, "(Unit, String, Int, Int, Unit)")) | |
151 | + | then true | |
152 | + | else $isInstanceOf(u, "(Unit, String, Int, Int, String)")) | |
153 | + | then true | |
154 | + | else $isInstanceOf(u, "(String, Unit, Unit, Unit, Unit)")) | |
155 | + | then true | |
156 | + | else $isInstanceOf(u, "(String, Unit, Unit, Unit, String)")) | |
157 | + | then true | |
158 | + | else $isInstanceOf(u, "(String, Unit, Unit, Int, Unit)")) | |
159 | + | then true | |
160 | + | else $isInstanceOf(u, "(String, Unit, Unit, Int, String)")) | |
161 | + | then true | |
162 | + | else $isInstanceOf(u, "(String, Unit, Int, Unit, Unit)")) | |
163 | + | then true | |
164 | + | else $isInstanceOf(u, "(String, Unit, Int, Unit, String)")) | |
165 | + | then true | |
166 | + | else $isInstanceOf(u, "(String, Unit, Int, Int, Unit)")) | |
167 | + | then true | |
168 | + | else $isInstanceOf(u, "(String, Unit, Int, Int, String)")) | |
169 | + | then true | |
170 | + | else $isInstanceOf(u, "(String, String, Unit, Unit, Unit)")) | |
171 | + | then true | |
172 | + | else $isInstanceOf(u, "(String, String, Unit, Unit, String)")) | |
173 | + | then true | |
174 | + | else $isInstanceOf(u, "(String, String, Unit, Int, Unit)")) | |
175 | + | then true | |
176 | + | else $isInstanceOf(u, "(String, String, Unit, Int, String)")) | |
177 | + | then true | |
178 | + | else $isInstanceOf(u, "(String, String, Int, Unit, Unit)")) | |
179 | + | then true | |
180 | + | else $isInstanceOf(u, "(String, String, Int, Unit, String)")) | |
181 | + | then true | |
182 | + | else $isInstanceOf(u, "(String, String, Int, Int, Unit)")) | |
183 | + | then true | |
184 | + | else $isInstanceOf(u, "(String, String, Int, Int, String)") | |
185 | + | else false) | |
186 | + | then { | |
187 | + | let E = u._1 | |
188 | + | let F = u._2 | |
189 | + | let G = u._3 | |
190 | + | let H = u._4 | |
191 | + | let I = u._5 | |
192 | + | $Tuple5(E, F, G, H, I) | |
193 | + | } | |
194 | + | else unit | |
195 | + | }) | |
101 | 196 | }) | |
102 | 197 | ||
103 | 198 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b,c) = valueOrErrorMessage(getString(b, c), ((("Can't read '" + c) + "' at address ") + toString(b))) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func d (e) = valueOrErrorMessage(addressFromString(e), (("Can't parse address from '" + e) + "'")) | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | let f = "registry" | |
11 | 11 | ||
12 | 12 | let g = d(a(this, f)) | |
13 | 13 | ||
14 | 14 | func h (i) = (i.caller == this) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func j (k) = unit | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func l (i) = if (h(i)) | |
21 | 21 | then unit | |
22 | 22 | else throw("Permission denied") | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func m (n) = { | |
26 | - | let o = invoke(g, "owner", [n], nil) | |
27 | - | if ($isInstanceOf(o, "String")) | |
26 | + | let o = split(n, ".") | |
27 | + | let p = (size(o) - 1) | |
28 | + | let q = o[p] | |
29 | + | let r = makeString(removeByIndex(o, p), ".") | |
30 | + | $Tuple2(q, r) | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | func s (n) = { | |
35 | + | let t = m(n) | |
36 | + | let q = t._1 | |
37 | + | let r = t._2 | |
38 | + | let u = invoke(g, "resolver", [q], nil) | |
39 | + | if ($isInstanceOf(u, "String")) | |
28 | 40 | then { | |
29 | - | let | |
30 | - | | |
41 | + | let v = u | |
42 | + | $Tuple2(addressFromString(v), r) | |
31 | 43 | } | |
32 | - | else unit | |
44 | + | else $Tuple2(unit, n) | |
33 | 45 | } | |
34 | 46 | ||
35 | 47 | ||
36 | 48 | @Callable(i) | |
37 | - | func init ( | |
49 | + | func init (w) = valueOrElse(j([l(i)]), [StringEntry(f, w)]) | |
38 | 50 | ||
39 | 51 | ||
40 | 52 | ||
41 | 53 | @Callable(i) | |
42 | - | func addr (n) = $Tuple2(nil, m(n)) | |
54 | + | func resolve (n) = valueOrElse(j([if ((size(n) > 0)) | |
55 | + | then unit | |
56 | + | else throw("Name cannot be empty")]), { | |
57 | + | let x = s(n) | |
58 | + | let y = x._1 | |
59 | + | let r = x._2 | |
60 | + | if (if (!(isDefined(y))) | |
61 | + | then true | |
62 | + | else (size(r) == 0)) | |
63 | + | then $Tuple2(nil, unit) | |
64 | + | else $Tuple2(nil, { | |
65 | + | let u = invoke(value(y), "resolve", [value(r)], nil) | |
66 | + | if ($isInstanceOf(u, "String")) | |
67 | + | then { | |
68 | + | let z = u | |
69 | + | z | |
70 | + | } | |
71 | + | else unit | |
72 | + | }) | |
73 | + | }) | |
43 | 74 | ||
44 | 75 | ||
45 | 76 | ||
46 | 77 | @Callable(i) | |
47 | - | func resolve (r) = { | |
48 | - | let s = if ((size(r) == 0)) | |
49 | - | then throw("Name cannot be empty") | |
50 | - | else split(r, ".") | |
51 | - | let t = s[(size(s) - 1)] | |
52 | - | $Tuple2(nil, m(t)) | |
53 | - | } | |
54 | - | ||
55 | - | ||
56 | - | ||
57 | - | @Callable(i) | |
58 | - | func whoIs (r) = valueOrElse(j([if ((size(r) > 0)) | |
78 | + | func whoIs (n) = valueOrElse(j([if ((size(n) > 0)) | |
59 | 79 | then unit | |
60 | 80 | else throw("Name cannot be empty")]), { | |
61 | - | let s = split(r, ".") | |
62 | - | let t = s[(size(s) - 1)] | |
63 | - | let u = { | |
64 | - | let o = invoke(g, "owner", [t], nil) | |
65 | - | if ($isInstanceOf(o, "String")) | |
81 | + | let A = s(n) | |
82 | + | let y = A._1 | |
83 | + | let r = A._2 | |
84 | + | let q = m(n)._1 | |
85 | + | let B = { | |
86 | + | let u = invoke(g, "owner", [q], nil) | |
87 | + | if ($isInstanceOf(u, "String")) | |
66 | 88 | then { | |
67 | - | let | |
68 | - | | |
89 | + | let C = u | |
90 | + | C | |
69 | 91 | } | |
70 | 92 | else unit | |
71 | 93 | } | |
72 | - | let v = unit | |
73 | - | let w = { | |
74 | - | let o = invoke(g, "nameCreated", [t], nil) | |
75 | - | if ($isInstanceOf(o, "Int")) | |
76 | - | then { | |
77 | - | let x = o | |
78 | - | x | |
79 | - | } | |
80 | - | else unit | |
81 | - | } | |
82 | - | let y = { | |
83 | - | let o = invoke(g, "nameExpires", [t], nil) | |
84 | - | if ($isInstanceOf(o, "Int")) | |
85 | - | then { | |
86 | - | let z = o | |
87 | - | z | |
88 | - | } | |
89 | - | else unit | |
90 | - | } | |
91 | - | let A = { | |
92 | - | let o = invoke(g, "nameStatus", [t], nil) | |
93 | - | if ($isInstanceOf(o, "String")) | |
94 | - | then { | |
95 | - | let B = o | |
96 | - | B | |
97 | - | } | |
98 | - | else unit | |
99 | - | } | |
100 | - | $Tuple2(nil, $Tuple5(u, v, w, y, A)) | |
94 | + | let D = if (isDefined(B)) | |
95 | + | then "ACTIVE" | |
96 | + | else "NOT_REGISTERED" | |
97 | + | if (if (!(isDefined(y))) | |
98 | + | then true | |
99 | + | else (size(r) == 0)) | |
100 | + | then $Tuple2(nil, $Tuple5(B, y, unit, unit, D)) | |
101 | + | else $Tuple2(nil, { | |
102 | + | let u = invoke(value(y), "whoIs", [value(r)], nil) | |
103 | + | if (if (if (if ($isInstanceOf(u._1, "String")) | |
104 | + | then true | |
105 | + | else $isInstanceOf(u._1, "Unit")) | |
106 | + | then if (if ($isInstanceOf(u._2, "String")) | |
107 | + | then true | |
108 | + | else $isInstanceOf(u._2, "Unit")) | |
109 | + | then if (if ($isInstanceOf(u._3, "Int")) | |
110 | + | then true | |
111 | + | else $isInstanceOf(u._3, "Unit")) | |
112 | + | then if (if ($isInstanceOf(u._4, "Int")) | |
113 | + | then true | |
114 | + | else $isInstanceOf(u._4, "Unit")) | |
115 | + | then if ($isInstanceOf(u._5, "String")) | |
116 | + | then true | |
117 | + | else $isInstanceOf(u._5, "Unit") | |
118 | + | else false | |
119 | + | else false | |
120 | + | else false | |
121 | + | else false) | |
122 | + | then if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ($isInstanceOf(u, "(Unit, Unit, Unit, Unit, Unit)")) | |
123 | + | then true | |
124 | + | else $isInstanceOf(u, "(Unit, Unit, Unit, Unit, String)")) | |
125 | + | then true | |
126 | + | else $isInstanceOf(u, "(Unit, Unit, Unit, Int, Unit)")) | |
127 | + | then true | |
128 | + | else $isInstanceOf(u, "(Unit, Unit, Unit, Int, String)")) | |
129 | + | then true | |
130 | + | else $isInstanceOf(u, "(Unit, Unit, Int, Unit, Unit)")) | |
131 | + | then true | |
132 | + | else $isInstanceOf(u, "(Unit, Unit, Int, Unit, String)")) | |
133 | + | then true | |
134 | + | else $isInstanceOf(u, "(Unit, Unit, Int, Int, Unit)")) | |
135 | + | then true | |
136 | + | else $isInstanceOf(u, "(Unit, Unit, Int, Int, String)")) | |
137 | + | then true | |
138 | + | else $isInstanceOf(u, "(Unit, String, Unit, Unit, Unit)")) | |
139 | + | then true | |
140 | + | else $isInstanceOf(u, "(Unit, String, Unit, Unit, String)")) | |
141 | + | then true | |
142 | + | else $isInstanceOf(u, "(Unit, String, Unit, Int, Unit)")) | |
143 | + | then true | |
144 | + | else $isInstanceOf(u, "(Unit, String, Unit, Int, String)")) | |
145 | + | then true | |
146 | + | else $isInstanceOf(u, "(Unit, String, Int, Unit, Unit)")) | |
147 | + | then true | |
148 | + | else $isInstanceOf(u, "(Unit, String, Int, Unit, String)")) | |
149 | + | then true | |
150 | + | else $isInstanceOf(u, "(Unit, String, Int, Int, Unit)")) | |
151 | + | then true | |
152 | + | else $isInstanceOf(u, "(Unit, String, Int, Int, String)")) | |
153 | + | then true | |
154 | + | else $isInstanceOf(u, "(String, Unit, Unit, Unit, Unit)")) | |
155 | + | then true | |
156 | + | else $isInstanceOf(u, "(String, Unit, Unit, Unit, String)")) | |
157 | + | then true | |
158 | + | else $isInstanceOf(u, "(String, Unit, Unit, Int, Unit)")) | |
159 | + | then true | |
160 | + | else $isInstanceOf(u, "(String, Unit, Unit, Int, String)")) | |
161 | + | then true | |
162 | + | else $isInstanceOf(u, "(String, Unit, Int, Unit, Unit)")) | |
163 | + | then true | |
164 | + | else $isInstanceOf(u, "(String, Unit, Int, Unit, String)")) | |
165 | + | then true | |
166 | + | else $isInstanceOf(u, "(String, Unit, Int, Int, Unit)")) | |
167 | + | then true | |
168 | + | else $isInstanceOf(u, "(String, Unit, Int, Int, String)")) | |
169 | + | then true | |
170 | + | else $isInstanceOf(u, "(String, String, Unit, Unit, Unit)")) | |
171 | + | then true | |
172 | + | else $isInstanceOf(u, "(String, String, Unit, Unit, String)")) | |
173 | + | then true | |
174 | + | else $isInstanceOf(u, "(String, String, Unit, Int, Unit)")) | |
175 | + | then true | |
176 | + | else $isInstanceOf(u, "(String, String, Unit, Int, String)")) | |
177 | + | then true | |
178 | + | else $isInstanceOf(u, "(String, String, Int, Unit, Unit)")) | |
179 | + | then true | |
180 | + | else $isInstanceOf(u, "(String, String, Int, Unit, String)")) | |
181 | + | then true | |
182 | + | else $isInstanceOf(u, "(String, String, Int, Int, Unit)")) | |
183 | + | then true | |
184 | + | else $isInstanceOf(u, "(String, String, Int, Int, String)") | |
185 | + | else false) | |
186 | + | then { | |
187 | + | let E = u._1 | |
188 | + | let F = u._2 | |
189 | + | let G = u._3 | |
190 | + | let H = u._4 | |
191 | + | let I = u._5 | |
192 | + | $Tuple5(E, F, G, H, I) | |
193 | + | } | |
194 | + | else unit | |
195 | + | }) | |
101 | 196 | }) | |
102 | 197 | ||
103 | 198 |
github/deemru/w8io/169f3d6 55.32 ms ◑