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

fix: sort signatories by accountId #1649

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nova-spektr",
"description": "Polkadot Enterprise application",
"version": "1.5.0",
"version": "1.6.1",
"main": "./release/build/main.js",
"repository": "https://github.com/novasamatech/nova-spektr",
"license": "MIT",
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/entities/transaction/lib/extrinsicService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { BaseTxInfo, defineMethod, methods, OptionsWithMeta, UnsignedTransaction
import { ApiPromise } from '@polkadot/api';
import { methods as ormlMethods } from '@substrate/txwrapper-orml';
import { SubmittableExtrinsic } from '@polkadot/api/types';
import sortBy from 'lodash/sortBy';

import { Transaction, TransactionType } from '@entities/transaction/model/transaction';
import { getMaxWeight, hasDestWeight, isControllerMissing, isOldMultisigPallet } from './common/utils';
Expand Down Expand Up @@ -463,7 +464,7 @@ export const wrapAsMulti = ({ api, addressPrefix, transaction, txWrapper }: Wrap
const callData = extrinsic.method.toHex();
const callHash = extrinsic.method.hash.toHex();

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

Expand All @@ -473,7 +474,7 @@ export const wrapAsMulti = ({ api, addressPrefix, transaction, txWrapper }: Wrap
type: TransactionType.MULTISIG_AS_MULTI,
args: {
threshold: txWrapper.multisigAccount.threshold,
otherSignatories: otherSignatories.sort(),
otherSignatories,
maybeTimepoint: null,
callData,
callHash,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { combine, createApi, createEffect, createEvent, createStore, sample } from 'effector';
import sortBy from 'lodash/sortBy';

import {
AccountId,
Expand Down Expand Up @@ -151,7 +152,11 @@ sample({
chainId: $chain,
isEthereumChain: $isEthereumChain,
},
fn: (sourceValues, resultValues) => ({ ...sourceValues, ...resultValues }),
fn: ({ signatories, ...rest }, resultValues) => ({
...rest,
...resultValues,
signatories: sortBy(signatories, 'accountId'),
}),
target: createWalletFx,
});

Expand Down
Loading