Apply Crust types package and add DCF provider (#4861)

* Fix abnormal account type

* Fix crust logo invisible

* Add Crust Rococo V1 Endpoint

* Upgrade to Crust Maxwell

* Apply crust type package and add DCF provider
This commit is contained in:
Kun 2021-03-16 15:57:00 +08:00 committed by GitHub
parent b51c7978e3
commit 10b4bf282c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 170 deletions

View File

@ -12,6 +12,7 @@
"dependencies": {
"@acala-network/type-definitions": "^0.7.1",
"@babel/runtime": "^7.13.10",
"@crustio/type-definitions": "0.0.5",
"@darwinia/types": "^1.1.0-alpha.1",
"@edgeware/node-types": "^3.3.2",
"@interlay/polkabtc-types": "^0.5.3",

View File

@ -1,88 +0,0 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { OverrideBundleDefinition } from '@polkadot/types/types';
// structs need to be in order
/* eslint-disable sort-keys */
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
AddressInfo: 'Vec<u8>',
FileAlias: 'Vec<u8>',
Guarantee: {
targets: 'Vec<IndividualExposure<AccountId, Balance>>',
total: 'Compact<Balance>',
submitted_in: 'EraIndex',
suppressed: 'bool'
},
IASSig: 'Vec<u8>',
Identity: {
pub_key: 'Vec<u8>',
code: 'Vec<u8>'
},
ISVBody: 'Vec<u8>',
LookupSource: 'AccountId',
MerchantInfo: {
address: 'Vec<u8>',
storage_price: 'Balance',
file_map: 'Vec<(Vec<u8>, Vec<Hash>)>'
},
MerchantPunishment: {
success: 'EraIndex',
failed: 'EraIndex',
value: 'Balance'
},
MerkleRoot: 'Vec<u8>',
OrderStatus: {
_enum: ['Success', 'Failed', 'Pending']
},
PaymentLedger: {
total: 'Balance',
paid: 'Balance',
unreserved: 'Balance'
},
Pledge: {
total: 'Balance',
used: 'Balance'
},
ReportSlot: 'u64',
Releases: {
_enum: ['V1_0_0', 'V2_0_0']
},
Status: {
_enum: ['Free', 'Reserved']
},
StorageOrder: {
file_identifier: 'Vec<u8>',
file_size: 'u64',
created_on: 'BlockNumber',
completed_on: 'BlockNumber',
expired_on: 'BlockNumber',
provider: 'AccountId',
client: 'AccountId',
amount: 'Balance',
order_status: 'OrderStatus'
},
SworkerCert: 'Vec<u8>',
SworkerCode: 'Vec<u8>',
SworkerPubKey: 'Vec<u8>',
SworkerSignature: 'Vec<u8>',
WorkReport: {
block_number: 'u64',
used: 'u64',
reserved: 'u64',
cached_reserved: 'u64',
files: 'Vec<(Vec<u8>, u64)>'
}
}
}
]
};
export default definitions;

View File

@ -3,83 +3,6 @@
import type { OverrideBundleDefinition } from '@polkadot/types/types';
// structs need to be in order
/* eslint-disable sort-keys */
import { typesBundleForPolkadot } from '@crustio/type-definitions';
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
AddressInfo: 'Vec<u8>',
ETHAddress: 'Vec<u8>',
EthereumTxHash: 'H256',
FileAlias: 'Vec<u8>',
FileInfo: {
file_size: 'u64',
expired_on: 'BlockNumber',
claimed_at: 'BlockNumber',
amount: 'Balance',
expected_replica_count: 'u32',
reported_replica_count: 'u32',
replicas: 'Vec<Replica<AccountId>>'
},
Guarantee: {
targets: 'Vec<IndividualExposure<AccountId, Balance>>',
total: 'Compact<Balance>',
submitted_in: 'EraIndex',
suppressed: 'bool'
},
IASSig: 'Vec<u8>',
Identity: {
anchor: 'SworkerAnchor',
punishment_deadline: 'u64',
group: 'Option<AccountId>'
},
ISVBody: 'Vec<u8>',
LookupSource: 'AccountId',
MerchantLedger: {
reward: 'Balance',
pledge: 'Balance'
},
MerkleRoot: 'Vec<u8>',
ReportSlot: 'u64',
Replica: {
who: 'AccountId',
valid_at: 'BlockNumber',
anchor: 'SworkerAnchor',
is_reported: 'bool'
},
PKInfo: {
code: 'SworkerCode',
anchor: 'Option<SworkerAnchor>'
},
Status: {
_enum: ['Free', 'Reserved']
},
SworkerAnchor: 'Vec<u8>',
SworkerCert: 'Vec<u8>',
SworkerCode: 'Vec<u8>',
SworkerPubKey: 'Vec<u8>',
SworkerSignature: 'Vec<u8>',
UsedInfo: {
used_size: 'u64',
reported_group_count: 'u32',
groups: 'BTreeMap<SworkerAnchor, bool>'
},
WorkReport: {
report_slot: 'u64',
used: 'u64',
free: 'u64',
reported_files_size: 'u64',
reported_srd_root: 'MerkleRoot',
reported_files_root: 'MerkleRoot'
}
}
}
]
};
export default definitions;
export default typesBundleForPolkadot.spec.crust as unknown as OverrideBundleDefinition;

View File

@ -15,7 +15,6 @@ import clover from './clover';
import cloverRococo from './clover-rococo';
import crab from './crab';
import crust from './crust';
import crustParachain from './crust-parachain';
import testPara from './cumulus-test-parachain';
import darwinia from './darwinia';
import darwiniaParachain from './darwinia-parachain';
@ -80,7 +79,7 @@ const spec: Record<string, OverrideBundleDefinition> = {
clover,
'clover-rococo': cloverRococo,
crust,
'crust-parachain': crustParachain,
'crust-parachain': crust,
'cumulus-test-parachain': testPara,
'darwinia-parachain': darwiniaParachain,
'datahighway-parachain': datahighwayParachain,

View File

@ -70,7 +70,8 @@ export function createTesting (t: TFunction): LinkOption[] {
info: 'crust',
text: t('rpc.crust.network', 'Crust Maxwell', { ns: 'apps-config' }),
providers: {
'Crust Network': 'wss://api.crust.network/'
'Crust Network': 'wss://api.crust.network/',
'DCloud Foundation': 'wss://api.decloudf.com/'
}
},
{

View File

@ -1398,6 +1398,15 @@ __metadata:
languageName: node
linkType: hard
"@crustio/type-definitions@npm:0.0.5":
version: 0.0.5
resolution: "@crustio/type-definitions@npm:0.0.5"
dependencies:
"@open-web3/orml-type-definitions": ^0.8.2-9
checksum: 849813ac540f3a406555b99dd2a3439c279810275ca28881e8efd95604cce5800bb49644d5ccb0318aecb48f2f7cb4cf0b362198186edbf0d49816882e24414c
languageName: node
linkType: hard
"@darwinia/types-known@npm:^1.1.0-alpha.1":
version: 1.1.0-alpha.1
resolution: "@darwinia/types-known@npm:1.1.0-alpha.1"
@ -2371,6 +2380,7 @@ __metadata:
dependencies:
"@acala-network/type-definitions": ^0.7.1
"@babel/runtime": ^7.13.10
"@crustio/type-definitions": 0.0.5
"@darwinia/types": ^1.1.0-alpha.1
"@edgeware/node-types": ^3.3.2
"@interlay/polkabtc-types": ^0.5.3