forked from polkadot-js/apps
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from Cerebellum-Network/feature/add-type-bundl…
…e-for-cere-mainnet Add auto generation of Cere Network type bundle.
- Loading branch information
Showing
4 changed files
with
110 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,82 @@ | ||
// Copyright 2017-2021 @polkadot/apps-config authors & contributors | ||
// Copyright 2017-2023 @polkadot/apps-config authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// structs need to be in order | ||
/* eslint-disable sort-keys */ | ||
import type { OverrideBundleDefinition } from '@polkadot/types/types'; | ||
|
||
export default { | ||
ChainId: 'u8', | ||
DepositNonce: 'u64', | ||
ResourceId: '[u8; 32]', | ||
ProposalStatus: { | ||
_enum: ['Initiated', 'Approved', 'Rejected'] | ||
}, | ||
ProposalVotes: { | ||
votes_for: 'Vec<AccountId>', | ||
votes_against: 'Vec<AccountId>', | ||
status: 'ProposalStatus', | ||
expiry: 'BlockNumber' | ||
}, | ||
TokenId: 'u256', | ||
Erc721Token: { | ||
id: 'TokenId', | ||
metadata: 'Vec<u8>' | ||
}, | ||
Address: 'MultiAddress', | ||
LookupSource: 'MultiAddress', | ||
AccountInfo: 'AccountInfoWithDualRefCount' | ||
const definitions: OverrideBundleDefinition = { | ||
types: [ | ||
{ | ||
minmax: [ | ||
266, | ||
281 | ||
], | ||
types: { | ||
ChainId: 'u8', | ||
DepositNonce: 'u64', | ||
ResourceId: '[u8; 32]', | ||
ProposalStatus: { | ||
_enum: [ | ||
'Initiated', | ||
'Approved', | ||
'Rejected' | ||
] | ||
}, | ||
ProposalVotes: { | ||
votes_for: 'Vec<AccountId>', | ||
votes_against: 'Vec<AccountId>', | ||
status: 'ProposalStatus', | ||
expiry: 'BlockNumber' | ||
}, | ||
TokenId: 'u256', | ||
Erc721Token: { | ||
id: 'TokenId', | ||
metadata: 'Vec<u8>' | ||
}, | ||
Address: 'IndicesLookupSource', | ||
LookupSource: 'IndicesLookupSource', | ||
AccountInfo: 'AccountInfoWithDualRefCount', | ||
ValidatorPrefs: { | ||
commission: 'Compact<Perbill>' | ||
} | ||
} | ||
}, | ||
{ | ||
minmax: [ | ||
282, | ||
294 | ||
], | ||
types: { | ||
ChainId: 'u8', | ||
DepositNonce: 'u64', | ||
ResourceId: '[u8; 32]', | ||
ProposalStatus: { | ||
_enum: [ | ||
'Initiated', | ||
'Approved', | ||
'Rejected' | ||
] | ||
}, | ||
ProposalVotes: { | ||
votes_for: 'Vec<AccountId>', | ||
votes_against: 'Vec<AccountId>', | ||
status: 'ProposalStatus', | ||
expiry: 'BlockNumber' | ||
}, | ||
TokenId: 'u256', | ||
Erc721Token: { | ||
id: 'TokenId', | ||
metadata: 'Vec<u8>' | ||
}, | ||
Address: 'MultiAddress', | ||
LookupSource: 'MultiAddress', | ||
AccountInfo: 'AccountInfoWithDualRefCount' | ||
} | ||
}, | ||
{ | ||
minmax: [295, null], | ||
types: {} | ||
} | ||
] | ||
}; | ||
|
||
export default definitions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright 2017-2023 @polkadot/apps-config authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import type { OverrideBundleDefinition } from '@polkadot/types/types'; | ||
|
||
import cere from './cere.js'; | ||
|
||
// NOTE: The mapping is done from chain name in system.chain | ||
const chain: Record<string, OverrideBundleDefinition> = { | ||
'Cere Mainnet Beta': cere | ||
}; | ||
|
||
export default chain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters