Skip to content

Commit

Permalink
Merge pull request #6 from gopartyparrot/use-map
Browse files Browse the repository at this point in the history
use map to get signatures from receipts
  • Loading branch information
mosspig323 authored Apr 18, 2022
2 parents 8306d5e + 3873301 commit 0992f6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
9 changes: 4 additions & 5 deletions src/commands/batchApproveExecute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@ async function approveExecute(
}
const txEnvelope = new RetriableTransactionEnvelope(ctx.provider, instrs, [])
const receipts = await txEnvelope.confirmAll({ resend: 100, commitment: "finalized" })
const signatures: string[] = []
for (const receipt of receipts) {
signatures.push(receipt.signature)
}

console.log("signatures: ", signatures.toString())
console.log(
"signatures: ",
receipts.map((receipt) => receipt.signature),
)
}
6 changes: 1 addition & 5 deletions src/commands/batchCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ async function createTx(

const txEnvelope = new RetriableTransactionEnvelope(ctx.provider, instructions, signers)
const receipts = await txEnvelope.confirmAll({ resend: 100, commitment: "finalized" })
const signatures: string[] = []
for (const receipt of receipts) {
signatures.push(receipt.signature)
}

return signatures.toString()
return receipts.map((receipt) => receipt.signature).toString()
}

0 comments on commit 0992f6f

Please sign in to comment.