Alias &[u8] to Bytes (#1171)

* Alias &[u8] to Bytes

* Add metadata, fix RegEx for &[u8]
This commit is contained in:
Jaco Greeff
2019-07-24 11:46:38 +02:00
committed by GitHub
parent 46796a7ce8
commit fcaa7a50e4
4 changed files with 74 additions and 3 deletions
@@ -1399,6 +1399,46 @@
" The queued keys for the next session. When the next session begins, these keys",
" will be used to determine the validator's session keys."
]
},
{
"name": "NextKeys",
"modifier": "Optional",
"type": {
"DoubleMapType": {
"hasher": "Twox64Concat",
"key1": "Bytes",
"key2": "ValidatorId",
"value": "Keys",
"key2Hasher": "Blake2_256"
}
},
"fallback": "0x00",
"documentation": [
" The next session keys for a validator.",
"",
" The first key is always `DEDUP_KEY_PREFIX` to have all the data in the same branch of",
" the trie. Having all data in the same branch should prevent slowing down other queries."
]
},
{
"name": "KeyOwner",
"modifier": "Optional",
"type": {
"DoubleMapType": {
"hasher": "Twox64Concat",
"key1": "Bytes",
"key2": "(KeyTypeId,Bytes)",
"value": "ValidatorId",
"key2Hasher": "Blake2_256"
}
},
"fallback": "0x00",
"documentation": [
" The owner of a key. The second key is the `KeyTypeId` + the encoded key.",
"",
" The first key is always `DEDUP_KEY_PREFIX` to have all the data in the same branch of",
" the trie. Having all data in the same branch should prevent slowing down other queries."
]
}
],
"calls": [
@@ -1440,7 +1480,17 @@
]
}
],
"constants": []
"constants": [
{
"name": "DEDUP_KEY_PREFIX",
"type": "Bytes",
"value": "0x343a73657373696f6e3a6b657973",
"documentation": [
" Used as first key for `NextKeys` and `KeyOwner` to put all the data into the same branch",
" of the trie."
]
}
]
},
{
"name": "democracy",
@@ -3090,6 +3140,22 @@
" increment step `t`. 0 will result in no weight being added at all (normal",
" approval voting). A reasonable default value is 24."
]
},
{
"name": "VOTER_SET_SIZE",
"type": "u32",
"value": "0x40000000",
"documentation": [
" The chunk size of the voter vector."
]
},
{
"name": "APPROVAL_SET_SIZE",
"type": "u32",
"value": "0x08000000",
"documentation": [
" The chunk size of the approval vector."
]
}
]
},
File diff suppressed because one or more lines are too long
+2
View File
@@ -57,6 +57,8 @@ export default class Type extends Text {
Type._alias('Compact<Index>', 'IndexCompact'),
// alias Vec<u8> -> Bytes
Type._alias('Vec<u8>', 'Bytes'),
// alias &[u8] -> Bytes
Type._alias('&\\[u8\\]', 'Bytes'),
// alias RawAddress -> Address
Type._alias('RawAddress', 'Address'),
// alias Lookup::Source to Address (_could_ be AccountId on certain chains)
@@ -9,6 +9,9 @@ export default {
SessionKeys: {
ed25519: 'SessionKey'
},
Keys: 'SessionKeys'
Keys: 'SessionKeys',
// this needs to be moved to primitives (runtime, support)
KeyTypeId: 'u32'
}
};