Remove custom toString() from metadata storage (#1597)
* Convert asType -> asPlain, isPlainType -> isPlain * Make tests pass * Move unwrapStorageType to StorageKey
This commit is contained in:
@@ -16,7 +16,7 @@ import Text from '@polkadot/types/primitive/Text';
|
||||
export class StorageFunctionType extends Enum {
|
||||
constructor (registry: Registry, value?: any, index?: number) {
|
||||
super(registry, {
|
||||
Type: 'PlainTypeV4',
|
||||
Plain: 'PlainTypeV4',
|
||||
Map: 'MapTypeV4',
|
||||
DoubleMap: 'DoubleMapTypeV4'
|
||||
}, value, index);
|
||||
@@ -43,8 +43,8 @@ export class StorageFunctionType extends Enum {
|
||||
/**
|
||||
* @description The value as a [[Type]] value
|
||||
*/
|
||||
public get asType (): PlainTypeV4 {
|
||||
assert(this.isPlainType, `Cannot convert '${this.type}' via asType`);
|
||||
public get asPlain (): PlainTypeV4 {
|
||||
assert(this.isPlain, `Cannot convert '${this.type}' via asPlain`);
|
||||
|
||||
return this.value as PlainTypeV4;
|
||||
}
|
||||
@@ -66,28 +66,9 @@ export class StorageFunctionType extends Enum {
|
||||
/**
|
||||
* @description `true` if the storage entry is a plain type
|
||||
*/
|
||||
public get isPlainType (): boolean {
|
||||
public get isPlain (): boolean {
|
||||
return this.toNumber() === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the string representation of the value
|
||||
*/
|
||||
public toString (): string {
|
||||
if (this.isDoubleMap) {
|
||||
return `DoubleMap<${this.asDoubleMap.value.toString()}>`;
|
||||
}
|
||||
|
||||
if (this.isMap) {
|
||||
if (this.asMap.linked.isTrue) {
|
||||
return `(${this.asMap.value.toString()}, Linkage<${this.asMap.key.toString()}>)`;
|
||||
}
|
||||
|
||||
return this.asMap.value.toString();
|
||||
}
|
||||
|
||||
return this.asType.toString();
|
||||
}
|
||||
}
|
||||
|
||||
export interface StorageFunctionMetadataValue {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
"name": "ExtrinsicCount",
|
||||
"modifier": 0,
|
||||
"type": {
|
||||
"Type": "u32"
|
||||
"Plain": "u32"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -38,7 +38,7 @@
|
||||
"name": "AllExtrinsicsLen",
|
||||
"modifier": 0,
|
||||
"type": {
|
||||
"Type": "u32"
|
||||
"Plain": "u32"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -81,7 +81,7 @@
|
||||
"name": "RandomMaterial",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "(i8,Vec<Hash>)"
|
||||
"Plain": "(i8,Vec<Hash>)"
|
||||
},
|
||||
"fallback": "0x0000",
|
||||
"documentation": [
|
||||
@@ -93,7 +93,7 @@
|
||||
"name": "Number",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0x0000000000000000",
|
||||
"documentation": [
|
||||
@@ -104,7 +104,7 @@
|
||||
"name": "ParentHash",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Hash"
|
||||
"Plain": "Hash"
|
||||
},
|
||||
"fallback": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -115,7 +115,7 @@
|
||||
"name": "ExtrinsicsRoot",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Hash"
|
||||
"Plain": "Hash"
|
||||
},
|
||||
"fallback": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -126,7 +126,7 @@
|
||||
"name": "Digest",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Digest"
|
||||
"Plain": "Digest"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -137,7 +137,7 @@
|
||||
"name": "Events",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Vec<EventRecord>"
|
||||
"Plain": "Vec<EventRecord>"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -148,7 +148,7 @@
|
||||
"name": "EventCount",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "EventIndex"
|
||||
"Plain": "EventIndex"
|
||||
},
|
||||
"fallback": "0x00000000",
|
||||
"documentation": [
|
||||
@@ -218,7 +218,7 @@
|
||||
"name": "Now",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Moment"
|
||||
"Plain": "Moment"
|
||||
},
|
||||
"fallback": "0x0000000000000000",
|
||||
"documentation": [
|
||||
@@ -229,7 +229,7 @@
|
||||
"name": "BlockPeriod",
|
||||
"modifier": 0,
|
||||
"type": {
|
||||
"Type": "Moment"
|
||||
"Plain": "Moment"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -240,7 +240,7 @@
|
||||
"name": "MinimumPeriod",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Moment"
|
||||
"Plain": "Moment"
|
||||
},
|
||||
"fallback": "0x0300000000000000",
|
||||
"documentation": [
|
||||
@@ -254,7 +254,7 @@
|
||||
"name": "DidUpdate",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "bool"
|
||||
"Plain": "bool"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -293,7 +293,7 @@
|
||||
"name": "OriginalAuthorities",
|
||||
"modifier": 0,
|
||||
"type": {
|
||||
"Type": "Vec<SessionKey>"
|
||||
"Plain": "Vec<SessionKey>"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": []
|
||||
@@ -395,7 +395,7 @@
|
||||
"name": "NextEnumSet",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "AccountIndex"
|
||||
"Plain": "AccountIndex"
|
||||
},
|
||||
"fallback": "0x00000000",
|
||||
"documentation": [
|
||||
@@ -444,7 +444,7 @@
|
||||
"name": "TotalIssuance",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Balance"
|
||||
"Plain": "Balance"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -455,7 +455,7 @@
|
||||
"name": "ExistentialDeposit",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Balance"
|
||||
"Plain": "Balance"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -466,7 +466,7 @@
|
||||
"name": "TransferFee",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Balance"
|
||||
"Plain": "Balance"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -477,7 +477,7 @@
|
||||
"name": "CreationFee",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Balance"
|
||||
"Plain": "Balance"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -488,7 +488,7 @@
|
||||
"name": "TransactionBaseFee",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Balance"
|
||||
"Plain": "Balance"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -499,7 +499,7 @@
|
||||
"name": "TransactionByteFee",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Balance"
|
||||
"Plain": "Balance"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -685,7 +685,7 @@
|
||||
"name": "Validators",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Vec<AccountId>"
|
||||
"Plain": "Vec<AccountId>"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -696,7 +696,7 @@
|
||||
"name": "SessionLength",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0xe803000000000000",
|
||||
"documentation": [
|
||||
@@ -707,7 +707,7 @@
|
||||
"name": "CurrentIndex",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0x0000000000000000",
|
||||
"documentation": [
|
||||
@@ -718,7 +718,7 @@
|
||||
"name": "CurrentStart",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Moment"
|
||||
"Plain": "Moment"
|
||||
},
|
||||
"fallback": "0x0000000000000000",
|
||||
"documentation": [
|
||||
@@ -729,7 +729,7 @@
|
||||
"name": "ForcingNewSession",
|
||||
"modifier": 0,
|
||||
"type": {
|
||||
"Type": "bool"
|
||||
"Plain": "bool"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -742,7 +742,7 @@
|
||||
"name": "LastLengthChange",
|
||||
"modifier": 0,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -769,7 +769,7 @@
|
||||
"name": "NextSessionLength",
|
||||
"modifier": 0,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -837,7 +837,7 @@
|
||||
"name": "ValidatorCount",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "u32"
|
||||
"Plain": "u32"
|
||||
},
|
||||
"fallback": "0x00000000",
|
||||
"documentation": [
|
||||
@@ -848,7 +848,7 @@
|
||||
"name": "MinimumValidatorCount",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "u32"
|
||||
"Plain": "u32"
|
||||
},
|
||||
"fallback": "0x04000000",
|
||||
"documentation": [
|
||||
@@ -859,7 +859,7 @@
|
||||
"name": "SessionsPerEra",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0xe803000000000000",
|
||||
"documentation": [
|
||||
@@ -870,7 +870,7 @@
|
||||
"name": "SessionReward",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Perbill"
|
||||
"Plain": "Perbill"
|
||||
},
|
||||
"fallback": "0x3c000000",
|
||||
"documentation": [
|
||||
@@ -881,7 +881,7 @@
|
||||
"name": "OfflineSlash",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Perbill"
|
||||
"Plain": "Perbill"
|
||||
},
|
||||
"fallback": "0x40420f00",
|
||||
"documentation": [
|
||||
@@ -892,7 +892,7 @@
|
||||
"name": "OfflineSlashGrace",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "u32"
|
||||
"Plain": "u32"
|
||||
},
|
||||
"fallback": "0x00000000",
|
||||
"documentation": [
|
||||
@@ -903,7 +903,7 @@
|
||||
"name": "BondingDuration",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0x0c00000000000000",
|
||||
"documentation": [
|
||||
@@ -914,7 +914,7 @@
|
||||
"name": "Invulnerables",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Vec<AccountId>"
|
||||
"Plain": "Vec<AccountId>"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -1025,7 +1025,7 @@
|
||||
"name": "CurrentElected",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Vec<AccountId>"
|
||||
"Plain": "Vec<AccountId>"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -1036,7 +1036,7 @@
|
||||
"name": "CurrentEra",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0x0000000000000000",
|
||||
"documentation": [
|
||||
@@ -1047,7 +1047,7 @@
|
||||
"name": "CurrentSessionReward",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -1058,7 +1058,7 @@
|
||||
"name": "CurrentEraReward",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -1070,7 +1070,7 @@
|
||||
"name": "NextSessionsPerEra",
|
||||
"modifier": 0,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -1081,7 +1081,7 @@
|
||||
"name": "LastEraLengthChange",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0x0000000000000000",
|
||||
"documentation": [
|
||||
@@ -1092,7 +1092,7 @@
|
||||
"name": "SlotStake",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -1121,7 +1121,7 @@
|
||||
"name": "ForcingNewEra",
|
||||
"modifier": 0,
|
||||
"type": {
|
||||
"Type": "Null"
|
||||
"Plain": "Null"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -1132,7 +1132,7 @@
|
||||
"name": "RecentlyOffline",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Vec<(AccountId,BlockNumber,u32)>"
|
||||
"Plain": "Vec<(AccountId,BlockNumber,u32)>"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -1410,7 +1410,7 @@
|
||||
"name": "PublicPropCount",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "PropIndex"
|
||||
"Plain": "PropIndex"
|
||||
},
|
||||
"fallback": "0x00000000",
|
||||
"documentation": [
|
||||
@@ -1421,7 +1421,7 @@
|
||||
"name": "PublicProps",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Vec<(PropIndex,Proposal,AccountId)>"
|
||||
"Plain": "Vec<(PropIndex,Proposal,AccountId)>"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -1448,7 +1448,7 @@
|
||||
"name": "ReferendumCount",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "ReferendumIndex"
|
||||
"Plain": "ReferendumIndex"
|
||||
},
|
||||
"fallback": "0x00000000",
|
||||
"documentation": [
|
||||
@@ -1459,7 +1459,7 @@
|
||||
"name": "NextTally",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "ReferendumIndex"
|
||||
"Plain": "ReferendumIndex"
|
||||
},
|
||||
"fallback": "0x00000000",
|
||||
"documentation": [
|
||||
@@ -1570,7 +1570,7 @@
|
||||
"name": "LastTabledWasExternal",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "bool"
|
||||
"Plain": "bool"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -1582,7 +1582,7 @@
|
||||
"name": "NextExternal",
|
||||
"modifier": 0,
|
||||
"type": {
|
||||
"Type": "(Proposal,VoteThreshold)"
|
||||
"Plain": "(Proposal,VoteThreshold)"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -1950,7 +1950,7 @@
|
||||
"name": "CandidacyBond",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x09000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -1961,7 +1961,7 @@
|
||||
"name": "VotingBond",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -1972,7 +1972,7 @@
|
||||
"name": "PresentSlashPerVoter",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x01000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -1983,7 +1983,7 @@
|
||||
"name": "CarryCount",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "u32"
|
||||
"Plain": "u32"
|
||||
},
|
||||
"fallback": "0x02000000",
|
||||
"documentation": [
|
||||
@@ -1994,7 +1994,7 @@
|
||||
"name": "PresentationDuration",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0xe803000000000000",
|
||||
"documentation": [
|
||||
@@ -2005,7 +2005,7 @@
|
||||
"name": "InactiveGracePeriod",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "VoteIndex"
|
||||
"Plain": "VoteIndex"
|
||||
},
|
||||
"fallback": "0x01000000",
|
||||
"documentation": [
|
||||
@@ -2017,7 +2017,7 @@
|
||||
"name": "VotingPeriod",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0xe803000000000000",
|
||||
"documentation": [
|
||||
@@ -2028,7 +2028,7 @@
|
||||
"name": "TermDuration",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0x0500000000000000",
|
||||
"documentation": [
|
||||
@@ -2039,7 +2039,7 @@
|
||||
"name": "DesiredSeats",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "u32"
|
||||
"Plain": "u32"
|
||||
},
|
||||
"fallback": "0x00000000",
|
||||
"documentation": [
|
||||
@@ -2050,7 +2050,7 @@
|
||||
"name": "ActiveCouncil",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Vec<(AccountId,BlockNumber)>"
|
||||
"Plain": "Vec<(AccountId,BlockNumber)>"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -2064,7 +2064,7 @@
|
||||
"name": "VoteCount",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "VoteIndex"
|
||||
"Plain": "VoteIndex"
|
||||
},
|
||||
"fallback": "0x00000000",
|
||||
"documentation": [
|
||||
@@ -2125,7 +2125,7 @@
|
||||
"name": "Voters",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Vec<AccountId>"
|
||||
"Plain": "Vec<AccountId>"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -2136,7 +2136,7 @@
|
||||
"name": "Candidates",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Vec<AccountId>"
|
||||
"Plain": "Vec<AccountId>"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -2147,7 +2147,7 @@
|
||||
"name": "CandidateCount",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "u32"
|
||||
"Plain": "u32"
|
||||
},
|
||||
"fallback": "0x00000000",
|
||||
"documentation": []
|
||||
@@ -2156,7 +2156,7 @@
|
||||
"name": "NextFinalize",
|
||||
"modifier": 0,
|
||||
"type": {
|
||||
"Type": "(BlockNumber,u32,Vec<AccountId>)"
|
||||
"Plain": "(BlockNumber,u32,Vec<AccountId>)"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -2167,7 +2167,7 @@
|
||||
"name": "SnapshotedStakes",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Vec<BalanceOf>"
|
||||
"Plain": "Vec<BalanceOf>"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -2178,7 +2178,7 @@
|
||||
"name": "Leaderboard",
|
||||
"modifier": 0,
|
||||
"type": {
|
||||
"Type": "Vec<(BalanceOf,AccountId)>"
|
||||
"Plain": "Vec<(BalanceOf,AccountId)>"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -2402,7 +2402,7 @@
|
||||
"name": "Proposals",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Vec<Hash>"
|
||||
"Plain": "Vec<Hash>"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -2445,7 +2445,7 @@
|
||||
"name": "ProposalCount",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "u32"
|
||||
"Plain": "u32"
|
||||
},
|
||||
"fallback": "0x00000000",
|
||||
"documentation": [
|
||||
@@ -2598,7 +2598,7 @@
|
||||
"name": "PendingChange",
|
||||
"modifier": 0,
|
||||
"type": {
|
||||
"Type": "StoredPendingChange"
|
||||
"Plain": "StoredPendingChange"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": []
|
||||
@@ -2607,7 +2607,7 @@
|
||||
"name": "NextForced",
|
||||
"modifier": 0,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": []
|
||||
@@ -2647,7 +2647,7 @@
|
||||
"name": "ProposalBond",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Permill"
|
||||
"Plain": "Permill"
|
||||
},
|
||||
"fallback": "0x00000000",
|
||||
"documentation": [
|
||||
@@ -2659,7 +2659,7 @@
|
||||
"name": "ProposalBondMinimum",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -2670,7 +2670,7 @@
|
||||
"name": "SpendPeriod",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0x0100000000000000",
|
||||
"documentation": [
|
||||
@@ -2681,7 +2681,7 @@
|
||||
"name": "Burn",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Permill"
|
||||
"Plain": "Permill"
|
||||
},
|
||||
"fallback": "0x00000000",
|
||||
"documentation": [
|
||||
@@ -2692,7 +2692,7 @@
|
||||
"name": "Pot",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -2703,7 +2703,7 @@
|
||||
"name": "ProposalCount",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "ProposalIndex"
|
||||
"Plain": "ProposalIndex"
|
||||
},
|
||||
"fallback": "0x00000000",
|
||||
"documentation": [
|
||||
@@ -2730,7 +2730,7 @@
|
||||
"name": "Approvals",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Vec<ProposalIndex>"
|
||||
"Plain": "Vec<ProposalIndex>"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"documentation": [
|
||||
@@ -2877,7 +2877,7 @@
|
||||
"name": "SignedClaimHandicap",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BlockNumber"
|
||||
"Plain": "BlockNumber"
|
||||
},
|
||||
"fallback": "0x0000000000000000",
|
||||
"documentation": [
|
||||
@@ -2891,7 +2891,7 @@
|
||||
"name": "TombstoneDeposit",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -2902,7 +2902,7 @@
|
||||
"name": "StorageSizeOffset",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "u32"
|
||||
"Plain": "u32"
|
||||
},
|
||||
"fallback": "0x00000000",
|
||||
"documentation": [
|
||||
@@ -2914,7 +2914,7 @@
|
||||
"name": "RentByteFee",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -2925,7 +2925,7 @@
|
||||
"name": "RentDepositOffset",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -2942,7 +2942,7 @@
|
||||
"name": "SurchargeReward",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -2954,7 +2954,7 @@
|
||||
"name": "TransferFee",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -2965,7 +2965,7 @@
|
||||
"name": "CreationFee",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -2976,7 +2976,7 @@
|
||||
"name": "TransactionBaseFee",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -2987,7 +2987,7 @@
|
||||
"name": "TransactionByteFee",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x00000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -2998,7 +2998,7 @@
|
||||
"name": "ContractFee",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x15000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -3009,7 +3009,7 @@
|
||||
"name": "CallBaseFee",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Gas"
|
||||
"Plain": "Gas"
|
||||
},
|
||||
"fallback": "0x8700000000000000",
|
||||
"documentation": [
|
||||
@@ -3020,7 +3020,7 @@
|
||||
"name": "CreateBaseFee",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Gas"
|
||||
"Plain": "Gas"
|
||||
},
|
||||
"fallback": "0xaf00000000000000",
|
||||
"documentation": [
|
||||
@@ -3031,7 +3031,7 @@
|
||||
"name": "GasPrice",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "BalanceOf"
|
||||
"Plain": "BalanceOf"
|
||||
},
|
||||
"fallback": "0x01000000000000000000000000000000",
|
||||
"documentation": [
|
||||
@@ -3042,7 +3042,7 @@
|
||||
"name": "MaxDepth",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "u32"
|
||||
"Plain": "u32"
|
||||
},
|
||||
"fallback": "0x64000000",
|
||||
"documentation": [
|
||||
@@ -3053,7 +3053,7 @@
|
||||
"name": "BlockGasLimit",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Gas"
|
||||
"Plain": "Gas"
|
||||
},
|
||||
"fallback": "0x8096980000000000",
|
||||
"documentation": [
|
||||
@@ -3064,7 +3064,7 @@
|
||||
"name": "GasSpent",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Gas"
|
||||
"Plain": "Gas"
|
||||
},
|
||||
"fallback": "0x0000000000000000",
|
||||
"documentation": [
|
||||
@@ -3075,7 +3075,7 @@
|
||||
"name": "CurrentSchedule",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "Schedule"
|
||||
"Plain": "Schedule"
|
||||
},
|
||||
"fallback": "0x000000000100000000000000010000000000000001000000000000000100000000000000010000000000000001000000000000000100000000000000010000000000000001000000000000000400000000000100100000000020000000",
|
||||
"documentation": [
|
||||
@@ -3118,7 +3118,7 @@
|
||||
"name": "AccountCounter",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "u64"
|
||||
"Plain": "u64"
|
||||
},
|
||||
"fallback": "0x0000000000000000",
|
||||
"documentation": [
|
||||
@@ -3358,7 +3358,7 @@
|
||||
"name": "Key",
|
||||
"modifier": 1,
|
||||
"type": {
|
||||
"Type": "AccountId"
|
||||
"Plain": "AccountId"
|
||||
},
|
||||
"fallback": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"documentation": [
|
||||
|
||||
@@ -36,8 +36,8 @@ function toStorageHasher (registry: Registry, text: Text): StorageHasher {
|
||||
*/
|
||||
function toV5StorageFunction (registry: Registry, storageFn: StorageFunctionMetadataV4): StorageFunctionMetadata {
|
||||
const { documentation, fallback, modifier, name, type } = storageFn;
|
||||
const [newType, index] = type.isPlainType
|
||||
? [type, 0]
|
||||
const [newType, index] = type.isPlain
|
||||
? [type.asPlain, 0]
|
||||
: type.isMap
|
||||
? [type.asMap, 1]
|
||||
: [createType(registry, 'DoubleMapTypeV5', {
|
||||
|
||||
Reference in New Issue
Block a user