Enum toJSON returns toString for a basic enum (#1697)

* Update kusama static from 1032 to 1033

* Test 1032 and 1033

* Got exact metadata from kusama

* First pass: enum TOJSON and fix some tests

* Build interfaces

* Fix import

* Use camelCase for enum toJSON

* Build interface

* Fix lint

* Fix tests

* Generate static json
This commit is contained in:
Amaury Martiny
2020-01-13 22:18:51 +01:00
committed by Jaco Greeff
parent dd57b1a007
commit fbbbcd2612
25 changed files with 2808 additions and 2879 deletions
@@ -438,7 +438,7 @@
"functions": [ "functions": [
{ {
"name": "AccountNonce", "name": "AccountNonce",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "AccountId", "key": "AccountId",
@@ -450,7 +450,7 @@
}, },
{ {
"name": "ExtrinsicCount", "name": "ExtrinsicCount",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Plain": "u32" "Plain": "u32"
}, },
@@ -459,7 +459,7 @@
}, },
{ {
"name": "BlockHash", "name": "BlockHash",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "BlockNumber", "key": "BlockNumber",
@@ -471,7 +471,7 @@
}, },
{ {
"name": "ExtrinsicData", "name": "ExtrinsicData",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "u32", "key": "u32",
@@ -483,7 +483,7 @@
}, },
{ {
"name": "RandomSeed", "name": "RandomSeed",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Hash" "Plain": "Hash"
}, },
@@ -492,7 +492,7 @@
}, },
{ {
"name": "Number", "name": "Number",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -503,7 +503,7 @@
}, },
{ {
"name": "ParentHash", "name": "ParentHash",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Hash" "Plain": "Hash"
}, },
@@ -512,7 +512,7 @@
}, },
{ {
"name": "ExtrinsicsRoot", "name": "ExtrinsicsRoot",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Hash" "Plain": "Hash"
}, },
@@ -521,7 +521,7 @@
}, },
{ {
"name": "Digest", "name": "Digest",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Digest" "Plain": "Digest"
}, },
@@ -530,7 +530,7 @@
}, },
{ {
"name": "Events", "name": "Events",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Vec<EventRecord>" "Plain": "Vec<EventRecord>"
}, },
@@ -586,7 +586,7 @@
"functions": [ "functions": [
{ {
"name": "Now", "name": "Now",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Moment" "Plain": "Moment"
}, },
@@ -597,7 +597,7 @@
}, },
{ {
"name": "BlockPeriod", "name": "BlockPeriod",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Moment" "Plain": "Moment"
}, },
@@ -608,7 +608,7 @@
}, },
{ {
"name": "DidUpdate", "name": "DidUpdate",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "bool" "Plain": "bool"
}, },
@@ -713,7 +713,7 @@
"functions": [ "functions": [
{ {
"name": "OriginalAuthorities", "name": "OriginalAuthorities",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Plain": "Vec<SessionKey>" "Plain": "Vec<SessionKey>"
}, },
@@ -737,7 +737,7 @@
"functions": [ "functions": [
{ {
"name": "NextEnumSet", "name": "NextEnumSet",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "AccountIndex" "Plain": "AccountIndex"
}, },
@@ -748,7 +748,7 @@
}, },
{ {
"name": "EnumSet", "name": "EnumSet",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "AccountIndex", "key": "AccountIndex",
@@ -816,7 +816,7 @@
"functions": [ "functions": [
{ {
"name": "TotalIssuance", "name": "TotalIssuance",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Balance" "Plain": "Balance"
}, },
@@ -827,7 +827,7 @@
}, },
{ {
"name": "ExistentialDeposit", "name": "ExistentialDeposit",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Balance" "Plain": "Balance"
}, },
@@ -838,7 +838,7 @@
}, },
{ {
"name": "TransferFee", "name": "TransferFee",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Balance" "Plain": "Balance"
}, },
@@ -849,7 +849,7 @@
}, },
{ {
"name": "CreationFee", "name": "CreationFee",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Balance" "Plain": "Balance"
}, },
@@ -860,7 +860,7 @@
}, },
{ {
"name": "FreeBalance", "name": "FreeBalance",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "AccountId", "key": "AccountId",
@@ -884,7 +884,7 @@
}, },
{ {
"name": "ReservedBalance", "name": "ReservedBalance",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "AccountId", "key": "AccountId",
@@ -909,7 +909,7 @@
}, },
{ {
"name": "TransactionBaseFee", "name": "TransactionBaseFee",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Balance" "Plain": "Balance"
}, },
@@ -920,7 +920,7 @@
}, },
{ {
"name": "TransactionByteFee", "name": "TransactionByteFee",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Balance" "Plain": "Balance"
}, },
@@ -987,7 +987,7 @@
"functions": [ "functions": [
{ {
"name": "Validators", "name": "Validators",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Vec<AccountId>" "Plain": "Vec<AccountId>"
}, },
@@ -998,7 +998,7 @@
}, },
{ {
"name": "SessionLength", "name": "SessionLength",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -1009,7 +1009,7 @@
}, },
{ {
"name": "CurrentIndex", "name": "CurrentIndex",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -1020,7 +1020,7 @@
}, },
{ {
"name": "CurrentStart", "name": "CurrentStart",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Moment" "Plain": "Moment"
}, },
@@ -1031,7 +1031,7 @@
}, },
{ {
"name": "ForcingNewSession", "name": "ForcingNewSession",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Plain": "bool" "Plain": "bool"
}, },
@@ -1043,7 +1043,7 @@
}, },
{ {
"name": "LastLengthChange", "name": "LastLengthChange",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -1054,7 +1054,7 @@
}, },
{ {
"name": "NextKeyFor", "name": "NextKeyFor",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Map": { "Map": {
"key": "AccountId", "key": "AccountId",
@@ -1068,7 +1068,7 @@
}, },
{ {
"name": "NextSessionLength", "name": "NextSessionLength",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -1243,7 +1243,7 @@
"functions": [ "functions": [
{ {
"name": "ValidatorCount", "name": "ValidatorCount",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "u32" "Plain": "u32"
}, },
@@ -1254,7 +1254,7 @@
}, },
{ {
"name": "MinimumValidatorCount", "name": "MinimumValidatorCount",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "u32" "Plain": "u32"
}, },
@@ -1265,7 +1265,7 @@
}, },
{ {
"name": "SessionsPerEra", "name": "SessionsPerEra",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -1276,7 +1276,7 @@
}, },
{ {
"name": "SessionReward", "name": "SessionReward",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Perbill" "Plain": "Perbill"
}, },
@@ -1287,7 +1287,7 @@
}, },
{ {
"name": "OfflineSlash", "name": "OfflineSlash",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Perbill" "Plain": "Perbill"
}, },
@@ -1298,7 +1298,7 @@
}, },
{ {
"name": "OfflineSlashGrace", "name": "OfflineSlashGrace",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "u32" "Plain": "u32"
}, },
@@ -1309,7 +1309,7 @@
}, },
{ {
"name": "BondingDuration", "name": "BondingDuration",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -1320,7 +1320,7 @@
}, },
{ {
"name": "Invulerables", "name": "Invulerables",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Vec<AccountId>" "Plain": "Vec<AccountId>"
}, },
@@ -1332,7 +1332,7 @@
}, },
{ {
"name": "CurrentEra", "name": "CurrentEra",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -1343,7 +1343,7 @@
}, },
{ {
"name": "ValidatorPreferences", "name": "ValidatorPreferences",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "AccountId", "key": "AccountId",
@@ -1357,7 +1357,7 @@
}, },
{ {
"name": "Intentions", "name": "Intentions",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Vec<AccountId>" "Plain": "Vec<AccountId>"
}, },
@@ -1368,7 +1368,7 @@
}, },
{ {
"name": "Nominating", "name": "Nominating",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Map": { "Map": {
"key": "AccountId", "key": "AccountId",
@@ -1382,7 +1382,7 @@
}, },
{ {
"name": "NominatorsFor", "name": "NominatorsFor",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "AccountId", "key": "AccountId",
@@ -1396,7 +1396,7 @@
}, },
{ {
"name": "CurrentNominatorsFor", "name": "CurrentNominatorsFor",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "AccountId", "key": "AccountId",
@@ -1410,7 +1410,7 @@
}, },
{ {
"name": "CurrentSessionReward", "name": "CurrentSessionReward",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Balance" "Plain": "Balance"
}, },
@@ -1421,7 +1421,7 @@
}, },
{ {
"name": "CurrentOfflineSlash", "name": "CurrentOfflineSlash",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Balance" "Plain": "Balance"
}, },
@@ -1432,7 +1432,7 @@
}, },
{ {
"name": "NextSessionsPerEra", "name": "NextSessionsPerEra",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -1443,7 +1443,7 @@
}, },
{ {
"name": "LastEraLengthChange", "name": "LastEraLengthChange",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -1454,7 +1454,7 @@
}, },
{ {
"name": "StakeRange", "name": "StakeRange",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "(Balance,Balance)" "Plain": "(Balance,Balance)"
}, },
@@ -1465,7 +1465,7 @@
}, },
{ {
"name": "Bondage", "name": "Bondage",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "AccountId", "key": "AccountId",
@@ -1479,7 +1479,7 @@
}, },
{ {
"name": "SlashCount", "name": "SlashCount",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "AccountId", "key": "AccountId",
@@ -1493,7 +1493,7 @@
}, },
{ {
"name": "ForcingNewEra", "name": "ForcingNewEra",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Plain": "Null" "Plain": "Null"
}, },
@@ -1619,7 +1619,7 @@
"functions": [ "functions": [
{ {
"name": "PublicPropCount", "name": "PublicPropCount",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "PropIndex" "Plain": "PropIndex"
}, },
@@ -1630,7 +1630,7 @@
}, },
{ {
"name": "PublicProps", "name": "PublicProps",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Vec<(PropIndex,Proposal,AccountId)>" "Plain": "Vec<(PropIndex,Proposal,AccountId)>"
}, },
@@ -1641,7 +1641,7 @@
}, },
{ {
"name": "DepositOf", "name": "DepositOf",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Map": { "Map": {
"key": "PropIndex", "key": "PropIndex",
@@ -1655,7 +1655,7 @@
}, },
{ {
"name": "LaunchPeriod", "name": "LaunchPeriod",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -1666,7 +1666,7 @@
}, },
{ {
"name": "MinimumDeposit", "name": "MinimumDeposit",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Balance" "Plain": "Balance"
}, },
@@ -1677,7 +1677,7 @@
}, },
{ {
"name": "PublicDelay", "name": "PublicDelay",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -1688,7 +1688,7 @@
}, },
{ {
"name": "MaxLockPeriods", "name": "MaxLockPeriods",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "LockPeriods" "Plain": "LockPeriods"
}, },
@@ -1699,7 +1699,7 @@
}, },
{ {
"name": "VotingPeriod", "name": "VotingPeriod",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -1710,7 +1710,7 @@
}, },
{ {
"name": "ReferendumCount", "name": "ReferendumCount",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "ReferendumIndex" "Plain": "ReferendumIndex"
}, },
@@ -1721,7 +1721,7 @@
}, },
{ {
"name": "NextTally", "name": "NextTally",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "ReferendumIndex" "Plain": "ReferendumIndex"
}, },
@@ -1732,7 +1732,7 @@
}, },
{ {
"name": "ReferendumInfoOf", "name": "ReferendumInfoOf",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Map": { "Map": {
"key": "ReferendumIndex", "key": "ReferendumIndex",
@@ -1746,7 +1746,7 @@
}, },
{ {
"name": "DispatchQueue", "name": "DispatchQueue",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "BlockNumber", "key": "BlockNumber",
@@ -1760,7 +1760,7 @@
}, },
{ {
"name": "Bondage", "name": "Bondage",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "AccountId", "key": "AccountId",
@@ -1774,7 +1774,7 @@
}, },
{ {
"name": "VotersFor", "name": "VotersFor",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "ReferendumIndex", "key": "ReferendumIndex",
@@ -1788,7 +1788,7 @@
}, },
{ {
"name": "VoteOf", "name": "VoteOf",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "(ReferendumIndex,AccountId)", "key": "(ReferendumIndex,AccountId)",
@@ -1976,7 +1976,7 @@
"functions": [ "functions": [
{ {
"name": "CandidacyBond", "name": "CandidacyBond",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Balance" "Plain": "Balance"
}, },
@@ -1987,7 +1987,7 @@
}, },
{ {
"name": "VotingBond", "name": "VotingBond",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Balance" "Plain": "Balance"
}, },
@@ -1998,7 +1998,7 @@
}, },
{ {
"name": "PresentSlashPerVoter", "name": "PresentSlashPerVoter",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Balance" "Plain": "Balance"
}, },
@@ -2009,7 +2009,7 @@
}, },
{ {
"name": "CarryCount", "name": "CarryCount",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "u32" "Plain": "u32"
}, },
@@ -2020,7 +2020,7 @@
}, },
{ {
"name": "PresentationDuration", "name": "PresentationDuration",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -2031,7 +2031,7 @@
}, },
{ {
"name": "InactiveGracePeriod", "name": "InactiveGracePeriod",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "VoteIndex" "Plain": "VoteIndex"
}, },
@@ -2043,7 +2043,7 @@
}, },
{ {
"name": "VotingPeriod", "name": "VotingPeriod",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -2054,7 +2054,7 @@
}, },
{ {
"name": "TermDuration", "name": "TermDuration",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -2065,7 +2065,7 @@
}, },
{ {
"name": "DesiredSeats", "name": "DesiredSeats",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "u32" "Plain": "u32"
}, },
@@ -2076,7 +2076,7 @@
}, },
{ {
"name": "ActiveCouncil", "name": "ActiveCouncil",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Vec<(AccountId,BlockNumber)>" "Plain": "Vec<(AccountId,BlockNumber)>"
}, },
@@ -2090,7 +2090,7 @@
}, },
{ {
"name": "VoteCount", "name": "VoteCount",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "VoteIndex" "Plain": "VoteIndex"
}, },
@@ -2101,7 +2101,7 @@
}, },
{ {
"name": "ApprovalsOf", "name": "ApprovalsOf",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "AccountId", "key": "AccountId",
@@ -2116,7 +2116,7 @@
}, },
{ {
"name": "RegisterInfoOf", "name": "RegisterInfoOf",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Map": { "Map": {
"key": "AccountId", "key": "AccountId",
@@ -2131,7 +2131,7 @@
}, },
{ {
"name": "LastActiveOf", "name": "LastActiveOf",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Map": { "Map": {
"key": "AccountId", "key": "AccountId",
@@ -2145,7 +2145,7 @@
}, },
{ {
"name": "Voters", "name": "Voters",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Vec<AccountId>" "Plain": "Vec<AccountId>"
}, },
@@ -2156,7 +2156,7 @@
}, },
{ {
"name": "Candidates", "name": "Candidates",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Vec<AccountId>" "Plain": "Vec<AccountId>"
}, },
@@ -2167,7 +2167,7 @@
}, },
{ {
"name": "CandidateCount", "name": "CandidateCount",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "u32" "Plain": "u32"
}, },
@@ -2176,7 +2176,7 @@
}, },
{ {
"name": "NextFinalise", "name": "NextFinalise",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Plain": "(BlockNumber,u32,Vec<AccountId>)" "Plain": "(BlockNumber,u32,Vec<AccountId>)"
}, },
@@ -2187,7 +2187,7 @@
}, },
{ {
"name": "SnapshotedStakes", "name": "SnapshotedStakes",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Vec<Balance>" "Plain": "Vec<Balance>"
}, },
@@ -2198,7 +2198,7 @@
}, },
{ {
"name": "Leaderboard", "name": "Leaderboard",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Plain": "Vec<(Balance,AccountId)>" "Plain": "Vec<(Balance,AccountId)>"
}, },
@@ -2284,7 +2284,7 @@
"functions": [ "functions": [
{ {
"name": "CooloffPeriod", "name": "CooloffPeriod",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -2293,7 +2293,7 @@
}, },
{ {
"name": "VotingPeriod", "name": "VotingPeriod",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -2302,7 +2302,7 @@
}, },
{ {
"name": "EnactDelayPeriod", "name": "EnactDelayPeriod",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -2313,7 +2313,7 @@
}, },
{ {
"name": "Proposals", "name": "Proposals",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Vec<(BlockNumber,Hash)>" "Plain": "Vec<(BlockNumber,Hash)>"
}, },
@@ -2322,7 +2322,7 @@
}, },
{ {
"name": "ProposalOf", "name": "ProposalOf",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Map": { "Map": {
"key": "Hash", "key": "Hash",
@@ -2334,7 +2334,7 @@
}, },
{ {
"name": "ProposalVoters", "name": "ProposalVoters",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Map": { "Map": {
"key": "Hash", "key": "Hash",
@@ -2346,7 +2346,7 @@
}, },
{ {
"name": "CouncilVoteOf", "name": "CouncilVoteOf",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Map": { "Map": {
"key": "(Hash,AccountId)", "key": "(Hash,AccountId)",
@@ -2358,7 +2358,7 @@
}, },
{ {
"name": "VetoedProposal", "name": "VetoedProposal",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Map": { "Map": {
"key": "Hash", "key": "Hash",
@@ -2420,7 +2420,7 @@
"functions": [ "functions": [
{ {
"name": "Proposals", "name": "Proposals",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Vec<Hash>" "Plain": "Vec<Hash>"
}, },
@@ -2431,7 +2431,7 @@
}, },
{ {
"name": "ProposalOf", "name": "ProposalOf",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Map": { "Map": {
"key": "Hash", "key": "Hash",
@@ -2445,7 +2445,7 @@
}, },
{ {
"name": "Voting", "name": "Voting",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Map": { "Map": {
"key": "Hash", "key": "Hash",
@@ -2459,7 +2459,7 @@
}, },
{ {
"name": "ProposalCount", "name": "ProposalCount",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "u32" "Plain": "u32"
}, },
@@ -2499,7 +2499,7 @@
"functions": [ "functions": [
{ {
"name": "PendingChange", "name": "PendingChange",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Plain": "StoredPendingChange" "Plain": "StoredPendingChange"
}, },
@@ -2608,7 +2608,7 @@
"functions": [ "functions": [
{ {
"name": "ProposalBond", "name": "ProposalBond",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Permill" "Plain": "Permill"
}, },
@@ -2620,7 +2620,7 @@
}, },
{ {
"name": "ProposalBondMinimum", "name": "ProposalBondMinimum",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Balance" "Plain": "Balance"
}, },
@@ -2631,7 +2631,7 @@
}, },
{ {
"name": "SpendPeriod", "name": "SpendPeriod",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "BlockNumber" "Plain": "BlockNumber"
}, },
@@ -2642,7 +2642,7 @@
}, },
{ {
"name": "Burn", "name": "Burn",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Permill" "Plain": "Permill"
}, },
@@ -2653,7 +2653,7 @@
}, },
{ {
"name": "Pot", "name": "Pot",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Balance" "Plain": "Balance"
}, },
@@ -2664,7 +2664,7 @@
}, },
{ {
"name": "ProposalCount", "name": "ProposalCount",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "ProposalIndex" "Plain": "ProposalIndex"
}, },
@@ -2675,7 +2675,7 @@
}, },
{ {
"name": "Proposals", "name": "Proposals",
"modifier": 0, "modifier": "optional",
"type": { "type": {
"Map": { "Map": {
"key": "ProposalIndex", "key": "ProposalIndex",
@@ -2689,7 +2689,7 @@
}, },
{ {
"name": "Approvals", "name": "Approvals",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "Vec<ProposalIndex>" "Plain": "Vec<ProposalIndex>"
}, },
@@ -2809,7 +2809,7 @@
"functions": [ "functions": [
{ {
"name": "Key", "name": "Key",
"modifier": 1, "modifier": "default",
"type": { "type": {
"Plain": "AccountId" "Plain": "AccountId"
}, },
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -2,10 +2,10 @@
// This software may be modified and distributed under the terms // This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details. // of the Apache-2.0 license. See the LICENSE file for details.
import { MetadataV9, MetadataV10, ModuleMetadataV9, ModuleMetadataV10, StorageEntryMetadataV9, StorageEntryTypeV9, StorageHasherV9 } from '@polkadot/types/interfaces/metadata'; import { MetadataV9, MetadataV10, ModuleMetadataV9, ModuleMetadataV10, StorageEntryMetadataV9, StorageEntryTypeV9, StorageHasherV9, StorageHasherV10 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types'; import { Registry } from '@polkadot/types/types';
import { createType, StorageHasherV10 } from '@polkadot/types'; import { createType } from '@polkadot/types';
// migrate a storage hasher type // migrate a storage hasher type
// see https://github.com/paritytech/substrate/pull/4462 // see https://github.com/paritytech/substrate/pull/4462
+3 -3
View File
@@ -178,7 +178,7 @@ describe('Enum', (): void => {
const testEncode = (to: 'toJSON' | 'toNumber' | 'toString' | 'toU8a', expected: any): void => const testEncode = (to: 'toJSON' | 'toNumber' | 'toString' | 'toU8a', expected: any): void =>
it(`can encode ${to}`, (): void => { it(`can encode ${to}`, (): void => {
const e = new Enum(registry, ['foo', 'bar'], 1); const e = new Enum(registry, ['Foo', 'Bar'], 1);
expect(e[to]()).toEqual(expected); expect(e[to]()).toEqual(expected);
}); });
@@ -191,9 +191,9 @@ describe('Enum', (): void => {
testDecode('Uint8Array', Uint8Array.from([0]), 'foo'); testDecode('Uint8Array', Uint8Array.from([0]), 'foo');
testDecode('Uint8Array', Uint8Array.from([1]), 'bar'); testDecode('Uint8Array', Uint8Array.from([1]), 'bar');
testEncode('toJSON', 1); testEncode('toJSON', 'bar');
testEncode('toNumber', 1); testEncode('toNumber', 1);
testEncode('toString', 'bar'); testEncode('toString', 'Bar');
testEncode('toU8a', Uint8Array.from([1])); testEncode('toU8a', Uint8Array.from([1]));
it('provides a clean toString()', (): void => { it('provides a clean toString()', (): void => {
+1 -1
View File
@@ -244,7 +244,7 @@ export default class Enum extends Base<Codec> {
*/ */
public toJSON (): AnyJson { public toJSON (): AnyJson {
return this._isBasic return this._isBasic
? this._index ? stringCamelCase(this.toString())
: { [this.type]: this.raw.toJSON() }; : { [this.type]: this.raw.toJSON() };
} }
@@ -47,7 +47,7 @@ describe('createType', (): void => {
it('allows creation of a Enum (simple)', (): void => { it('allows creation of a Enum (simple)', (): void => {
expect( expect(
createTypeUnsafe(registry, '{"_enum": ["A", "B", "C"]}', [1]).toJSON() createTypeUnsafe(registry, '{"_enum": ["A", "B", "C"]}', [1]).toJSON()
).toEqual(1); ).toEqual('b');
}); });
it('allows creation of a Enum (parametrised)', (): void => { it('allows creation of a Enum (parametrised)', (): void => {
+8 -8
View File
@@ -2,7 +2,7 @@
/* eslint-disable @typescript-eslint/no-empty-interface */ /* eslint-disable @typescript-eslint/no-empty-interface */
import { Compact, Option, Raw, Vec } from '@polkadot/types/codec'; import { Compact, Option, Raw, Vec } from '@polkadot/types/codec';
import { Bytes, Data, Fixed64, H160, H256, H512, IdentityFields, Null, StorageData, StorageHasherV10, StorageHasherV4, StorageKey, Text, Type, U256, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types/primitive'; import { Bytes, Data, Fixed64, H160, H256, H512, IdentityFields, Null, StorageData, StorageKey, Text, Type, U256, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types/primitive';
import { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, Consensus, ConsensusEngineId, Digest, DigestItem, DispatchClass, DispatchInfo, DispatchInfoTo190, EcdsaSignature, Ed25519Signature, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV1, ExtrinsicPayloadV2, ExtrinsicPayloadV3, ExtrinsicPayloadV4, ExtrinsicUnknown, ExtrinsicV1, ExtrinsicV2, ExtrinsicV3, ExtrinsicV4, Hash, Header, ImmortalEra, Index, Justification, KeyTypeId, KeyValue, LockIdentifier, Moment, MortalEra, MultiSignature, Origin, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Seal, SealV0, Signature, SignedBlock, SignerPayload, Sr25519Signature, ValidatorId, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; import { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, Consensus, ConsensusEngineId, Digest, DigestItem, DispatchClass, DispatchInfo, DispatchInfoTo190, EcdsaSignature, Ed25519Signature, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV1, ExtrinsicPayloadV2, ExtrinsicPayloadV3, ExtrinsicPayloadV4, ExtrinsicUnknown, ExtrinsicV1, ExtrinsicV2, ExtrinsicV3, ExtrinsicV4, Hash, Header, ImmortalEra, Index, Justification, KeyTypeId, KeyValue, LockIdentifier, Moment, MortalEra, MultiSignature, Origin, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Seal, SealV0, Signature, SignedBlock, SignerPayload, Sr25519Signature, ValidatorId, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
import { InclusionHeight, Uncle, UncleEntryItem } from '@polkadot/types/interfaces/authorship'; import { InclusionHeight, Uncle, UncleEntryItem } from '@polkadot/types/interfaces/authorship';
import { RawAuraPreDigest } from '@polkadot/types/interfaces/aura'; import { RawAuraPreDigest } from '@polkadot/types/interfaces/aura';
@@ -28,7 +28,7 @@ import { Multisig, Timepoint } from '@polkadot/types/interfaces/utility';
import { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations'; import { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations';
import { EthereumAddress } from '@polkadot/types/interfaces/claims'; import { EthereumAddress } from '@polkadot/types/interfaces/claims';
import { AttestedCandidate, AuctionIndex, BalanceUpload, Bidder, CandidateReceipt, CollatorId, CollatorSignature, EgressQueueRoot, HeadData, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, LeasePeriod, LeasePeriodOf, NewBidder, ParaId, ParaIdOf, ParaInfo, ParaScheduling, ParachainDispatchOrigin, Retriable, SlotRange, SubId, UpwardMessage, ValidatorIndex, ValidityAttestation, ValidityVote, WinningData, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; import { AttestedCandidate, AuctionIndex, BalanceUpload, Bidder, CandidateReceipt, CollatorId, CollatorSignature, EgressQueueRoot, HeadData, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, LeasePeriod, LeasePeriodOf, NewBidder, ParaId, ParaIdOf, ParaInfo, ParaScheduling, ParachainDispatchOrigin, Retriable, SlotRange, SubId, UpwardMessage, ValidatorIndex, ValidityAttestation, ValidityVote, WinningData, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
import { CallMetadataV0, DoubleMapTypeV10, DoubleMapTypeV11, DoubleMapTypeV3, DoubleMapTypeV4, DoubleMapTypeV5, DoubleMapTypeV6, DoubleMapTypeV7, DoubleMapTypeV8, DoubleMapTypeV9, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV8, ErrorMetadataV9, EventMetadataLatest, EventMetadataV0, EventMetadataV1, EventMetadataV10, EventMetadataV11, EventMetadataV2, EventMetadataV3, EventMetadataV4, EventMetadataV5, EventMetadataV6, EventMetadataV7, EventMetadataV8, EventMetadataV9, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV0, FunctionArgumentMetadataV1, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV2, FunctionArgumentMetadataV3, FunctionArgumentMetadataV4, FunctionArgumentMetadataV5, FunctionArgumentMetadataV6, FunctionArgumentMetadataV7, FunctionArgumentMetadataV8, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV0, FunctionMetadataV1, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV2, FunctionMetadataV3, FunctionMetadataV4, FunctionMetadataV5, FunctionMetadataV6, FunctionMetadataV7, FunctionMetadataV8, FunctionMetadataV9, MapKindV11, MapTypeV0, MapTypeV10, MapTypeV11, MapTypeV2, MapTypeV3, MapTypeV4, MapTypeV5, MapTypeV6, MapTypeV7, MapTypeV8, MapTypeV9, MetadataAll, MetadataLatest, MetadataV0, MetadataV1, MetadataV10, MetadataV11, MetadataV2, MetadataV3, MetadataV4, MetadataV5, MetadataV6, MetadataV7, MetadataV8, MetadataV9, ModuleConstantMetadataLatest, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV6, ModuleConstantMetadataV7, ModuleConstantMetadataV8, ModuleConstantMetadataV9, ModuleMetadataLatest, ModuleMetadataV0, ModuleMetadataV1, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV2, ModuleMetadataV3, ModuleMetadataV4, ModuleMetadataV5, ModuleMetadataV6, ModuleMetadataV7, ModuleMetadataV8, ModuleMetadataV9, OuterDispatchCallV0, OuterDispatchMetadataV0, OuterEventEventMetadataEventsV0, OuterEventEventMetadataV0, OuterEventMetadataV0, PlainTypeLatest, PlainTypeV0, PlainTypeV10, PlainTypeV11, PlainTypeV2, PlainTypeV3, PlainTypeV4, PlainTypeV5, PlainTypeV6, PlainTypeV7, PlainTypeV8, PlainTypeV9, RuntimeModuleMetadataV0, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV6, StorageEntryMetadataV7, StorageEntryMetadataV8, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV6, StorageEntryModifierV7, StorageEntryModifierV8, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV6, StorageEntryTypeV7, StorageEntryTypeV8, StorageEntryTypeV9, StorageFunctionMetadataV0, StorageFunctionMetadataV1, StorageFunctionMetadataV2, StorageFunctionMetadataV3, StorageFunctionMetadataV4, StorageFunctionMetadataV5, StorageFunctionModifierV0, StorageFunctionModifierV1, StorageFunctionModifierV2, StorageFunctionModifierV3, StorageFunctionModifierV4, StorageFunctionModifierV5, StorageFunctionTypeV0, StorageFunctionTypeV1, StorageFunctionTypeV2, StorageFunctionTypeV3, StorageFunctionTypeV4, StorageFunctionTypeV5, StorageHasher, StorageHasherV11, StorageHasherV5, StorageHasherV6, StorageHasherV7, StorageHasherV8, StorageHasherV9, StorageMetadataV0, StorageMetadataV10, StorageMetadataV11, StorageMetadataV7, StorageMetadataV8, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; import { CallMetadataV0, DoubleMapTypeV10, DoubleMapTypeV11, DoubleMapTypeV3, DoubleMapTypeV4, DoubleMapTypeV5, DoubleMapTypeV6, DoubleMapTypeV7, DoubleMapTypeV8, DoubleMapTypeV9, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV8, ErrorMetadataV9, EventMetadataLatest, EventMetadataV0, EventMetadataV1, EventMetadataV10, EventMetadataV11, EventMetadataV2, EventMetadataV3, EventMetadataV4, EventMetadataV5, EventMetadataV6, EventMetadataV7, EventMetadataV8, EventMetadataV9, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV0, FunctionArgumentMetadataV1, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV2, FunctionArgumentMetadataV3, FunctionArgumentMetadataV4, FunctionArgumentMetadataV5, FunctionArgumentMetadataV6, FunctionArgumentMetadataV7, FunctionArgumentMetadataV8, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV0, FunctionMetadataV1, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV2, FunctionMetadataV3, FunctionMetadataV4, FunctionMetadataV5, FunctionMetadataV6, FunctionMetadataV7, FunctionMetadataV8, FunctionMetadataV9, MapKindV11, MapTypeV0, MapTypeV10, MapTypeV11, MapTypeV2, MapTypeV3, MapTypeV4, MapTypeV5, MapTypeV6, MapTypeV7, MapTypeV8, MapTypeV9, MetadataAll, MetadataLatest, MetadataV0, MetadataV1, MetadataV10, MetadataV11, MetadataV2, MetadataV3, MetadataV4, MetadataV5, MetadataV6, MetadataV7, MetadataV8, MetadataV9, ModuleConstantMetadataLatest, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV6, ModuleConstantMetadataV7, ModuleConstantMetadataV8, ModuleConstantMetadataV9, ModuleMetadataLatest, ModuleMetadataV0, ModuleMetadataV1, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV2, ModuleMetadataV3, ModuleMetadataV4, ModuleMetadataV5, ModuleMetadataV6, ModuleMetadataV7, ModuleMetadataV8, ModuleMetadataV9, OuterDispatchCallV0, OuterDispatchMetadataV0, OuterEventEventMetadataEventsV0, OuterEventEventMetadataV0, OuterEventMetadataV0, PlainTypeLatest, PlainTypeV0, PlainTypeV10, PlainTypeV11, PlainTypeV2, PlainTypeV3, PlainTypeV4, PlainTypeV5, PlainTypeV6, PlainTypeV7, PlainTypeV8, PlainTypeV9, RuntimeModuleMetadataV0, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV6, StorageEntryMetadataV7, StorageEntryMetadataV8, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV6, StorageEntryModifierV7, StorageEntryModifierV8, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV6, StorageEntryTypeV7, StorageEntryTypeV8, StorageEntryTypeV9, StorageFunctionMetadataV0, StorageFunctionMetadataV1, StorageFunctionMetadataV2, StorageFunctionMetadataV3, StorageFunctionMetadataV4, StorageFunctionMetadataV5, StorageFunctionModifierV0, StorageFunctionModifierV1, StorageFunctionModifierV2, StorageFunctionModifierV3, StorageFunctionModifierV4, StorageFunctionModifierV5, StorageFunctionTypeV0, StorageFunctionTypeV1, StorageFunctionTypeV2, StorageFunctionTypeV3, StorageFunctionTypeV4, StorageFunctionTypeV5, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV4, StorageHasherV5, StorageHasherV6, StorageHasherV7, StorageHasherV8, StorageHasherV9, StorageMetadataV0, StorageMetadataV10, StorageMetadataV11, StorageMetadataV7, StorageMetadataV8, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata';
import { ApiId, BlockHash, ChainProperties, ExtrinsicOrHash, ExtrinsicStatus, Health, KeyValueOption, NetworkState, PeerInfo, RpcMethods, RuntimeDispatchInfo, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/rpc'; import { ApiId, BlockHash, ChainProperties, ExtrinsicOrHash, ExtrinsicStatus, Health, KeyValueOption, NetworkState, PeerInfo, RpcMethods, RuntimeDispatchInfo, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/rpc';
export interface InterfaceRegistry { export interface InterfaceRegistry {
@@ -80,12 +80,6 @@ export interface InterfaceRegistry {
StorageData: StorageData; StorageData: StorageData;
'Option<StorageData>': Option<StorageData>; 'Option<StorageData>': Option<StorageData>;
'Vec<StorageData>': Vec<StorageData>; 'Vec<StorageData>': Vec<StorageData>;
StorageHasherV10: StorageHasherV10;
'Option<StorageHasherV10>': Option<StorageHasherV10>;
'Vec<StorageHasherV10>': Vec<StorageHasherV10>;
StorageHasherV4: StorageHasherV4;
'Option<StorageHasherV4>': Option<StorageHasherV4>;
'Vec<StorageHasherV4>': Vec<StorageHasherV4>;
StorageKey: StorageKey; StorageKey: StorageKey;
'Option<StorageKey>': Option<StorageKey>; 'Option<StorageKey>': Option<StorageKey>;
'Vec<StorageKey>': Vec<StorageKey>; 'Vec<StorageKey>': Vec<StorageKey>;
@@ -1052,6 +1046,9 @@ export interface InterfaceRegistry {
StorageFunctionTypeV4: StorageFunctionTypeV4; StorageFunctionTypeV4: StorageFunctionTypeV4;
'Option<StorageFunctionTypeV4>': Option<StorageFunctionTypeV4>; 'Option<StorageFunctionTypeV4>': Option<StorageFunctionTypeV4>;
'Vec<StorageFunctionTypeV4>': Vec<StorageFunctionTypeV4>; 'Vec<StorageFunctionTypeV4>': Vec<StorageFunctionTypeV4>;
StorageHasherV4: StorageHasherV4;
'Option<StorageHasherV4>': Option<StorageHasherV4>;
'Vec<StorageHasherV4>': Vec<StorageHasherV4>;
DoubleMapTypeV5: DoubleMapTypeV5; DoubleMapTypeV5: DoubleMapTypeV5;
'Option<DoubleMapTypeV5>': Option<DoubleMapTypeV5>; 'Option<DoubleMapTypeV5>': Option<DoubleMapTypeV5>;
'Vec<DoubleMapTypeV5>': Vec<DoubleMapTypeV5>; 'Vec<DoubleMapTypeV5>': Vec<DoubleMapTypeV5>;
@@ -1301,6 +1298,9 @@ export interface InterfaceRegistry {
StorageMetadataV10: StorageMetadataV10; StorageMetadataV10: StorageMetadataV10;
'Option<StorageMetadataV10>': Option<StorageMetadataV10>; 'Option<StorageMetadataV10>': Option<StorageMetadataV10>;
'Vec<StorageMetadataV10>': Vec<StorageMetadataV10>; 'Vec<StorageMetadataV10>': Vec<StorageMetadataV10>;
StorageHasherV10: StorageHasherV10;
'Option<StorageHasherV10>': Option<StorageHasherV10>;
'Vec<StorageHasherV10>': Vec<StorageHasherV10>;
DoubleMapTypeV11: DoubleMapTypeV11; DoubleMapTypeV11: DoubleMapTypeV11;
'Option<DoubleMapTypeV11>': Option<DoubleMapTypeV11>; 'Option<DoubleMapTypeV11>': Option<DoubleMapTypeV11>;
'Vec<DoubleMapTypeV11>': Vec<DoubleMapTypeV11>; 'Vec<DoubleMapTypeV11>': Vec<DoubleMapTypeV11>;
@@ -217,6 +217,15 @@ export default {
DoubleMap: 'DoubleMapTypeV4' DoubleMap: 'DoubleMapTypeV4'
} }
}, },
StorageHasherV4: {
_enum: {
Blake2_128: null, // eslint-disable-line @typescript-eslint/camelcase
Blake2_256: null, // eslint-disable-line @typescript-eslint/camelcase
Twox128: null,
Twox256: null,
Twox64Concat: null
}
},
// v5 // v5
DoubleMapTypeV5: { DoubleMapTypeV5: {
@@ -410,6 +419,16 @@ export default {
prefix: 'Text', prefix: 'Text',
items: 'Vec<StorageEntryMetadataV10>' items: 'Vec<StorageEntryMetadataV10>'
}, },
StorageHasherV10: {
_enum: {
Blake2_128: null, // eslint-disable-line @typescript-eslint/camelcase
Blake2_256: null, // eslint-disable-line @typescript-eslint/camelcase
Blake2_128Concat: null, // eslint-disable-line @typescript-eslint/camelcase
Twox128: null,
Twox256: null,
Twox64Concat: null
}
},
// v11 // v11
DoubleMapTypeV11: 'DoubleMapTypeV10', DoubleMapTypeV11: 'DoubleMapTypeV10',
@@ -3,7 +3,7 @@
import { ITuple } from '@polkadot/types/types'; import { ITuple } from '@polkadot/types/types';
import { Enum, Option, Struct, Vec } from '@polkadot/types/codec'; import { Enum, Option, Struct, Vec } from '@polkadot/types/codec';
import { Bytes, StorageHasherV10, StorageHasherV4, Text, Type, bool, u16 } from '@polkadot/types/primitive'; import { Bytes, Text, Type, bool, u16 } from '@polkadot/types/primitive';
/** Struct */ /** Struct */
export interface CallMetadataV0 extends Struct { export interface CallMetadataV0 extends Struct {
@@ -1011,9 +1011,39 @@ export interface StorageFunctionTypeV5 extends Enum {
/** StorageHasherV11 */ /** StorageHasherV11 */
export interface StorageHasher extends StorageHasherV11 {} export interface StorageHasher extends StorageHasherV11 {}
/** Enum */
export interface StorageHasherV10 extends Enum {
/** 0:: Blake2_128 */
readonly isBlake2128: boolean;
/** 1:: Blake2_256 */
readonly isBlake2256: boolean;
/** 2:: Blake2_128Concat */
readonly isBlake2128Concat: boolean;
/** 3:: Twox128 */
readonly isTwox128: boolean;
/** 4:: Twox256 */
readonly isTwox256: boolean;
/** 5:: Twox64Concat */
readonly isTwox64Concat: boolean;
}
/** StorageHasherV10 */ /** StorageHasherV10 */
export interface StorageHasherV11 extends StorageHasherV10 {} export interface StorageHasherV11 extends StorageHasherV10 {}
/** Enum */
export interface StorageHasherV4 extends Enum {
/** 0:: Blake2_128 */
readonly isBlake2128: boolean;
/** 1:: Blake2_256 */
readonly isBlake2256: boolean;
/** 2:: Twox128 */
readonly isTwox128: boolean;
/** 3:: Twox256 */
readonly isTwox256: boolean;
/** 4:: Twox64Concat */
readonly isTwox64Concat: boolean;
}
/** StorageHasherV4 */ /** StorageHasherV4 */
export interface StorageHasherV5 extends StorageHasherV4 {} export interface StorageHasherV5 extends StorageHasherV4 {}
@@ -1,119 +0,0 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Registry } from '../types';
import Enum from '../codec/Enum';
export class StorageHasherV4 extends Enum {
constructor (registry: Registry, value?: any) {
super(registry, [
'Blake2_128',
'Blake2_256',
'Twox128',
'Twox256',
'Twox64Concat'
], value);
}
/**
* @description Is the enum Blake2_128?
*/
public get isBlake2128 (): boolean {
return this.toNumber() === 0;
}
/**
* @description Is the enum Blake2_256?
*/
public get isBlake2256 (): boolean {
return this.toNumber() === 1;
}
/**
* @description Is the enum Twox128?
*/
public get isTwox128 (): boolean {
return this.toNumber() === 2;
}
/**
* @description Is the enum Twox256?
*/
public get isTwox256 (): boolean {
return this.toNumber() === 3;
}
/**
* @description Is the enum isTwox64Concat?
*/
public get isTwox64Concat (): boolean {
return this.toNumber() === 4;
}
public toJSON (): string {
// This looks prettier in the generated JSON
return this.toString();
}
}
export class StorageHasherV10 extends Enum {
constructor (registry: Registry, value?: any) {
super(registry, [
'Blake2_128',
'Blake2_256',
'Blake2_128Concat',
'Twox128',
'Twox256',
'Twox64Concat'
], value);
}
/**
* @description Is the enum Blake2_128?
*/
public get isBlake2128 (): boolean {
return this.toNumber() === 0;
}
/**
* @description Is the enum Blake2_256?
*/
public get isBlake2256 (): boolean {
return this.toNumber() === 1;
}
/**
* @description Is the enum Blake2_128Concat?
*/
public get isBlake2128Concat (): boolean {
return this.toNumber() === 2;
}
/**
* @description Is the enum Twox128?
*/
public get isTwox128 (): boolean {
return this.toNumber() === 3;
}
/**
* @description Is the enum Twox256?
*/
public get isTwox256 (): boolean {
return this.toNumber() === 4;
}
/**
* @description Is the enum isTwox64Concat?
*/
public get isTwox64Concat (): boolean {
return this.toNumber() === 5;
}
public toJSON (): string {
// This looks prettier in the generated JSON
return this.toString();
}
}
-1
View File
@@ -24,7 +24,6 @@ export { default as i128 } from './I128';
export { default as i256 } from './I256'; export { default as i256 } from './I256';
export { default as Null } from './Null'; export { default as Null } from './Null';
export { default as StorageData } from './StorageData'; export { default as StorageData } from './StorageData';
export { StorageHasherV10, StorageHasherV4 } from './StorageHasher';
export { default as StorageKey } from './StorageKey'; export { default as StorageKey } from './StorageKey';
export { default as Text } from './Text'; export { default as Text } from './Text';
export { default as Type } from './Type'; export { default as Type } from './Type';