@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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/web3.js",
3
- "version": "1.43.2",
3
+ "version": "1.43.3",
4
4
  "description": "Solana Javascript API",
5
5
  "keywords": [
6
6
  "api",
@@ -376,17 +376,6 @@ export class Transaction {
376
376
  });
377
377
  });
378
378
 
379
- // Sort. Prioritizing first by signer, then by writable
380
- accountMetas.sort(function (x, y) {
381
- const pubkeySorting = x.pubkey
382
- .toBase58()
383
- .localeCompare(y.pubkey.toBase58());
384
- const checkSigner = x.isSigner === y.isSigner ? 0 : x.isSigner ? -1 : 1;
385
- const checkWritable =
386
- x.isWritable === y.isWritable ? pubkeySorting : x.isWritable ? -1 : 1;
387
- return checkSigner || checkWritable;
388
- });
389
-
390
379
  // Cull duplicate account metas
391
380
  const uniqueMetas: AccountMeta[] = [];
392
381
  accountMetas.forEach(accountMeta => {
@@ -397,11 +386,24 @@ export class Transaction {
397
386
  if (uniqueIndex > -1) {
398
387
  uniqueMetas[uniqueIndex].isWritable =
399
388
  uniqueMetas[uniqueIndex].isWritable || accountMeta.isWritable;
389
+ uniqueMetas[uniqueIndex].isSigner =
390
+ uniqueMetas[uniqueIndex].isSigner || accountMeta.isSigner;
400
391
  } else {
401
392
  uniqueMetas.push(accountMeta);
402
393
  }
403
394
  });
404
395
 
396
+ // Sort. Prioritizing first by signer, then by writable
397
+ uniqueMetas.sort(function (x, y) {
398
+ const pubkeySorting = x.pubkey
399
+ .toBase58()
400
+ .localeCompare(y.pubkey.toBase58());
401
+ const checkSigner = x.isSigner === y.isSigner ? 0 : x.isSigner ? -1 : 1;
402
+ const checkWritable =
403
+ x.isWritable === y.isWritable ? pubkeySorting : x.isWritable ? -1 : 1;
404
+ return checkSigner || checkWritable;
405
+ });
406
+
405
407
  // Move fee payer to the front
406
408
  const feePayerIndex = uniqueMetas.findIndex(x => {
407
409
  return x.pubkey.equals(feePayer);