Skip to content

Commit

Permalink
[web3js-common] fix on splitAndExecuteTx to use unique signers
Browse files Browse the repository at this point in the history
  • Loading branch information
ochaloup committed Jan 3, 2024
1 parent c82402c commit 1e3ee77
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/lib/web3js-common/src/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ export async function splitAndExecuteTx({
'splitAndExecuteTx: transaction fee payer has to be defined, either in transaction or argument'
)
}
const uniqueSigners: Map<string, Wallet | Keypair | Signer> = new Map()
for (const signer of signers) {
uniqueSigners.set(signer.publicKey.toBase58(), signer)
}
signers = Array.from(uniqueSigners.values())
const feePayerDefined: PublicKey = feePayer
const feePayerSigner = signers.find(s =>
s.publicKey.equals(feePayerDefined)
Expand All @@ -308,7 +313,6 @@ export async function splitAndExecuteTx({
}

const transactions: Transaction[] = []

let blockhash: BlockhashWithExpiryBlockHeight
if (
transaction.recentBlockhash === undefined ||
Expand Down

0 comments on commit 1e3ee77

Please sign in to comment.