tx · Hhk7XyZZboR7wgnbFvNwVigMmeGokek8jSQ13eAbGs3X 3MwsyDjSTFfcbxaGnwD9YLMMfXSu4K74HT9: -0.01000000 Waves 2022.10.17 10:46 [2276085] smart account 3MwsyDjSTFfcbxaGnwD9YLMMfXSu4K74HT9 > SELF 0.00000000 Waves
{ "type": 13, "id": "Hhk7XyZZboR7wgnbFvNwVigMmeGokek8jSQ13eAbGs3X", "fee": 1000000, "feeAssetId": null, "timestamp": 1665992836002, "version": 2, "chainId": 84, "sender": "3MwsyDjSTFfcbxaGnwD9YLMMfXSu4K74HT9", "senderPublicKey": "GHzeUfgWYiY8LV58fLjiRxKduWQNTnNVgEHW8jQ6e6Kx", "proofs": [ "2mZAxsjbQG4rScsNoRMe1JMWfH3aYXp7GWQB19WB47J2Zb4M3WEks93nt45TLk2kGe5FH3nqjsnHon6oDPYtLpXP" ], "script": "base64:AAIFAAAAAAAAAA0IAhIDCgEIEgQKAggIAAAACQEAAAAQZ2V0U3RyaW5nT3JUaHJvdwAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADENhbid0IHJlYWQgJwUAAAADa2V5AgAAAA0nIGF0IGFkZHJlc3MgCQAEJQAAAAEFAAAAB2FkZHJlc3MBAAAAE3BhcnNlQWRkcmVzc09yVGhyb3cAAAABAAAADG1heWJlQWRkcmVzcwkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEJgAAAAEFAAAADG1heWJlQWRkcmVzcwkAASwAAAACCQABLAAAAAICAAAAGkNhbid0IHBhcnNlIGFkZHJlc3MgZnJvbSAnBQAAAAxtYXliZUFkZHJlc3MCAAAAAScAAAAADGtleV9yZWdpc3RyeQIAAAAIcmVnaXN0cnkAAAAACHJlZ2lzdHJ5CQEAAAATcGFyc2VBZGRyZXNzT3JU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wCQAFFAAAAAICAAAABGFkZHIJAARMAAAAAgkBAAAABXZhbHVlAAAAAQUAAAAKcmVzdExhYmVscwUAAAADbmlsCQAFFAAAAAIFAAAABHVuaXQFAAAABHVuaXQEAAAADGNhbGxGdW5jdGlvbggFAAAACyR0MDIwNjcyMjA1AAAAAl8xBAAAAAhjYWxsQXJncwgFAAAACyR0MDIwNjcyMjA1AAAAAl8yBAAAABFzdXBwb3J0c0ludGVyZmFjZQMJAQAAAAEhAAAAAQkBAAAACWlzRGVmaW5lZAAAAAEFAAAACHJlc29sdmVyBwQAAAAHJG1hdGNoMAkAA/wAAAAECQEAAAAFdmFsdWUAAAABBQAAAAhyZXNvbHZlcgIAAAARc3VwcG9ydHNJbnRlcmZhY2UJAARMAAAAAgUAAAAIY2FsbERhdGEFAAAAA25pbAUAAAADbmlsAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAdCb29sZWFuBAAAABFzdXBwb3J0c0ludGVyZmFjZQUAAAAHJG1hdGNoMAUAAAARc3VwcG9ydHNJbnRlcmZhY2UHCQAFFAAAAAIFAAAAA25pbAMJAQAAAAEhAAAAAQUAAAARc3VwcG9ydHNJbnRlcmZhY2UFAAAABHVuaXQEAAAAByRtYXRjaDAJAAP8AAAABAkBAAAABXZhbHVlAAAAAQUAAAAIcmVzb2x2ZXIJAQAAAAV2YWx1ZQAAAAEFAAAADGNhbGxGdW5jdGlvbgkBAAAABXZhbHVlAAAAAQUAAAAIY2FsbEFyZ3MFAAAAA25pbAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAxjYWxsYmFja0RhdGEFAAAAByRtYXRjaDAFAAAADGNhbGxiYWNrRGF0YQUAAAAEdW5pdAAAAACk0o67", "height": 2276085, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8JvyTW3wVX82zCbdfYYgwDr5eTVTaaPEm4j9qHULcX6T Next: F9oy23qeeg4k934Qbh1VwPBqbBBeWq2kjTZPLRVggoBq Diff:
Old | New | Differences | |
---|---|---|---|
35 | 35 | let $t012401291 = _splitLastLabel(name) | |
36 | 36 | let lastLabel = $t012401291._1 | |
37 | 37 | let restLabels = $t012401291._2 | |
38 | - | match invoke(registry, "resolver", [lastLabel], nil) { | |
39 | - | case resolverAddress: String => | |
40 | - | $Tuple2(addressFromString(resolverAddress), restLabels) | |
41 | - | case _ => | |
42 | - | $Tuple2(unit, name) | |
43 | - | } | |
38 | + | if ((size(restLabels) == 0)) | |
39 | + | then $Tuple2(unit, name) | |
40 | + | else match invoke(registry, "resolver", [lastLabel], nil) { | |
41 | + | case resolverAddress: String => | |
42 | + | $Tuple2(addressFromString(resolverAddress), restLabels) | |
43 | + | case _ => | |
44 | + | $Tuple2(unit, name) | |
45 | + | } | |
44 | 46 | } | |
45 | 47 | ||
46 | 48 | ||
50 | 52 | ||
51 | 53 | ||
52 | 54 | @Callable(inv) | |
53 | - | func resolve (name) = valueOrElse(modifiers([if ((size(name) > 0)) | |
55 | + | func resolve (name,callData) = valueOrElse(modifiers([if ((size(name) > 0)) | |
54 | 56 | then unit | |
55 | - | else throw("Name cannot be empty")]), { | |
56 | - | let $t018561904 = _findResolver(name) | |
57 | - | let resolver = $t018561904._1 | |
58 | - | let restLabels = $t018561904._2 | |
59 | - | if (if (!(isDefined(resolver))) | |
60 | - | then true | |
61 | - | else (size(restLabels) == 0)) | |
62 | - | then $Tuple2(nil, unit) | |
63 | - | else $Tuple2(nil, match invoke(value(resolver), "resolve", [value(restLabels)], nil) { | |
57 | + | else throw("Name cannot be empty"), if ((size(callData) > 0)) | |
58 | + | then unit | |
59 | + | else throw("Call data cannot be empty")]), { | |
60 | + | let $t020132061 = _findResolver(name) | |
61 | + | let resolver = $t020132061._1 | |
62 | + | let restLabels = $t020132061._2 | |
63 | + | let $t020672205 = match callData { | |
64 | + | case _ => | |
65 | + | if (("addr" == $match0)) | |
66 | + | then $Tuple2("addr", [value(restLabels)]) | |
67 | + | else $Tuple2(unit, unit) | |
68 | + | } | |
69 | + | let callFunction = $t020672205._1 | |
70 | + | let callArgs = $t020672205._2 | |
71 | + | let supportsInterface = if (!(isDefined(resolver))) | |
72 | + | then false | |
73 | + | else match invoke(value(resolver), "supportsInterface", [callData], nil) { | |
74 | + | case supportsInterface: Boolean => | |
75 | + | supportsInterface | |
76 | + | case _ => | |
77 | + | false | |
78 | + | } | |
79 | + | $Tuple2(nil, if (!(supportsInterface)) | |
80 | + | then unit | |
81 | + | else match invoke(value(resolver), value(callFunction), value(callArgs), nil) { | |
64 | 82 | case callbackData: String => | |
65 | 83 | callbackData | |
66 | 84 | case _ => | |
69 | 87 | }) | |
70 | 88 | ||
71 | 89 | ||
72 | - | ||
73 | - | @Callable(inv) | |
74 | - | func whoIs (name) = valueOrElse(modifiers([if ((size(name) > 0)) | |
75 | - | then unit | |
76 | - | else throw("Name cannot be empty")]), { | |
77 | - | let $t024252473 = _findResolver(name) | |
78 | - | let resolver = $t024252473._1 | |
79 | - | let restLabels = $t024252473._2 | |
80 | - | let lastLabel = _splitLastLabel(name)._1 | |
81 | - | let levelZeroRegistrant = match invoke(registry, "owner", [lastLabel], nil) { | |
82 | - | case owner: String => | |
83 | - | owner | |
84 | - | case _ => | |
85 | - | unit | |
86 | - | } | |
87 | - | let levelZeroResolver = match resolver { | |
88 | - | case address: Address => | |
89 | - | toString(address) | |
90 | - | case _ => | |
91 | - | unit | |
92 | - | } | |
93 | - | let levelZeroCreatedAt = match invoke(registry, "nameCreated", [lastLabel], nil) { | |
94 | - | case nameCreated: Int => | |
95 | - | nameCreated | |
96 | - | case _ => | |
97 | - | unit | |
98 | - | } | |
99 | - | let levelZeroStatus = if (isDefined(levelZeroRegistrant)) | |
100 | - | then "ACTIVE" | |
101 | - | else "NOT_REGISTERED" | |
102 | - | $Tuple2(nil, if (if (!(isDefined(resolver))) | |
103 | - | then true | |
104 | - | else (size(restLabels) == 0)) | |
105 | - | then $Tuple5(levelZeroRegistrant, levelZeroResolver, levelZeroCreatedAt, unit, levelZeroStatus) | |
106 | - | else match invoke(value(resolver), "whoIs", [value(restLabels)], nil) { | |
107 | - | case _ => | |
108 | - | if (if (if (if ($isInstanceOf($match0._1, "String")) | |
109 | - | then true | |
110 | - | else $isInstanceOf($match0._1, "Unit")) | |
111 | - | then if (if ($isInstanceOf($match0._2, "String")) | |
112 | - | then true | |
113 | - | else $isInstanceOf($match0._2, "Unit")) | |
114 | - | then if (if ($isInstanceOf($match0._3, "Int")) | |
115 | - | then true | |
116 | - | else $isInstanceOf($match0._3, "Unit")) | |
117 | - | then if (if ($isInstanceOf($match0._4, "Int")) | |
118 | - | then true | |
119 | - | else $isInstanceOf($match0._4, "Unit")) | |
120 | - | then if ($isInstanceOf($match0._5, "String")) | |
121 | - | then true | |
122 | - | else $isInstanceOf($match0._5, "Unit") | |
123 | - | else false | |
124 | - | else false | |
125 | - | else false | |
126 | - | else false) | |
127 | - | 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($match0, "(Unit, Unit, Unit, Unit, Unit)")) | |
128 | - | then true | |
129 | - | else $isInstanceOf($match0, "(Unit, Unit, Unit, Unit, String)")) | |
130 | - | then true | |
131 | - | else $isInstanceOf($match0, "(Unit, Unit, Unit, Int, Unit)")) | |
132 | - | then true | |
133 | - | else $isInstanceOf($match0, "(Unit, Unit, Unit, Int, String)")) | |
134 | - | then true | |
135 | - | else $isInstanceOf($match0, "(Unit, Unit, Int, Unit, Unit)")) | |
136 | - | then true | |
137 | - | else $isInstanceOf($match0, "(Unit, Unit, Int, Unit, String)")) | |
138 | - | then true | |
139 | - | else $isInstanceOf($match0, "(Unit, Unit, Int, Int, Unit)")) | |
140 | - | then true | |
141 | - | else $isInstanceOf($match0, "(Unit, Unit, Int, Int, String)")) | |
142 | - | then true | |
143 | - | else $isInstanceOf($match0, "(Unit, String, Unit, Unit, Unit)")) | |
144 | - | then true | |
145 | - | else $isInstanceOf($match0, "(Unit, String, Unit, Unit, String)")) | |
146 | - | then true | |
147 | - | else $isInstanceOf($match0, "(Unit, String, Unit, Int, Unit)")) | |
148 | - | then true | |
149 | - | else $isInstanceOf($match0, "(Unit, String, Unit, Int, String)")) | |
150 | - | then true | |
151 | - | else $isInstanceOf($match0, "(Unit, String, Int, Unit, Unit)")) | |
152 | - | then true | |
153 | - | else $isInstanceOf($match0, "(Unit, String, Int, Unit, String)")) | |
154 | - | then true | |
155 | - | else $isInstanceOf($match0, "(Unit, String, Int, Int, Unit)")) | |
156 | - | then true | |
157 | - | else $isInstanceOf($match0, "(Unit, String, Int, Int, String)")) | |
158 | - | then true | |
159 | - | else $isInstanceOf($match0, "(String, Unit, Unit, Unit, Unit)")) | |
160 | - | then true | |
161 | - | else $isInstanceOf($match0, "(String, Unit, Unit, Unit, String)")) | |
162 | - | then true | |
163 | - | else $isInstanceOf($match0, "(String, Unit, Unit, Int, Unit)")) | |
164 | - | then true | |
165 | - | else $isInstanceOf($match0, "(String, Unit, Unit, Int, String)")) | |
166 | - | then true | |
167 | - | else $isInstanceOf($match0, "(String, Unit, Int, Unit, Unit)")) | |
168 | - | then true | |
169 | - | else $isInstanceOf($match0, "(String, Unit, Int, Unit, String)")) | |
170 | - | then true | |
171 | - | else $isInstanceOf($match0, "(String, Unit, Int, Int, Unit)")) | |
172 | - | then true | |
173 | - | else $isInstanceOf($match0, "(String, Unit, Int, Int, String)")) | |
174 | - | then true | |
175 | - | else $isInstanceOf($match0, "(String, String, Unit, Unit, Unit)")) | |
176 | - | then true | |
177 | - | else $isInstanceOf($match0, "(String, String, Unit, Unit, String)")) | |
178 | - | then true | |
179 | - | else $isInstanceOf($match0, "(String, String, Unit, Int, Unit)")) | |
180 | - | then true | |
181 | - | else $isInstanceOf($match0, "(String, String, Unit, Int, String)")) | |
182 | - | then true | |
183 | - | else $isInstanceOf($match0, "(String, String, Int, Unit, Unit)")) | |
184 | - | then true | |
185 | - | else $isInstanceOf($match0, "(String, String, Int, Unit, String)")) | |
186 | - | then true | |
187 | - | else $isInstanceOf($match0, "(String, String, Int, Int, Unit)")) | |
188 | - | then true | |
189 | - | else $isInstanceOf($match0, "(String, String, Int, Int, String)") | |
190 | - | else false) | |
191 | - | then { | |
192 | - | let registrant = $match0._1 | |
193 | - | let resolver_ = $match0._2 | |
194 | - | let nameCreated = $match0._3 | |
195 | - | let nameExpires = $match0._4 | |
196 | - | let status = $match0._5 | |
197 | - | $Tuple5(registrant, resolver_, nameCreated, nameExpires, status) | |
198 | - | } | |
199 | - | else $Tuple5(unit, toString(value(resolver)), unit, unit, "UNKNOWN") | |
200 | - | }) | |
201 | - | }) | |
202 | - | ||
203 | - |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getStringOrThrow (address,key) = valueOrErrorMessage(getString(address, key), ((("Can't read '" + key) + "' at address ") + toString(address))) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func parseAddressOrThrow (maybeAddress) = valueOrErrorMessage(addressFromString(maybeAddress), (("Can't parse address from '" + maybeAddress) + "'")) | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | let key_registry = "registry" | |
11 | 11 | ||
12 | 12 | let registry = parseAddressOrThrow(getStringOrThrow(this, key_registry)) | |
13 | 13 | ||
14 | 14 | func isAdmin (inv) = (inv.caller == this) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func modifiers (validations) = unit | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func onlyAdmin (inv) = if (isAdmin(inv)) | |
21 | 21 | then unit | |
22 | 22 | else throw("Permission denied") | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func _splitLastLabel (name) = { | |
26 | 26 | let labels = split(name, ".") | |
27 | 27 | let lastIndex = (size(labels) - 1) | |
28 | 28 | let lastLabel = labels[lastIndex] | |
29 | 29 | let restLabels = makeString(removeByIndex(labels, lastIndex), ".") | |
30 | 30 | $Tuple2(lastLabel, restLabels) | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func _findResolver (name) = { | |
35 | 35 | let $t012401291 = _splitLastLabel(name) | |
36 | 36 | let lastLabel = $t012401291._1 | |
37 | 37 | let restLabels = $t012401291._2 | |
38 | - | match invoke(registry, "resolver", [lastLabel], nil) { | |
39 | - | case resolverAddress: String => | |
40 | - | $Tuple2(addressFromString(resolverAddress), restLabels) | |
41 | - | case _ => | |
42 | - | $Tuple2(unit, name) | |
43 | - | } | |
38 | + | if ((size(restLabels) == 0)) | |
39 | + | then $Tuple2(unit, name) | |
40 | + | else match invoke(registry, "resolver", [lastLabel], nil) { | |
41 | + | case resolverAddress: String => | |
42 | + | $Tuple2(addressFromString(resolverAddress), restLabels) | |
43 | + | case _ => | |
44 | + | $Tuple2(unit, name) | |
45 | + | } | |
44 | 46 | } | |
45 | 47 | ||
46 | 48 | ||
47 | 49 | @Callable(inv) | |
48 | 50 | func init (registryAddress) = valueOrElse(modifiers([onlyAdmin(inv)]), [StringEntry(key_registry, registryAddress)]) | |
49 | 51 | ||
50 | 52 | ||
51 | 53 | ||
52 | 54 | @Callable(inv) | |
53 | - | func resolve (name) = valueOrElse(modifiers([if ((size(name) > 0)) | |
55 | + | func resolve (name,callData) = valueOrElse(modifiers([if ((size(name) > 0)) | |
54 | 56 | then unit | |
55 | - | else throw("Name cannot be empty")]), { | |
56 | - | let $t018561904 = _findResolver(name) | |
57 | - | let resolver = $t018561904._1 | |
58 | - | let restLabels = $t018561904._2 | |
59 | - | if (if (!(isDefined(resolver))) | |
60 | - | then true | |
61 | - | else (size(restLabels) == 0)) | |
62 | - | then $Tuple2(nil, unit) | |
63 | - | else $Tuple2(nil, match invoke(value(resolver), "resolve", [value(restLabels)], nil) { | |
57 | + | else throw("Name cannot be empty"), if ((size(callData) > 0)) | |
58 | + | then unit | |
59 | + | else throw("Call data cannot be empty")]), { | |
60 | + | let $t020132061 = _findResolver(name) | |
61 | + | let resolver = $t020132061._1 | |
62 | + | let restLabels = $t020132061._2 | |
63 | + | let $t020672205 = match callData { | |
64 | + | case _ => | |
65 | + | if (("addr" == $match0)) | |
66 | + | then $Tuple2("addr", [value(restLabels)]) | |
67 | + | else $Tuple2(unit, unit) | |
68 | + | } | |
69 | + | let callFunction = $t020672205._1 | |
70 | + | let callArgs = $t020672205._2 | |
71 | + | let supportsInterface = if (!(isDefined(resolver))) | |
72 | + | then false | |
73 | + | else match invoke(value(resolver), "supportsInterface", [callData], nil) { | |
74 | + | case supportsInterface: Boolean => | |
75 | + | supportsInterface | |
76 | + | case _ => | |
77 | + | false | |
78 | + | } | |
79 | + | $Tuple2(nil, if (!(supportsInterface)) | |
80 | + | then unit | |
81 | + | else match invoke(value(resolver), value(callFunction), value(callArgs), nil) { | |
64 | 82 | case callbackData: String => | |
65 | 83 | callbackData | |
66 | 84 | case _ => | |
67 | 85 | unit | |
68 | 86 | }) | |
69 | 87 | }) | |
70 | 88 | ||
71 | 89 | ||
72 | - | ||
73 | - | @Callable(inv) | |
74 | - | func whoIs (name) = valueOrElse(modifiers([if ((size(name) > 0)) | |
75 | - | then unit | |
76 | - | else throw("Name cannot be empty")]), { | |
77 | - | let $t024252473 = _findResolver(name) | |
78 | - | let resolver = $t024252473._1 | |
79 | - | let restLabels = $t024252473._2 | |
80 | - | let lastLabel = _splitLastLabel(name)._1 | |
81 | - | let levelZeroRegistrant = match invoke(registry, "owner", [lastLabel], nil) { | |
82 | - | case owner: String => | |
83 | - | owner | |
84 | - | case _ => | |
85 | - | unit | |
86 | - | } | |
87 | - | let levelZeroResolver = match resolver { | |
88 | - | case address: Address => | |
89 | - | toString(address) | |
90 | - | case _ => | |
91 | - | unit | |
92 | - | } | |
93 | - | let levelZeroCreatedAt = match invoke(registry, "nameCreated", [lastLabel], nil) { | |
94 | - | case nameCreated: Int => | |
95 | - | nameCreated | |
96 | - | case _ => | |
97 | - | unit | |
98 | - | } | |
99 | - | let levelZeroStatus = if (isDefined(levelZeroRegistrant)) | |
100 | - | then "ACTIVE" | |
101 | - | else "NOT_REGISTERED" | |
102 | - | $Tuple2(nil, if (if (!(isDefined(resolver))) | |
103 | - | then true | |
104 | - | else (size(restLabels) == 0)) | |
105 | - | then $Tuple5(levelZeroRegistrant, levelZeroResolver, levelZeroCreatedAt, unit, levelZeroStatus) | |
106 | - | else match invoke(value(resolver), "whoIs", [value(restLabels)], nil) { | |
107 | - | case _ => | |
108 | - | if (if (if (if ($isInstanceOf($match0._1, "String")) | |
109 | - | then true | |
110 | - | else $isInstanceOf($match0._1, "Unit")) | |
111 | - | then if (if ($isInstanceOf($match0._2, "String")) | |
112 | - | then true | |
113 | - | else $isInstanceOf($match0._2, "Unit")) | |
114 | - | then if (if ($isInstanceOf($match0._3, "Int")) | |
115 | - | then true | |
116 | - | else $isInstanceOf($match0._3, "Unit")) | |
117 | - | then if (if ($isInstanceOf($match0._4, "Int")) | |
118 | - | then true | |
119 | - | else $isInstanceOf($match0._4, "Unit")) | |
120 | - | then if ($isInstanceOf($match0._5, "String")) | |
121 | - | then true | |
122 | - | else $isInstanceOf($match0._5, "Unit") | |
123 | - | else false | |
124 | - | else false | |
125 | - | else false | |
126 | - | else false) | |
127 | - | 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($match0, "(Unit, Unit, Unit, Unit, Unit)")) | |
128 | - | then true | |
129 | - | else $isInstanceOf($match0, "(Unit, Unit, Unit, Unit, String)")) | |
130 | - | then true | |
131 | - | else $isInstanceOf($match0, "(Unit, Unit, Unit, Int, Unit)")) | |
132 | - | then true | |
133 | - | else $isInstanceOf($match0, "(Unit, Unit, Unit, Int, String)")) | |
134 | - | then true | |
135 | - | else $isInstanceOf($match0, "(Unit, Unit, Int, Unit, Unit)")) | |
136 | - | then true | |
137 | - | else $isInstanceOf($match0, "(Unit, Unit, Int, Unit, String)")) | |
138 | - | then true | |
139 | - | else $isInstanceOf($match0, "(Unit, Unit, Int, Int, Unit)")) | |
140 | - | then true | |
141 | - | else $isInstanceOf($match0, "(Unit, Unit, Int, Int, String)")) | |
142 | - | then true | |
143 | - | else $isInstanceOf($match0, "(Unit, String, Unit, Unit, Unit)")) | |
144 | - | then true | |
145 | - | else $isInstanceOf($match0, "(Unit, String, Unit, Unit, String)")) | |
146 | - | then true | |
147 | - | else $isInstanceOf($match0, "(Unit, String, Unit, Int, Unit)")) | |
148 | - | then true | |
149 | - | else $isInstanceOf($match0, "(Unit, String, Unit, Int, String)")) | |
150 | - | then true | |
151 | - | else $isInstanceOf($match0, "(Unit, String, Int, Unit, Unit)")) | |
152 | - | then true | |
153 | - | else $isInstanceOf($match0, "(Unit, String, Int, Unit, String)")) | |
154 | - | then true | |
155 | - | else $isInstanceOf($match0, "(Unit, String, Int, Int, Unit)")) | |
156 | - | then true | |
157 | - | else $isInstanceOf($match0, "(Unit, String, Int, Int, String)")) | |
158 | - | then true | |
159 | - | else $isInstanceOf($match0, "(String, Unit, Unit, Unit, Unit)")) | |
160 | - | then true | |
161 | - | else $isInstanceOf($match0, "(String, Unit, Unit, Unit, String)")) | |
162 | - | then true | |
163 | - | else $isInstanceOf($match0, "(String, Unit, Unit, Int, Unit)")) | |
164 | - | then true | |
165 | - | else $isInstanceOf($match0, "(String, Unit, Unit, Int, String)")) | |
166 | - | then true | |
167 | - | else $isInstanceOf($match0, "(String, Unit, Int, Unit, Unit)")) | |
168 | - | then true | |
169 | - | else $isInstanceOf($match0, "(String, Unit, Int, Unit, String)")) | |
170 | - | then true | |
171 | - | else $isInstanceOf($match0, "(String, Unit, Int, Int, Unit)")) | |
172 | - | then true | |
173 | - | else $isInstanceOf($match0, "(String, Unit, Int, Int, String)")) | |
174 | - | then true | |
175 | - | else $isInstanceOf($match0, "(String, String, Unit, Unit, Unit)")) | |
176 | - | then true | |
177 | - | else $isInstanceOf($match0, "(String, String, Unit, Unit, String)")) | |
178 | - | then true | |
179 | - | else $isInstanceOf($match0, "(String, String, Unit, Int, Unit)")) | |
180 | - | then true | |
181 | - | else $isInstanceOf($match0, "(String, String, Unit, Int, String)")) | |
182 | - | then true | |
183 | - | else $isInstanceOf($match0, "(String, String, Int, Unit, Unit)")) | |
184 | - | then true | |
185 | - | else $isInstanceOf($match0, "(String, String, Int, Unit, String)")) | |
186 | - | then true | |
187 | - | else $isInstanceOf($match0, "(String, String, Int, Int, Unit)")) | |
188 | - | then true | |
189 | - | else $isInstanceOf($match0, "(String, String, Int, Int, String)") | |
190 | - | else false) | |
191 | - | then { | |
192 | - | let registrant = $match0._1 | |
193 | - | let resolver_ = $match0._2 | |
194 | - | let nameCreated = $match0._3 | |
195 | - | let nameExpires = $match0._4 | |
196 | - | let status = $match0._5 | |
197 | - | $Tuple5(registrant, resolver_, nameCreated, nameExpires, status) | |
198 | - | } | |
199 | - | else $Tuple5(unit, toString(value(resolver)), unit, unit, "UNKNOWN") | |
200 | - | }) | |
201 | - | }) | |
202 | - | ||
203 | - |
github/deemru/w8io/169f3d6 63.25 ms ◑