* 3.1.2

* Remove assert usage

* Unsubscribe on open observable

* Attempt a clear

* Final attempt before skip

* .skip for problematic
This commit is contained in:
Jaco
2023-03-25 10:04:20 +02:00
committed by GitHub
parent e3168c8231
commit 3250187fbb
14 changed files with 264 additions and 284 deletions
+3 -2
View File
@@ -3,7 +3,6 @@
import React, { useCallback } from 'react';
import { assert } from '@polkadot/util';
import { decodeAddress } from '@polkadot/util-crypto';
import { ADDRESS_PREFIX, SEED_PREFIX } from './constants.js';
@@ -43,7 +42,9 @@ function ScanAddress ({ className, isEthereum, onError, onScan, size, style }: P
const expectedPrefix = (isEthereum ? 'ethereum' : ADDRESS_PREFIX);
const isValidPrefix = (prefix === expectedPrefix) || (prefix === SEED_PREFIX);
assert(isValidPrefix, `Invalid prefix received, expected '${expectedPrefix} or ${SEED_PREFIX}' , found '${prefix}'`);
if (!isValidPrefix) {
throw new Error(`Invalid prefix received, expected '${expectedPrefix} or ${SEED_PREFIX}' , found '${prefix}'`);
}
const isAddress = prefix === expectedPrefix;