Dedupe parachain types (#3043)

* Updata parachain types

* Remove duplication

* hrmp update
This commit is contained in:
Jaco Greeff
2021-01-12 14:46:57 +01:00
committed by GitHub
parent 70c011e7e2
commit 2dfb0fb59a
2 changed files with 43 additions and 38 deletions
+2 -1
View File
@@ -37,7 +37,8 @@ const versioned: OverrideVersionedType[] = [
minmax: [13, 13],
types: {
...sharedTypes,
HostConfig: 'HostConfigurationTo13'
HostConfig: 'HostConfigurationTo13',
HrmpChannel: 'HrmpChannelTo13'
}
},
{
@@ -8,13 +8,14 @@ import type { Definitions } from '../../types';
const SLOT_RANGE_COUNT = 10;
// proposeParachain
const proposeTypes = {
ParachainProposal: {
proposer: 'AccountId',
validationFunction: 'ValidationCode',
initialHeadState: 'HeadData',
validationCode: 'ValidationCode',
genesisHead: 'HeadData',
validators: 'Vec<ValidatorId>',
name: 'Vec<u8>',
name: 'Bytes',
balance: 'Balance'
},
RegisteredParachainInfo: {
@@ -23,10 +24,47 @@ const proposeTypes = {
}
};
// hrmp
const hrmpTypes = {
HrmpChannelTo13: {
senderDeposit: 'Balance',
recipientDeposit: 'Balance',
maxCapacity: 'u32',
maxTotalSize: 'u32',
maxMessageSize: 'u32',
msgCount: 'u32',
totalSize: 'u32',
mqcHead: 'Option<Hash>'
},
HrmpChannel: {
maxCapacity: 'u32',
maxTotalSize: 'u32',
maxMessageSize: 'u32',
msgCount: 'u32',
totalSize: 'u32',
mqcHead: 'Option<Hash>',
senderDeposit: 'Balance',
recipientDeposit: 'Balance'
},
HrmpChannelId: {
sender: 'u32',
receiver: 'u32'
},
HrmpOpenChannelRequest: {
confirmed: 'bool',
age: 'SessionIndex',
senderDeposit: 'Balance',
maxMessageSize: 'u32',
maxCapacity: 'u32',
maxTotalSize: 'u32'
}
};
export default {
rpc: {},
types: {
...proposeTypes,
...hrmpTypes,
AbridgedCandidateReceipt: {
parachainIndex: 'ParaId',
relayParent: 'Hash',
@@ -232,28 +270,6 @@ export default {
hrmpMaxParathreadOutboundChannels: 'u32',
hrmpMaxMessageNumPerCandidate: 'u32'
},
HrmpChannel: {
senderDeposit: 'Balance',
recipientDeposit: 'Balance',
maxCapacity: 'u32',
maxTotalSize: 'u32',
maxMessageSize: 'u32',
msgCount: 'u32',
totalSize: 'u32',
mqcHead: 'Option<Hash>'
},
HrmpChannelId: {
sender: 'u32',
receiver: 'u32'
},
HrmpOpenChannelRequest: {
confirmed: 'bool',
age: 'SessionIndex',
senderDeposit: 'Balance',
maxMessageSize: 'u32',
maxCapacity: 'u32',
maxTotalSize: 'u32'
},
InboundDownwardMessage: {
pubSentAt: 'BlockNumber',
pubMsg: 'DownwardMessage'
@@ -301,14 +317,6 @@ export default {
ParachainDispatchOrigin: {
_enum: ['Signed', 'Parachain', 'Root']
},
ParachainProposal: {
proposer: 'AccountId',
validationCode: 'ValidationCode',
genesisHead: 'HeadData',
validators: 'Vec<ValidatorId>',
name: 'Bytes',
balance: 'Balance'
},
ParaGenesisArgs: {
genesisHead: 'Bytes',
validationCode: 'Bytes',
@@ -341,10 +349,6 @@ export default {
dmqMqcHead: 'Hash',
maxPovSize: 'u32'
},
RegisteredParachainInfo: {
validators: 'Vec<ValidatorId>',
proposer: 'AccountId'
},
RelayChainBlockNumber: 'BlockNumber',
QueuedParathread: {
claim: 'ParathreadEntry',