@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.
@@ -2617,10 +2617,18 @@ class Transaction {
2617
2617
  }); // Sort. Prioritizing first by signer, then by writable
2618
2618
 
2619
2619
  uniqueMetas.sort(function (x, y) {
2620
- const pubkeySorting = x.pubkey.toBase58().localeCompare(y.pubkey.toBase58());
2621
- const checkSigner = x.isSigner === y.isSigner ? 0 : x.isSigner ? -1 : 1;
2622
- const checkWritable = x.isWritable === y.isWritable ? pubkeySorting : x.isWritable ? -1 : 1;
2623
- return checkSigner || checkWritable;
2620
+ if (x.isSigner !== y.isSigner) {
2621
+ // Signers always come before non-signers
2622
+ return x.isSigner ? -1 : 1;
2623
+ }
2624
+
2625
+ if (x.isWritable !== y.isWritable) {
2626
+ // Writable accounts always come before read-only accounts
2627
+ return x.isWritable ? -1 : 1;
2628
+ } // Otherwise, sort by pubkey, stringwise.
2629
+
2630
+
2631
+ return x.pubkey.toBase58().localeCompare(y.pubkey.toBase58());
2624
2632
  }); // Move fee payer to the front
2625
2633
 
2626
2634
  const feePayerIndex = uniqueMetas.findIndex(x => {