@solana/web3.js 1.43.2 → 1.43.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2568,13 +2568,6 @@ class Transaction {
2568
2568
  isSigner: false,
2569
2569
  isWritable: false
2570
2570
  });
2571
- }); // Sort. Prioritizing first by signer, then by writable
2572
-
2573
- accountMetas.sort(function (x, y) {
2574
- const pubkeySorting = x.pubkey.toBase58().localeCompare(y.pubkey.toBase58());
2575
- const checkSigner = x.isSigner === y.isSigner ? 0 : x.isSigner ? -1 : 1;
2576
- const checkWritable = x.isWritable === y.isWritable ? pubkeySorting : x.isWritable ? -1 : 1;
2577
- return checkSigner || checkWritable;
2578
2571
  }); // Cull duplicate account metas
2579
2572
 
2580
2573
  const uniqueMetas = [];
@@ -2586,9 +2579,17 @@ class Transaction {
2586
2579
 
2587
2580
  if (uniqueIndex > -1) {
2588
2581
  uniqueMetas[uniqueIndex].isWritable = uniqueMetas[uniqueIndex].isWritable || accountMeta.isWritable;
2582
+ uniqueMetas[uniqueIndex].isSigner = uniqueMetas[uniqueIndex].isSigner || accountMeta.isSigner;
2589
2583
  } else {
2590
2584
  uniqueMetas.push(accountMeta);
2591
2585
  }
2586
+ }); // Sort. Prioritizing first by signer, then by writable
2587
+
2588
+ uniqueMetas.sort(function (x, y) {
2589
+ const pubkeySorting = x.pubkey.toBase58().localeCompare(y.pubkey.toBase58());
2590
+ const checkSigner = x.isSigner === y.isSigner ? 0 : x.isSigner ? -1 : 1;
2591
+ const checkWritable = x.isWritable === y.isWritable ? pubkeySorting : x.isWritable ? -1 : 1;
2592
+ return checkSigner || checkWritable;
2592
2593
  }); // Move fee payer to the front
2593
2594
 
2594
2595
  const feePayerIndex = uniqueMetas.findIndex(x => {