Skip to content

Commit

Permalink
fixup! feat(connect): use network shortcut not just symbol for identi…
Browse files Browse the repository at this point in the history
…fication
  • Loading branch information
tomasklim committed Dec 11, 2024
1 parent fabf1d7 commit c67a46b
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions packages/connect/src/backend/Blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ const getNormalizedTrezorShortcut = (shortcut: string) => {
return 'XRP';
}

if (['OP', 'BASE'].includes(shortcut)) {
return 'ETH';
}

return shortcut;
};

Expand Down Expand Up @@ -132,18 +128,10 @@ export class Blockchain {

this.serverInfo = info;

const trezorShortcut = getNormalizedTrezorShortcut(this.coinInfo.shortcut);

// TODO: remove of change
// const backendShortcut = this.serverInfo.shortcut;
// if (trezorShortcut.toLowerCase() !== backendShortcut.toLowerCase()) {
const trezorNetworkShortcut = getNormalizedTrezorShortcut(this.coinInfo.shortcut);
const backendNetworkShortcut = this.serverInfo.network;

if (
(this.coinInfo.type === 'ethereum' &&
info.network.toLowerCase() !== this.coinInfo.chain?.toLowerCase()) ||
(this.coinInfo.type !== 'ethereum' &&
info.network.toLowerCase() !== trezorShortcut.toLowerCase())
) {
if (backendNetworkShortcut.toLowerCase() !== trezorNetworkShortcut.toLowerCase()) {
throw ERRORS.TypedError('Backend_Invalid');
}

Expand Down

0 comments on commit c67a46b

Please sign in to comment.