Last active
July 8, 2025 21:29
-
-
Save belivenn/3f484afd6c10ec190f8f3b7fa171eaff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe("anchor-vault-q3", () => { | |
| // Helper function to log a message | |
| const log = async (signature: string): Promise<string> => { | |
| console.log( | |
| `Your transaction signature: https://explorer.solana.com/transaction/${signature}?cluster=custom&customUrl=${connection.rpcEndpoint}\n` | |
| ); | |
| return signature; | |
| }; | |
| const confirmTx = async (signature: string) => { | |
| const latestBlockhash = await anchor.getProvider().connection.getLatestBlockhash(); | |
| await anchor.getProvider().connection.confirmTransaction( | |
| { | |
| signature, | |
| ...latestBlockhash, | |
| }, | |
| commitment | |
| ) | |
| } | |
| const confirmTxs = async (signatures: string[]) => { | |
| await Promise.all(signatures.map(confirmTx)) | |
| } | |
| const provider = anchor.AnchorProvider.env(); | |
| anchor.setProvider(provider); | |
| const connection = provider.connection; | |
| const program = anchor.workspace.Quest as Program<AnchorVaultQ3>; | |
| // Helper function to log the transaction signature | |
| const confirm = async (signature: string): Promise<string> => { | |
| const block = await connection.getLatestBlockhash(); | |
| await connection.confirmTransaction({ | |
| signature, | |
| ...block, | |
| }); | |
| await log(signature); | |
| return signature; | |
| }; | |
| ... | |
| etc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment