Skip to content

Commit

Permalink
fix: edit delegation previous conviction in basket (#3036)
Browse files Browse the repository at this point in the history
  • Loading branch information
Asmadek authored Jan 24, 2025
1 parent 40cbc55 commit 0105593
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/renderer/entities/transaction/lib/transactionBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ type EditDelegationParams = {
undelegateTracks: number[];
target: Address;
conviction: Conviction;
previousConviction: Conviction;
balance: string;
};

Expand All @@ -339,6 +340,7 @@ function buildEditDelegation({
undelegateTracks,
target,
conviction,
previousConviction,
balance,
}: EditDelegationParams): Transaction {
const undelegateTxs = undelegateTracks.map((track) => ({
Expand All @@ -358,6 +360,7 @@ function buildEditDelegation({
track,
target,
conviction,
previousConviction,
balance,
},
}));
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/pages/Basket/lib/prepareTransactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,9 @@ async function prepareEditDelegationTransaction({ transaction, wallets, chains,

shards: [account!],
balance: coreTxs[0].args.balance,
conviction: votingService.getConviction(coreTxs[0].args.conviction),
previousConviction: 'None',
conviction: coreTxs[0].args.conviction,
// TODO: Previous conviction should be received from chain
previousConviction: coreTxs[0].args.previousConviction || 'None',
target: coreTxs[0].args.target,
tracks: coreTxs.map((t: Transaction) => t.args.track),
description: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ sample({
accountId: shard.accountId,
balance: amount || '0',
conviction: conviction || 'None',
previousConviction: activeDelegations[address].conviction || 'None',
target: target?.accountId || '',
tracks,
undelegateTracks:
Expand Down

0 comments on commit 0105593

Please sign in to comment.