Re-add multisigs for Ethereum (#9212)

This commit is contained in:
Jaco 2023-03-25 15:15:50 +02:00 committed by GitHub
parent 5a4b4b01e1
commit e5fe7dede6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 7 deletions

View File

@ -89,7 +89,7 @@ function groupAccounts (accounts: SortedAccount[]): Record<GroupName, string[]>
function Overview ({ className = '', onStatusChange }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const { api, isElectron, isEthereum } = useApi();
const { api, isElectron } = useApi();
const { allAccounts, hasAccounts } = useAccounts();
const { isIpfs } = useIpfs();
const { isLedgerEnabled } = useLedger();
@ -156,12 +156,9 @@ function Overview ({ className = '', onStatusChange }: Props): React.ReactElemen
);
// detect multisigs
// FIXME Currently Ethereum shorter-addresses and the multisig hashing is not quite supported,
// somewhere in the chain we need to adjust quite a bit (it would seem). Tracking issue -
// https://github.com/polkadot-js/apps/issues/9209
const hasPalletMultisig = useMemo(
() => !isEthereum && isFunction((api.tx.multisig || api.tx.utility)?.approveAsMulti),
[api, isEthereum]
() => isFunction((api.tx.multisig || api.tx.utility)?.approveAsMulti),
[api]
);
// proxy support

View File

@ -86,7 +86,7 @@ function MultisigApprove ({ className = '', onClose, ongoing, threshold, who }:
setOthers(
who
.map((w) => api.createType('AccountId', w))
.filter((w) => !w.eq(signatory))
.filter((w) => !signatory || !w.eq(signatory))
);
}, [api, signatory, who]);

View File

@ -76,6 +76,8 @@ function createMultisig (signatories: string[], threshold: BN | number, { genesi
} catch (error) {
status.status = 'error';
status.message = (error as Error).message;
console.error(error);
}
return status;