Fix multisig when the proxy pallet is not available (#11435)

* Fix multisig when the proxy pallet is not available

* Use isFunction
This commit is contained in:
MOZGIII 2025-03-31 02:57:47 -03:00 committed by GitHub
parent 563181a048
commit 9b0b98ab8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -148,7 +148,8 @@ async function queryForMultisig (api: ApiPromise, requestAddress: string | null,
if (isFunction(api.query[multiModule]?.multisigs)) {
const address = isProxyActive ? proxyAddress : requestAddress;
const { threshold, who } = extractExternal(address);
const hash = (address ? api.tx.proxy.proxy(requestAddress || '', null, tx) : tx).method.hash;
const isProxyPalletAvailable = isFunction(api.tx.proxy?.proxy);
const hash = (address && isProxyPalletAvailable ? api.tx.proxy.proxy(requestAddress || '', null, tx) : tx).method.hash;
const optMulti = await api.query[multiModule].multisigs<Option<Multisig>>(address, hash);
const multi = optMulti.unwrapOr(null);