@solana/web3.js 1.43.3 → 1.43.6

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.
@@ -2586,10 +2586,18 @@ class Transaction {
2586
2586
  }); // Sort. Prioritizing first by signer, then by writable
2587
2587
 
2588
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;
2589
+ if (x.isSigner !== y.isSigner) {
2590
+ // Signers always come before non-signers
2591
+ return x.isSigner ? -1 : 1;
2592
+ }
2593
+
2594
+ if (x.isWritable !== y.isWritable) {
2595
+ // Writable accounts always come before read-only accounts
2596
+ return x.isWritable ? -1 : 1;
2597
+ } // Otherwise, sort by pubkey, stringwise.
2598
+
2599
+
2600
+ return x.pubkey.toBase58().localeCompare(y.pubkey.toBase58());
2593
2601
  }); // Move fee payer to the front
2594
2602
 
2595
2603
  const feePayerIndex = uniqueMetas.findIndex(x => {