Skip to content

Commit 4c5d792

Browse files
authored
Merge pull request #79 from AlphaWallet/type-in-attribute
moving attributes' type definition into its own element
2 parents 2466280 + df8e621 commit 4c5d792

File tree

33 files changed

+461
-316
lines changed

33 files changed

+461
-316
lines changed

examples/ENS/ENS.xml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,18 @@
6767
<ts:string xml:lang="en">Records</ts:string>
6868
</ts:label>
6969

70-
<ts:attribute-type name="newRecordValue" syntax="1.3.6.1.4.1.1466.115.121.1.15">
70+
<ts:attribute name="newRecordValue">
71+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
7172
<ts:label>
7273
<ts:string xml:lang="en">new record value</ts:string>
7374
</ts:label>
7475
<ts:origins>
7576
<ts:user-entry as="utf8"/>
7677
</ts:origins>
77-
</ts:attribute-type>
78+
</ts:attribute>
7879

79-
<ts:attribute-type name="emailRecord" syntax="1.3.6.1.4.1.1466.115.121.1.15">
80+
<ts:attribute name="emailRecord">
81+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
8082
<ts:origins>
8183
<ethereum:call as="utf8" contract="PublicResolver" function="text">
8284
<ts:data>
@@ -85,7 +87,7 @@
8587
</ts:data>
8688
</ethereum:call>
8789
</ts:origins>
88-
</ts:attribute-type>
90+
</ts:attribute>
8991

9092
<ts:transaction>
9193
<ethereum:transaction function="setText" contract="PublicResolver" as="bool">
@@ -109,7 +111,8 @@
109111
<ts:string xml:lang="en">Renew</ts:string>
110112
</ts:label>
111113

112-
<ts:attribute-type name="renewalPricePerYear" syntax="1.3.6.1.4.1.1466.115.121.1.36">
114+
<ts:attribute name="renewalPricePerYear">
115+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.36</ts:syntax></ts:type>
113116
<ts:label>
114117
<ts:string xml:lang="en">renewal price per year</ts:string>
115118
</ts:label>
@@ -121,7 +124,7 @@
121124
</ts:data>
122125
</ethereum:call>
123126
</ts:origins>
124-
</ts:attribute-type>
127+
</ts:attribute>
125128

126129
<ts:transaction>
127130
<ethereum:transaction function="renew" contract="ETHRegistrarController" as="uint">
@@ -140,30 +143,33 @@
140143

141144
</ts:cards>
142145

143-
<ts:attribute-type name="ensName" syntax="1.3.6.1.4.1.1466.115.121.1.15">
146+
<ts:attribute name="ensName">
147+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
144148
<ts:origins>
145149
<ethereum:event module="NameRegistered" filter="label=${tokenId}" select="name"/>
146150
</ts:origins>
147-
</ts:attribute-type>
151+
</ts:attribute>
148152

149-
<ts:attribute-type name="nameExpires" syntax="1.3.6.1.4.1.1466.115.121.1.36">
153+
<ts:attribute name="nameExpires">
154+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.36</ts:syntax></ts:type>
150155
<ts:origins>
151156
<ethereum:call function="nameExpires" contract="ENS" as="uint">
152157
<ts:data>
153158
<ts:uint256 ref="tokenId"/>
154159
</ts:data>
155160
</ethereum:call>
156161
</ts:origins>
157-
</ts:attribute-type>
162+
</ts:attribute>
158163

159-
<ts:attribute-type name="resolverAddress" syntax="1.3.6.1.4.1.1466.115.121.1.15">
164+
<ts:attribute name="resolverAddress">
165+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
160166
<ts:origins>
161167
<ethereum:call function="resolver" contract="registry" as="address">
162168
<ts:data>
163169
<ts:bytes32 local-ref="nodeHash"/>
164170
</ts:data>
165171
</ethereum:call>
166172
</ts:origins>
167-
</ts:attribute-type>
173+
</ts:attribute>
168174

169175
</ts:token>

examples/EntryToken/EntryToken.xml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7575
</ts:view>
7676
</ts:card>
7777
</ts:cards>
78-
<ts:attribute-type name="locality" syntax="1.3.6.1.4.1.1466.115.121.1.15">
78+
<ts:attribute name="locality">
79+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
7980
<ts:origins>
8081
<ethereum:call function="getLocality" contract="EntryToken" as="utf8">
8182
<ts:data>
@@ -84,50 +85,55 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8485
</ethereum:call>
8586
</ts:origins>
8687

87-
</ts:attribute-type>
88-
<ts:attribute-type name="time" syntax="1.3.6.1.4.1.1466.115.121.1.24">
88+
</ts:attribute>
89+
<ts:attribute name="time">
90+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.24</ts:syntax></ts:type>
8991
<ts:label>
9092
<ts:string xml:lang="en">Time</ts:string>
9193
<ts:string xml:lang="zh">时间</ts:string>
9294
</ts:label>
9395
<ts:origins>
9496
<ts:token-id bitmask="0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000" as="utf8"/>
9597
</ts:origins>
96-
</ts:attribute-type>
97-
<ts:attribute-type name="expired" syntax="1.3.6.1.4.1.1466.115.121.1.7"> <!-- boolean -->
98+
</ts:attribute>
99+
<ts:attribute name="expired"> <!-- boolean -->
100+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.7</ts:syntax></ts:type>
98101
<ts:origins>
99102
<ethereum:call function="isExpired" contract="EntryToken" as="bool">
100103
<ts:data>
101104
<ts:uint256 ref="tokenId"/>
102105
</ts:data>
103106
</ethereum:call>
104107
</ts:origins>
105-
</ts:attribute-type>
106-
<ts:attribute-type name="street" syntax="1.3.6.1.4.1.1466.115.121.1.15"> <!-- string -->
108+
</ts:attribute>
109+
<ts:attribute name="street"> <!-- string -->
110+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
107111
<ts:origins>
108112
<ethereum:call function="getStreet" contract="EntryToken" as="utf8">
109113
<ts:data>
110114
<ts:uint256 ref="tokenId"/>
111115
</ts:data>
112116
</ethereum:call>
113117
</ts:origins>
114-
</ts:attribute-type>
115-
<ts:attribute-type name="building" syntax="1.3.6.1.4.1.1466.115.121.1.15"> <!-- string -->
118+
</ts:attribute>
119+
<ts:attribute name="building"> <!-- string -->
120+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
116121
<ts:origins>
117122
<ethereum:call function="getBuildingName" contract="EntryToken" as="utf8">
118123
<ts:data>
119124
<ts:uint256 ref="tokenId"/>
120125
</ts:data>
121126
</ethereum:call>
122127
</ts:origins>
123-
</ts:attribute-type>
124-
<ts:attribute-type name="state" syntax="1.3.6.1.4.1.1466.115.121.1.15"> <!-- string -->
128+
</ts:attribute>
129+
<ts:attribute name="state"> <!-- string -->
130+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
125131
<ts:origins>
126132
<ethereum:call function="getState" contract="EntryToken" as="utf8">
127133
<ts:data>
128134
<ts:uint256 ref="tokenId"/>
129135
</ts:data>
130136
</ethereum:call>
131137
</ts:origins>
132-
</ts:attribute-type>
138+
</ts:attribute>
133139
</ts:token>

examples/Karma/karma.xml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8282
</ts:view>
8383
</ts:card>
8484
</ts:cards>
85-
<ts:attribute-type name="locality" syntax="1.3.6.1.4.1.1466.115.121.1.15">
85+
<ts:attribute name="locality">
86+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
8687
<ts:origins>
8788
<ethereum:call function="getLocality" as="utf8" contract="CarToken">
8889
<ts:data>
@@ -91,50 +92,55 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9192
</ethereum:call>
9293
</ts:origins>
9394

94-
</ts:attribute-type>
95-
<ts:attribute-type name="time" syntax="1.3.6.1.4.1.1466.115.121.1.24">
95+
</ts:attribute>
96+
<ts:attribute name="time">
97+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.24</ts:syntax></ts:type>
9698
<ts:label>
9799
<ts:string xml:lang="en">Time</ts:string>
98100
<ts:string xml:lang="zh">时间</ts:string>
99101
</ts:label>
100102
<ts:origins>
101103
<ts:token-id as="utf8" bitmask="00000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"/>
102104
</ts:origins>
103-
</ts:attribute-type>
104-
<ts:attribute-type name="expired" syntax="1.3.6.1.4.1.1466.115.121.1.7"> <!-- boolean -->
105+
</ts:attribute>
106+
<ts:attribute name="expired"> <!-- boolean -->
107+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.7</ts:syntax></ts:type>
105108
<ts:origins>
106109
<ethereum:call function="isExpired" as="bool" contract="CarToken">
107110
<ts:data>
108111
<ts:uint256 ref="tokenId"/>
109112
</ts:data>
110113
</ethereum:call>
111114
</ts:origins>
112-
</ts:attribute-type>
113-
<ts:attribute-type name="model" syntax="1.3.6.1.4.1.1466.115.121.1.15"> <!-- string -->
115+
</ts:attribute>
116+
<ts:attribute name="model"> <!-- string -->
117+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
114118
<ts:origins>
115119
<ethereum:call function="getStreet" as="utf8" contract="CarToken">
116120
<ts:data>
117121
<ts:uint256 ref="tokenId"/>
118122
</ts:data>
119123
</ethereum:call>
120124
</ts:origins>
121-
</ts:attribute-type>
122-
<ts:attribute-type name="VIN" syntax="1.3.6.1.4.1.1466.115.121.1.15"> <!-- string -->
125+
</ts:attribute>
126+
<ts:attribute name="VIN"> <!-- string -->
127+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
123128
<ts:origins>
124129
<ethereum:call function="getBuildingName" as="utf8" contract="CarToken">
125130
<ts:data>
126131
<ts:uint256 ref="tokenId"/>
127132
</ts:data>
128133
</ethereum:call>
129134
</ts:origins>
130-
</ts:attribute-type>
131-
<ts:attribute-type name="state" syntax="1.3.6.1.4.1.1466.115.121.1.15"> <!-- string -->
135+
</ts:attribute>
136+
<ts:attribute name="state"> <!-- string -->
137+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
132138
<ts:origins>
133139
<ethereum:call function="getState" as="utf8" contract="CarToken">
134140
<ts:data>
135141
<ts:uint256 ref="tokenId"/>
136142
</ts:data>
137143
</ethereum:call>
138144
</ts:origins>
139-
</ts:attribute-type>
145+
</ts:attribute>
140146
</ts:token>

examples/UEFA/UEFA.xml

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5656
</ts:cards>
5757

5858

59-
<ts:attribute-type name="time" syntax="1.3.6.1.4.1.1466.115.121.1.24">
59+
<ts:attribute name="time">
60+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.24</ts:syntax></ts:type>
6061
<ts:label>
6162
<ts:string xml:lang="en">Time</ts:string>
6263
<ts:string xml:lang="zh">时间</ts:string>
@@ -65,9 +66,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6566
<ts:token-id bitmask="FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000" as="utf8">
6667
</ts:token-id>
6768
</ts:origins>
68-
</ts:attribute-type>
69+
</ts:attribute>
6970

70-
<ts:attribute-type name="locality" oid="2.5.4.7" syntax="1.3.6.1.4.1.1466.115.121.1.15">
71+
<ts:attribute name="locality" oid="2.5.4.7">
72+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
7173
<ts:label>
7274
<ts:string xml:lang="en">City</ts:string>
7375
<ts:string xml:lang="zh">城市</ts:string>
@@ -126,9 +128,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
126128
</ts:mapping>
127129
</ts:token-id>
128130
</ts:origins>
129-
</ts:attribute-type>
131+
</ts:attribute>
130132

131-
<ts:attribute-type name="venue" syntax="1.3.6.1.4.1.1466.115.121.1.15">
133+
<ts:attribute name="venue">
134+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
132135
<ts:label>
133136
<ts:string xml:lang="en">Venue</ts:string>
134137
</ts:label>
@@ -186,9 +189,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
186189
</ts:mapping>
187190
</ts:token-id>
188191
</ts:origins>
189-
</ts:attribute-type>
192+
</ts:attribute>
190193

191-
<ts:attribute-type name="countryA" syntax="1.3.6.1.4.1.1466.115.121.1.26">
194+
<ts:attribute name="countryA">
195+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.26</ts:syntax></ts:type>
192196
<!-- Intentionally avoid using countryName
193197
(SYNTAX 1.3.6.1.4.1.1466.115.121.1.11) per RFC 4519
194198
CountryName is two-characters long, not 3-characters.
@@ -200,29 +204,32 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
200204
<ts:origins>
201205
<ts:token-id bitmask="0000000000000000000000000000000000000000FFFFFF000000000000000000" as="utf8"/>
202206
</ts:origins>
203-
</ts:attribute-type>
207+
</ts:attribute>
204208

205-
<ts:attribute-type name="countryB" syntax="1.3.6.1.4.1.1466.115.121.1.26">
209+
<ts:attribute name="countryB">
210+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.26</ts:syntax></ts:type>
206211
<ts:label>
207212
<ts:string xml:lang="zh">球队 B</ts:string>
208213
<ts:string xml:lang="en">Team B</ts:string>
209214
</ts:label>
210215
<ts:origins>
211216
<ts:token-id bitmask="0000000000000000000000000000000000000000000000FFFFFF000000000000" as="utf8"/>
212217
</ts:origins>
213-
</ts:attribute-type>
218+
</ts:attribute>
214219

215-
<ts:attribute-type name="match" syntax="1.3.6.1.4.1.1466.115.121.1.27">
220+
<ts:attribute name="match">
221+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.27</ts:syntax></ts:type>
216222
<ts:label>
217223
<ts:string xml:lang="zh">比赛</ts:string>
218224
<ts:string xml:lang="en">Match</ts:string>
219225
</ts:label>
220226
<ts:origins>
221227
<ts:token-id bitmask="0000000000000000000000000000000000000000000000000000FF0000000000" as="utf8"/>
222228
</ts:origins>
223-
</ts:attribute-type>
229+
</ts:attribute>
224230

225-
<ts:attribute-type name="category" syntax="1.3.6.1.4.1.1466.115.121.1.15">
231+
<ts:attribute name="category">
232+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
226233
<ts:label>
227234
<ts:string xml:lang="zh">等级</ts:string>
228235
<ts:string xml:lang="en">Cat</ts:string>
@@ -249,18 +256,20 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
249256
</ts:mapping>
250257
</ts:token-id>
251258
</ts:origins>
252-
</ts:attribute-type>
259+
</ts:attribute>
253260

254-
<ts:attribute-type name="numero" syntax="1.3.6.1.4.1.1466.115.121.1.27">
261+
<ts:attribute name="numero">
262+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.27</ts:syntax></ts:type>
255263
<ts:label>
256264
<ts:string>№</ts:string>
257265
</ts:label>
258266
<ts:origins>
259267
<ts:token-id bitmask="00000000000000000000000000000000000000000000000000000000FFFF00" as="uint"/>
260268
</ts:origins>
261-
</ts:attribute-type>
269+
</ts:attribute>
262270

263-
<ts:attribute-type name="redeemed" syntax="1.3.6.1.4.1.1466.115.121.1.27">
271+
<ts:attribute name="redeemed">
272+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.27</ts:syntax></ts:type>
264273
<ts:label>
265274
<ts:string xml:lang="zh">已兑换</ts:string>
266275
<ts:string xml:lang="en">Redeemed</ts:string>
@@ -272,6 +281,6 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
272281
</ts:data>
273282
</ethereum:call>
274283
</ts:origins>
275-
</ts:attribute-type>
284+
</ts:attribute>
276285

277286
</ts:token>

examples/action/XDAI-bridge.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1414
<ts:string xml:lang="en">Convert to DAI</ts:string>
1515
<ts:string xml:lang="zh">將xDAI轉爲DAI</ts:string>
1616
</ts:label>
17-
<ts:attribute-type name="amount" syntax="1.3.6.1.4.1.1466.115.121.1.36">
17+
<ts:attribute name="amount">
18+
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.36</ts:syntax></ts:type>
1819
<ts:label>
1920
<ts:string xml:lang="en">Amount</ts:string>
2021
<ts:string xml:lang="zh">代幣金額</ts:string>
@@ -24,7 +25,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2425
rationale for hardcoding: avoiding over-design -->
2526
<ts:user-entry as="e18"/>
2627
</ts:origins>
27-
</ts:attribute-type>
28+
</ts:attribute>
2829
<!-- because this action has xdai as input, it should be listed as
2930
an action under XDAI's token view. -->
3031
<ts:input>

0 commit comments

Comments
 (0)