Rework isProxied detection (#4695)
This commit is contained in:
parent
c527e9e3c4
commit
ebd18dc04e
@ -140,11 +140,11 @@ async function wrapTx (api: ApiPromise, currentItem: QueueTx, { isMultiCall, mul
|
||||
|
||||
async function extractParams (api: ApiPromise, address: string, options: Partial<SignerOptions>, getLedger: () => Ledger, setQrState: (state: QrState) => void): Promise<['qr' | 'signing', string, Partial<SignerOptions>]> {
|
||||
const pair = keyring.getPair(address);
|
||||
const { meta: { accountOffset, addressOffset, isExternal, isHardware, isInjected, source } } = pair;
|
||||
const { meta: { accountOffset, addressOffset, isExternal, isHardware, isInjected, isProxied, source } } = pair;
|
||||
|
||||
if (isHardware) {
|
||||
return ['signing', address, { ...options, signer: new LedgerSigner(api.registry, getLedger, accountOffset as number || 0, addressOffset as number || 0) }];
|
||||
} else if (isExternal) {
|
||||
} else if (isExternal && !isProxied) {
|
||||
return ['qr', address, { ...options, signer: new QrSigner(api.registry, setQrState) }];
|
||||
} else if (isInjected) {
|
||||
const injected = await web3FromSource(source as string);
|
||||
|
||||
@ -43,7 +43,8 @@ export function extractExternal (accountId: string | null): AddressFlags {
|
||||
}
|
||||
|
||||
const pair = keyring.getPair(publicKey);
|
||||
const isUnlockable = !pair.meta.isExternal && !pair.meta.isHardware && !pair.meta.isInjected;
|
||||
const { isExternal, isHardware, isInjected, isMultisig, isProxied } = pair.meta;
|
||||
const isUnlockable = !isExternal && !isHardware && !isInjected;
|
||||
|
||||
if (isUnlockable) {
|
||||
const entry = lockCountdown[pair.address];
|
||||
@ -58,10 +59,10 @@ export function extractExternal (accountId: string | null): AddressFlags {
|
||||
accountOffset: pair.meta.accountOffset as number || 0,
|
||||
addressOffset: pair.meta.addressOffset as number || 0,
|
||||
hardwareType: pair.meta.hardwareType as string,
|
||||
isHardware: !!pair.meta.isHardware,
|
||||
isMultisig: !!pair.meta.isMultisig,
|
||||
isProxied: !!pair.meta.isProxied,
|
||||
isQr: !!pair.meta.isExternal && !pair.meta.isMultisig && !pair.meta.isProxied && !pair.meta.isHardware,
|
||||
isHardware: !!isHardware,
|
||||
isMultisig: !!isMultisig,
|
||||
isProxied: !!isProxied,
|
||||
isQr: !!isExternal && !isMultisig && !isProxied && !isHardware && !isInjected,
|
||||
isUnlockable: isUnlockable && pair.isLocked,
|
||||
threshold: (pair.meta.threshold as number) || 0,
|
||||
who: ((pair.meta.who as string[]) || []).map(recodeAddress)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user