From a42e0f371dabb2db84555d59e3a252816bc0a006 Mon Sep 17 00:00:00 2001 From: Kun Date: Mon, 25 Jan 2021 22:25:18 +0800 Subject: [PATCH] Upgrade Crust Maxwell (#4494) * Fix abnormal account type * Fix crust logo invisible * Add Crust Rococo V1 Endpoint * Upgrade to Crust Maxwell --- packages/apps-config/src/api/spec/crust.ts | 74 +++++++++---------- packages/apps-config/src/endpoints/testing.ts | 2 +- packages/apps-config/src/links/subscan.ts | 2 +- packages/apps-config/src/ui/colors.ts | 2 +- .../apps/public/locales/en/apps-config.json | 2 +- .../apps/public/locales/fr/translation.json | 2 +- 6 files changed, 39 insertions(+), 45 deletions(-) diff --git a/packages/apps-config/src/api/spec/crust.ts b/packages/apps-config/src/api/spec/crust.ts index 250eddf1ab..9d41bbcca4 100644 --- a/packages/apps-config/src/api/spec/crust.ts +++ b/packages/apps-config/src/api/spec/crust.ts @@ -7,7 +7,18 @@ export default { Address: 'AccountId', AddressInfo: 'Vec', + ETHAddress: 'Vec', + EthereumTxHash: 'H256', FileAlias: 'Vec', + FileInfo: { + file_size: 'u64', + expired_on: 'BlockNumber', + claimed_at: 'BlockNumber', + amount: 'Balance', + expected_replica_count: 'u32', + reported_replica_count: 'u32', + replicas: 'Vec>' + }, Guarantee: { targets: 'Vec>', total: 'Compact', @@ -16,61 +27,44 @@ export default { }, IASSig: 'Vec', Identity: { - pub_key: 'Vec', - code: 'Vec' + anchor: 'SworkerAnchor', + group: 'Option' }, ISVBody: 'Vec', LookupSource: 'AccountId', - MerchantInfo: { - address: 'Vec', - storage_price: 'Balance', - file_map: 'Vec<(Vec, Vec)>' - }, - MerchantPunishment: { - success: 'EraIndex', - failed: 'EraIndex', - value: 'Balance' + MerchantLedger: { + reward: 'Balance', + pledge: 'Balance' }, MerkleRoot: 'Vec', - 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'] + Replica: { + who: 'AccountId', + valid_at: 'BlockNumber', + anchor: 'SworkerAnchor' + }, + PKInfo: { + code: 'SworkerCode', + anchor: 'Option' }, Status: { _enum: ['Free', 'Reserved'] }, - StorageOrder: { - file_identifier: 'Vec', - file_size: 'u64', - created_on: 'BlockNumber', - completed_on: 'BlockNumber', - expired_on: 'BlockNumber', - provider: 'AccountId', - client: 'AccountId', - amount: 'Balance', - order_status: 'OrderStatus' - }, + SworkerAnchor: 'Vec', SworkerCert: 'Vec', SworkerCode: 'Vec', SworkerPubKey: 'Vec', SworkerSignature: 'Vec', + UsedInfo: { + used_size: 'u64', + groups: 'BTreeSet' + }, WorkReport: { - block_number: 'u64', + report_slot: 'u64', used: 'u64', - reserved: 'u64', - cached_reserved: 'u64', - files: 'Vec<(Vec, u64)>' + free: 'u64', + reported_files_size: 'u64', + reported_srd_root: 'MerkleRoot', + reported_files_root: 'MerkleRoot' } }; diff --git a/packages/apps-config/src/endpoints/testing.ts b/packages/apps-config/src/endpoints/testing.ts index 21e66f9a14..047ee58f4f 100644 --- a/packages/apps-config/src/endpoints/testing.ts +++ b/packages/apps-config/src/endpoints/testing.ts @@ -64,7 +64,7 @@ export function createTesting (t: TFunction): LinkOption[] { }, { info: 'crust', - text: t('rpc.crust.network', 'Crust Maxwell CC2', { ns: 'apps-config' }), + text: t('rpc.crust.network', 'Crust Maxwell', { ns: 'apps-config' }), providers: { 'Crust Network': 'wss://api.crust.network/' } diff --git a/packages/apps-config/src/links/subscan.ts b/packages/apps-config/src/links/subscan.ts index e2c1df56af..fd0b4d3610 100644 --- a/packages/apps-config/src/links/subscan.ts +++ b/packages/apps-config/src/links/subscan.ts @@ -11,7 +11,7 @@ export default { 'Bifrost Asgard Nightly': 'bitfrost', 'Centrifuge Mainnet': 'centrifuge', ChainX: 'chainx', - 'Crust Maxwell CC2': 'crust', + 'Crust Maxwell': 'crust', 'Darwinia CC1': 'darwinia-cc1', 'Darwinia Crab': 'crab', Edgeware: 'edgeware', diff --git a/packages/apps-config/src/ui/colors.ts b/packages/apps-config/src/ui/colors.ts index 5b88bd5d84..ad75ee9c3d 100644 --- a/packages/apps-config/src/ui/colors.ts +++ b/packages/apps-config/src/ui/colors.ts @@ -65,7 +65,7 @@ export const chainColors: Record = [ ['Bit.Country Tewai Chain', chainBitCountry], ['Bifrost PC1', chainRoccoBifrost], ['Darwinia Crab', chainCrab], - ['crust maxwell cc2', chainCrust], + ['crust maxwell', chainCrust], ['Crust PC1', chainCrust], ['darwinia cc1', chainDarwinia], ['Darwinia PC2', chainRoccoDarwinia], diff --git a/packages/apps/public/locales/en/apps-config.json b/packages/apps/public/locales/en/apps-config.json index 44c86b8ceb..44cdf49014 100644 --- a/packages/apps/public/locales/en/apps-config.json +++ b/packages/apps/public/locales/en/apps-config.json @@ -8,7 +8,7 @@ "rpc.canvas": "Canvas", "rpc.centrifuge": "Centrifuge", "rpc.crab": "Darwinia Crab", - "rpc.crust.network": "Crust Maxwell CC2", + "rpc.crust.network": "Crust Maxwell", "rpc.custom": "Custom environment", "rpc.custom.entry": "Custom {{WS_URL}}", "rpc.custom.own": "Custom", diff --git a/packages/apps/public/locales/fr/translation.json b/packages/apps/public/locales/fr/translation.json index 464a094029..bb93e71e99 100644 --- a/packages/apps/public/locales/fr/translation.json +++ b/packages/apps/public/locales/fr/translation.json @@ -1294,7 +1294,7 @@ "rpc.canvas": "Canvas", "rpc.centrifuge": "Centrifuge", "rpc.crab": "Darwinia Crab", - "rpc.crust.network": "Crust Maxwell CC2", + "rpc.crust.network": "Crust Maxwell", "rpc.custom": "Environment personnalisé", "rpc.custom.entry": "Personalisé {{WS_URL}}", "rpc.custom.own": "Personalisé",