@exodus/solana-lib 1.3.13 → 1.3.14

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-lib",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "description": "Exodus internal Solana low-level library",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -29,5 +29,5 @@
29
29
  "lodash": "^4.17.11",
30
30
  "tweetnacl": "^1.0.3"
31
31
  },
32
- "gitHead": "12104775b7a98f110b78e928321ca0d530757d88"
32
+ "gitHead": "f8668de32398cd2f583d9bc90ddbd4b5a7425e26"
33
33
  }
@@ -262,10 +262,19 @@ export class Transaction {
262
262
 
263
263
  // Sort. Prioritizing first by signer, then by writable
264
264
  accountMetas.sort(function(x, y) {
265
- const pubkeySorting = x.pubkey.toBase58().localeCompare(y.pubkey.toBase58())
266
- const checkSigner = x.isSigner === y.isSigner ? 0 : x.isSigner ? -1 : 1
267
- const checkWritable = x.isWritable === y.isWritable ? pubkeySorting : x.isWritable ? -1 : 1
268
- return checkSigner || checkWritable
265
+ if (x.isSigner !== y.isSigner) {
266
+ // Signers always come before non-signers
267
+ return x.isSigner ? -1 : 1
268
+ }
269
+ if (x.isWritable !== y.isWritable) {
270
+ // Writable accounts always come before read-only accounts
271
+ return x.isWritable ? -1 : 1
272
+ }
273
+
274
+ const xPubKey = x.pubkey.toBase58().toLowerCase()
275
+ const yPubKey = y.pubkey.toBase58().toLowerCase()
276
+
277
+ return xPubKey < yPubKey ? -1 : xPubKey > yPubKey ? 1 : 0
269
278
  })
270
279
 
271
280
  // Cull duplicate account metas