Skip to content

Commit d076ff6

Browse files
author
Weiwu Zhang
authored
Merge pull request #365 from AlphaWallet/correct-violation-of-rfc4912
RFC4912 required a <type> for a named type that defines a type
2 parents 746e7b5 + a632653 commit d076ff6

File tree

3 files changed

+64
-31
lines changed

3 files changed

+64
-31
lines changed

ERCs/ERC20/ERC20-TokenScript.xml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,22 @@
1919
>
2020
<asnx:module name="ERC20-Events">
2121
<namedType name="Approval">
22-
<sequence>
23-
<element name="owner" ethereum:type="address" ethereum:indexed="true"/>
24-
<element name="spender" ethereum:type="address" ethereum:indexed="true"/>
25-
<element name="value" ethereum:type="uint256" ethereum:indexed="false"/>
26-
</sequence>
22+
<type>
23+
<sequence>
24+
<element name="owner" ethereum:type="address" ethereum:indexed="true"/>
25+
<element name="spender" ethereum:type="address" ethereum:indexed="true"/>
26+
<element name="value" ethereum:type="uint256" ethereum:indexed="false"/>
27+
</sequence>
28+
</type>
2729
</namedType>
2830
<namedType name="Transfer">
29-
<sequence>
30-
<element name="from" ethereum:type="address" ethereum:indexed="true"/>
31-
<element name="to" ethereum:type="address" ethereum:indexed="true"/>
32-
<element name="value" ethereum:type="uint256" ethereum:indexed="false"/>
33-
</sequence>
31+
<type>
32+
<sequence>
33+
<element name="from" ethereum:type="address" ethereum:indexed="true"/>
34+
<element name="to" ethereum:type="address" ethereum:indexed="true"/>
35+
<element name="value" ethereum:type="uint256" ethereum:indexed="false"/>
36+
</sequence>
37+
</type>
3438
</namedType>
3539
</asnx:module>
3640
<ts:cards>

ERCs/ERC721/ERC721-TokenScript.xml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,22 @@
1919
>
2020
<asnx:module name="ERC721-Events">
2121
<namedType name="Approval">
22-
<sequence>
23-
<element name="_owner" ethereum:type="address" ethereum:indexed="true"/>
24-
<element name="_approved" ethereum:type="address" ethereum:indexed="true"/>
25-
<element name="_tokenId" ethereum:type="uint256" ethereum:indexed="false"/>
26-
</sequence>
22+
<type>
23+
<sequence>
24+
<element name="_owner" ethereum:type="address" ethereum:indexed="true"/>
25+
<element name="_approved" ethereum:type="address" ethereum:indexed="true"/>
26+
<element name="_tokenId" ethereum:type="uint256" ethereum:indexed="false"/>
27+
</sequence>
28+
</type>
2729
</namedType>
2830
<namedType name="Transfer">
29-
<sequence>
30-
<element name="_from" ethereum:type="address" ethereum:indexed="true"/>
31-
<element name="_to" ethereum:type="address" ethereum:indexed="true"/>
32-
<element name="_tokenId" ethereum:type="uint256" ethereum:indexed="false"/>
33-
</sequence>
31+
<type>
32+
<sequence>
33+
<element name="_from" ethereum:type="address" ethereum:indexed="true"/>
34+
<element name="_to" ethereum:type="address" ethereum:indexed="true"/>
35+
<element name="_tokenId" ethereum:type="uint256" ethereum:indexed="false"/>
36+
</sequence>
37+
</type>
3438
</namedType>
3539
</asnx:module>
3640
<ts:cards>

schema/asnx.xsd

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,54 @@
1919

2020
<complexType name="namedType">
2121
<choice>
22-
<element name="sequence" type="asnx:container"/>
22+
<element name="element" type="asnx:element"/>
23+
<element name="type" type="asnx:type">
24+
</element>
2325
</choice>
2426
<attribute name="name" type="NCName"/>
2527
</complexType>
28+
29+
<complexType name="type">
30+
<choice>
31+
<element name="sequence" type="asnx:container"/>
32+
<element name="enumerated" type="asnx:enumerated"/>
33+
</choice>
34+
</complexType>
35+
36+
<complexType name="enumerated">
37+
<sequence>
38+
<element name="enumeration" maxOccurs="unbounded">
39+
<complexType>
40+
<attribute name="name" type="NCName"/>
41+
<attribute name="number" type="integer"/>
42+
</complexType>
43+
</element>
44+
</sequence>
45+
</complexType>
46+
2647
<complexType name="container">
2748
<choice maxOccurs="unbounded">
2849
<element name="element" type="asnx:element"/>
2950
</choice>
3051
</complexType>
3152

3253
<complexType name="element">
54+
<choice>
55+
<element name="type" type="asnx:type"/>
56+
</choice>
3357
<attribute name="name" type="NCName"/>
34-
<attribute name="type" type="asnx:type"/>
58+
<attribute name="type">
59+
<simpleType>
60+
<restriction base="string">
61+
<enumeration value="asnx:UTF8String"/>
62+
<enumeration value="asnx:INTEGER"/>
63+
<enumeration value="asnx:BOOLEAN"/>
64+
<enumeration value="asnx:OCTET-STRING"/>
65+
<enumeration value="asnx:UTCTime"/>
66+
</restriction>
67+
</simpleType>
68+
</attribute>
3569
<attribute ref="ethereum:type"/>
3670
<attribute ref="ethereum:indexed"/>
3771
</complexType>
38-
39-
<simpleType name="type">
40-
<restriction base="string">
41-
<enumeration value="asnx:UTF8String"/>
42-
<enumeration value="asnx:INTEGER"/>
43-
<enumeration value="asnx:BOOLEAN"/>
44-
<enumeration value="asnx:OCTET-STRING"/>
45-
</restriction>
46-
</simpleType>
4772
</schema>

0 commit comments

Comments
 (0)