Skip to content

Commit

Permalink
factory test
Browse files Browse the repository at this point in the history
  • Loading branch information
pyramation committed Dec 14, 2023
1 parent 899f598 commit 8982221
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 0 deletions.
55 changes: 55 additions & 0 deletions packages/keplr/__tests__/__snapshots__/factory-tokens.test.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`config 1`] = `
{
"bech32Config": {
"bech32PrefixAccAddr": "pryzm",
"bech32PrefixAccPub": "pryzmpub",
"bech32PrefixConsAddr": "pryzmvalcons",
"bech32PrefixConsPub": "pryzmvalconspub",
"bech32PrefixValAddr": "pryzmvaloper",
"bech32PrefixValPub": "pryzmvaloperpub",
},
"bip44": {
"coinType": 118,
},
"chainId": "PRYZM_CHAIN_ID",
"chainName": "Pryzm Testnet",
"currencies": [
{
"coinDecimals": 6,
"coinDenom": "PRYZM",
"coinGeckoId": "pryzm",
"coinImageUrl": "https://raw.githubusercontent.com/cosmos/chain-registry/master/prism/images/prism-token.svg",
"coinMinimalDenom": "upryzm",
},
],
"features": [
"stargate",
"ibc-transfer",
],
"feeCurrencies": [
{
"coinDecimals": 6,
"coinDenom": "PRYZM",
"coinGeckoId": "pryzm",
"coinImageUrl": "https://raw.githubusercontent.com/cosmos/chain-registry/master/prism/images/prism-token.svg",
"coinMinimalDenom": "upryzm",
"gasPriceStep": {
"average": 0,
"high": 0.01,
"low": 0,
},
},
],
"rest": "",
"rpc": "",
"stakeCurrency": {
"coinDecimals": 6,
"coinDenom": "PRYZM",
"coinGeckoId": "pryzm",
"coinImageUrl": "https://raw.githubusercontent.com/cosmos/chain-registry/master/prism/images/prism-token.svg",
"coinMinimalDenom": "upryzm",
},
}
`;
73 changes: 73 additions & 0 deletions packages/keplr/__tests__/factory-tokens.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import { chainRegistryChainToKeplr } from '@chain-registry/keplr';
import { AssetList, Chain } from '@chain-registry/types';
import { ChainInfo } from '@keplr-wallet/types';

const chain: Chain = {
chain_name: 'PRYZM_CHAIN_NAME',
chain_id: 'PRYZM_CHAIN_ID',
status: 'development',
network_type: 'testnet',
pretty_name: 'Pryzm Testnet',
bech32_prefix: 'pryzm',
slip44: 118,
staking: {
staking_tokens: [
{
denom: 'upryzm'
}
]
},
fees: {
fee_tokens: [
{
denom: 'upryzm',
fixed_min_gas_price: 0,
low_gas_price: 0,
average_gas_price: 0,
high_gas_price: 0.01
},
{
denom: 'factory/pryzm15k9s9p0ar0cx27nayrgk6vmhyec3lj7vkry7rx/uusdsim',
fixed_min_gas_price: 0,
low_gas_price: 0,
average_gas_price: 0,
high_gas_price: 0.01
}
]
}
};

const assets: AssetList = {
chain_name: 'PRYZM_CHAIN_NAME',
assets: [
{
description: 'Pryzm token',
denom_units: [
{
denom: 'upryzm',
exponent: 0
},
{
denom: 'pryzm',
exponent: 6
}
],
base: 'upryzm',
name: 'Pryzm',
display: 'pryzm',
symbol: 'PRYZM',
logo_URIs: {
png: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/prism/images/prism-token.png',
svg: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/prism/images/prism-token.svg'
},
coingecko_id: 'pryzm'
}
]
};

const config: ChainInfo = chainRegistryChainToKeplr(chain, [assets]);

it('config', () => {
// console.log(config);
expect(config).toMatchSnapshot();
});

0 comments on commit 8982221

Please sign in to comment.