Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multisig. Reject operation. Signatories are sorting wrong #3105

Closed
stepanLav opened this issue Feb 4, 2025 · 1 comment · Fixed by #3109
Closed

Multisig. Reject operation. Signatories are sorting wrong #3105

stepanLav opened this issue Feb 4, 2025 · 1 comment · Fixed by #3109
Labels
Bug Issues & PRs that addressing a bug

Comments

@stepanLav
Copy link
Member

stepanLav commented Feb 4, 2025

Description

There is a difference between create operation signatory sorting and reject operation sorting:

Create:

const otherSignatories = sortBy(txWrapper.multisigAccount.signatories, 'accountId')
.filter(({ accountId }) => accountId !== txWrapper.signer.accountId)
.map(({ accountId }) => toAddress(accountId, { prefix: addressPrefix }));

Reject:

fn: ({ account, wrappedTx }, { signerAccountId, chain, tx }) => {
const otherSignatories = account!.signatories.reduce<Address[]>((acc, s) => {
if (signerAccountId !== s.accountId) {
acc.push(toAddress(s.accountId, { prefix: chain?.addressPrefix }));
}
return acc;
}, []);
if (accountUtils.isFlexibleMultisigAccount(account!) && wrappedTx) {
return transactionBuilder.buildRejectFlexibleMultisigTx({
chain,
signerAccountId,
threshold: account!.threshold,
accountId: account!.accountId,
transaction: wrappedTx.wrappedTx,
otherSignatories: sortBy(otherSignatories),
tx,
});
}

Image

https://assethub-polkadot.subscan.io/account/1HGnvAkk9nbfZ58CzUJhjcrLdEDMkr5qNkqqYkyD5BF5v6Y

Environment

v1.14.2

@stepanLav stepanLav added the Bug Issues & PRs that addressing a bug label Feb 4, 2025
@stepanLav stepanLav changed the title Multisig. Reject operation sorting is wrong Multisig. Reject operation sorting are wrong Feb 4, 2025
@stepanLav stepanLav changed the title Multisig. Reject operation sorting are wrong Multisig. Reject operation. Signatories are sorting wrong Feb 4, 2025
@johnthecat johnthecat moved this from Todo to Ready for Test in Nova Spektr development Feb 4, 2025
@stepanLav stepanLav moved this from Ready for Test to Done in Nova Spektr development Feb 5, 2025
@stepanLav
Copy link
Member Author

Status verification: ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues & PRs that addressing a bug
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants