Skip to content

Commit

Permalink
fix: Remove tx inputs sorting by index
Browse files Browse the repository at this point in the history
  • Loading branch information
msarcev committed Apr 24, 2024
1 parent fb9b6b5 commit c4e24ff
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions client/src/helpers/stardust/transactionsHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ export class TransactionsHelper {
}

sortedOutputs = [...outputs, ...remainderOutputs];
this.sortInputsAndOuputsByIndex(sortedOutputs);
this.sortInputsAndOuputsByIndex(inputs);
this.sortOuputsByIndex(sortedOutputs);
}

return { inputs, unlocks, outputs: sortedOutputs, unlockAddresses, transferTotal };
Expand All @@ -189,7 +188,7 @@ export class TransactionsHelper {
* Sort inputs and outputs in assending order by index.
* @param items Inputs or Outputs.
*/
public static sortInputsAndOuputsByIndex(items: IInput[] | IOutput[]) {
public static sortOuputsByIndex(items: IOutput[]) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
items.sort((a: any, b: any) => {
const firstIndex: string = a.id ? a.id.slice(-4) : a.outputId.slice(-4);
Expand Down

0 comments on commit c4e24ff

Please sign in to comment.