Skip to content

Commit

Permalink
Fix several issues
Browse files Browse the repository at this point in the history
  • Loading branch information
crypto-matto committed Feb 15, 2023
1 parent ea7478e commit 6977255
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/config/StaticConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ export const MainNetConfig: WalletConfig = {
enabled: true,
name: NetworkName.MAINNET,
derivationPath: 'm/44\'/394\'/0\'/0/0',
nodeUrl: CroNetwork.Mainnet.defaultNodeUrl,
nodeUrl: 'https://rpc.mainnet.crypto.org',
explorer: {
baseUrl: 'https://crypto.org/explorer',
tx: 'https://crypto.org/explorer/tx',
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/home/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ function HomeLayout(props: HomeLayoutProps) {
key: '/assets',
icon: <Icon component={IconAssets} />,
},
(!isTestnet || session.activeAsset?.config?.tendermintNetwork?.chainId === 'testnet-croeseid-4')
(!isTestnet || session.wallet.config.network.chainId === 'testnet-croeseid-4')
? {
label: conditionalLink('/bridge', t('navbar.bridge')),
key: '/bridge',
Expand Down
10 changes: 6 additions & 4 deletions src/pages/create/components/LedgerAddressIndexBalanceTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,13 @@ const LedgerAddressIndexBalanceTable = (props: {
setLoading(true);
switch (`${assetType}-${chainName}`) {
case `${UserAssetType.TENDERMINT}-${SupportedChainName.CRYPTO_ORG}`: {
const nodeUrl = isTestnet
? DefaultWalletConfigs.TestNetCroeseid5Config.nodeUrl
: DefaultWalletConfigs.MainNetConfig.nodeUrl;
const config = isTestnet
? DefaultWalletConfigs.TestNetCroeseid5Config
: DefaultWalletConfigs.MainNetConfig;
const nodeRpc = await NodeRpcService.init({
baseUrl: nodeUrl,
baseUrl: config.nodeUrl,
clientUrl: config.tendermintNetwork?.node?.clientUrl,
proxyUrl: config.tendermintNetwork?.node?.proxyUrl,
});
await Promise.all(
ledgerAccountList.map(async account => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/create/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const FormCustomConfig: React.FC<FormCustomConfigProps> = (props) => {
setCheckingNodeConnection(true);
const { nodeUrl } = values;
const isNodeLive = await walletService.checkNodeIsLive(
`${nodeUrl}${NodePorts.Tendermint}`,
`${nodeUrl}`,
);
setCheckingNodeConnection(false);

Expand Down
8 changes: 6 additions & 2 deletions tests/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,18 @@ async function main() {
await signerProvider.provider.initChain();
await Zemu.default.sleep(SLEEP_MS);
const walletConfig = CustomDevNet;
walletConfig.nodeUrl = 'http://127.0.0.1:26657';
// walletConfig.nodeUrl = 'http://127.0.0.1:26657';
const signer = new LedgerTransactionSigner(walletConfig, signerProvider, 0, DerivationPathStandard.BIP44);
console.log(signer);

const phrase = '';
signerProvider.provider.setClickTimes(7);
const ledgerAddress = 'cro1tzhdkuc328cgh2hycyfddtdpqfwwu42yq3qgkr';
const nodeRpc = await NodeRpcService.init({ baseUrl: walletConfig.nodeUrl });
const nodeRpc = await NodeRpcService.init({
baseUrl: 'http://127.0.0.1:26657',
clientUrl: 'http://127.0.0.1:26657',
proxyUrl: 'http://127.0.0.1:1337',
});
await Zemu.default.sleep(SLEEP_MS);
const accountNumber = await nodeRpc.fetchAccountNumber(ledgerAddress);
console.log('get account number ', accountNumber);
Expand Down

0 comments on commit 6977255

Please sign in to comment.