Commit 66428c97 authored by Thibaut Sardan's avatar Thibaut Sardan Committed by YJ
Browse files

add kusama dev and update metadata (#437)

parent 5d9f8247
Pipeline #55223 failed with stage
in 2 minutes and 2 seconds
......@@ -47,9 +47,11 @@ export default class PayloadDetailsCard extends React.PureComponent {
constructor(props) {
super(props);
// KUSAMA and KUSAMA_DEV have the same metadata and Defaults values
const isKusama =
this.props.prefix ===
SUBSTRATE_NETWORK_LIST[SubstrateNetworkKeys.KUSAMA].prefix;
SUBSTRATE_NETWORK_LIST[SubstrateNetworkKeys.KUSAMA].prefix ||
SUBSTRATE_NETWORK_LIST[SubstrateNetworkKeys.KUSAMA_DEV].prefix;
const isSubstrateDev =
this.props.prefix ===
SUBSTRATE_NETWORK_LIST[SubstrateNetworkKeys.SUBSTRATE_DEV].prefix;
......
......@@ -26,6 +26,8 @@ export const EthereumNetworkKeys = Object.freeze({
// genesisHash is used as Network key for Substrate networks
export const SubstrateNetworkKeys = Object.freeze({
KUSAMA: '0xe3777fa922cafbff200cadeaea1a76bd7898ad5b89f7848999058b50e715f636', // https://polkascan.io/pre/kusama-cc2/block/0
KUSAMA_DEV:
'0xd0861d14ebd971da92298f729e46706216377356b0a196978d054972620f298d',
SUBSTRATE_DEV:
'0xa9b086bbadc5cedd43e0f8a686de18f0bc010cd88d4b46d2f75ae5a540bf460d' // substrate --dev commit ac6a2a783f0e1f4a814cf2add40275730cd41be1 hosted on wss://dev-node.substrate.dev .
});
......@@ -48,6 +50,14 @@ const substrateNetworkBase = {
title: 'Kusama CC2',
unit: 'KSM'
},
[SubstrateNetworkKeys.KUSAMA_DEV]: {
color: '#4C4646',
decimals: 12,
genesisHash: SubstrateNetworkKeys.KUSAMA_DEV,
prefix: 2,
title: 'Kusama Development',
unit: 'KSM'
},
[SubstrateNetworkKeys.SUBSTRATE_DEV]: {
color: '#ff8c00',
decimals: 15,
......
......@@ -50,17 +50,18 @@ class AccountNetworkChooserView extends React.PureComponent {
render() {
const { navigation } = this.props;
const { accounts } = this.props;
const excludedNetworks = [UnknownNetworkKeys.UNKNOWN];
if (!__DEV__) {
excludedNetworks.push(SubstrateNetworkKeys.SUBSTRATE_DEV);
excludedNetworks.push(SubstrateNetworkKeys.KUSAMA_DEV);
}
return (
<ScrollView style={styles.body} contentContainerStyle={{ padding: 20 }}>
<Text style={styles.title}>CHOOSE NETWORK</Text>
{Object.entries(NETWORK_LIST)
.filter(
([networkKey]) =>
(__DEV__ && networkKey !== UnknownNetworkKeys.UNKNOWN) ||
(networkKey !== SubstrateNetworkKeys.SUBSTRATE_DEV &&
networkKey !== UnknownNetworkKeys.UNKNOWN)
)
.filter(([networkKey]) => !excludedNetworks.includes(networkKey))
.map(([networkKey, networkParams]) => (
<TouchableItem
key={networkKey}
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment