This commit is contained in:
Conner Gallagher 2022-08-10 12:31:07 -06:00
parent 1a50462516
commit 1d2d143f8d
4 changed files with 6 additions and 4 deletions

View File

@ -27,6 +27,7 @@
"types": "lib/cjs/index.d.ts",
"scripts": {
"docgen": "typedoc --entryPoints src/index.ts --out ../../website/static/api/sbv2-utils",
"pretest": "yarn build",
"test": "ts-mocha -p ./tsconfig.cjs.json -t 1000000 ./tests/*.tests.ts",
"build": "shx rm -rf lib && tsc && tsc -p tsconfig.cjs.json",
"watch": "tsc -p tsconfig.cjs.json --watch",

View File

@ -80,6 +80,7 @@ async function signAndConfirmTransactions(
program.provider as anchor.AnchorProvider
).wallet.signAllTransactions(transactions);
for (const transaction of signedTxs) {
console.log(`Blockhash: ${transaction.recentBlockhash}`);
const sig = await program.provider.connection.sendRawTransaction(
transaction.serialize(),
{ skipPreflight: false, maxRetries: 10 }

View File

@ -31,7 +31,7 @@ describe("Feed tests", () => {
const provider = new anchor.AnchorProvider(
localnetConnection,
new AnchorWallet(payer),
{ commitment: "confirmed" }
{ commitment: "processed" }
);
switchboard = await SwitchboardTestContext.loadFromEnv(provider);
console.log("local env detected");
@ -40,12 +40,12 @@ describe("Feed tests", () => {
try {
const devnetConnection = new anchor.web3.Connection(
"https://devnet.genesysgo.net/"
"https://switchboard.devnet.rpcpool.com/f9fe774d81ba4527a418f5b19477"
);
const provider = new anchor.AnchorProvider(
devnetConnection,
new AnchorWallet(payer),
{ commitment: "confirmed" }
{ commitment: "processed" }
);
// const airdropSignature = await devnetConnection.requestAirdrop(
// payer.publicKey,

View File

@ -4275,7 +4275,7 @@ export async function packTransactions(
): Promise<Transaction[]> {
const instructions = transactions.map((t) => t.instructions).flat();
const txs = packInstructions(instructions, feePayer);
const { blockhash } = await connection.getLatestBlockhash("confirmed");
const { blockhash } = await connection.getLatestBlockhash();
txs.forEach((t) => {
t.recentBlockhash = blockhash;
});