test
This commit is contained in:
parent
1a50462516
commit
1d2d143f8d
|
@ -27,6 +27,7 @@
|
||||||
"types": "lib/cjs/index.d.ts",
|
"types": "lib/cjs/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"docgen": "typedoc --entryPoints src/index.ts --out ../../website/static/api/sbv2-utils",
|
"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",
|
"test": "ts-mocha -p ./tsconfig.cjs.json -t 1000000 ./tests/*.tests.ts",
|
||||||
"build": "shx rm -rf lib && tsc && tsc -p tsconfig.cjs.json",
|
"build": "shx rm -rf lib && tsc && tsc -p tsconfig.cjs.json",
|
||||||
"watch": "tsc -p tsconfig.cjs.json --watch",
|
"watch": "tsc -p tsconfig.cjs.json --watch",
|
||||||
|
|
|
@ -80,6 +80,7 @@ async function signAndConfirmTransactions(
|
||||||
program.provider as anchor.AnchorProvider
|
program.provider as anchor.AnchorProvider
|
||||||
).wallet.signAllTransactions(transactions);
|
).wallet.signAllTransactions(transactions);
|
||||||
for (const transaction of signedTxs) {
|
for (const transaction of signedTxs) {
|
||||||
|
console.log(`Blockhash: ${transaction.recentBlockhash}`);
|
||||||
const sig = await program.provider.connection.sendRawTransaction(
|
const sig = await program.provider.connection.sendRawTransaction(
|
||||||
transaction.serialize(),
|
transaction.serialize(),
|
||||||
{ skipPreflight: false, maxRetries: 10 }
|
{ skipPreflight: false, maxRetries: 10 }
|
||||||
|
|
|
@ -31,7 +31,7 @@ describe("Feed tests", () => {
|
||||||
const provider = new anchor.AnchorProvider(
|
const provider = new anchor.AnchorProvider(
|
||||||
localnetConnection,
|
localnetConnection,
|
||||||
new AnchorWallet(payer),
|
new AnchorWallet(payer),
|
||||||
{ commitment: "confirmed" }
|
{ commitment: "processed" }
|
||||||
);
|
);
|
||||||
switchboard = await SwitchboardTestContext.loadFromEnv(provider);
|
switchboard = await SwitchboardTestContext.loadFromEnv(provider);
|
||||||
console.log("local env detected");
|
console.log("local env detected");
|
||||||
|
@ -40,12 +40,12 @@ describe("Feed tests", () => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const devnetConnection = new anchor.web3.Connection(
|
const devnetConnection = new anchor.web3.Connection(
|
||||||
"https://devnet.genesysgo.net/"
|
"https://switchboard.devnet.rpcpool.com/f9fe774d81ba4527a418f5b19477"
|
||||||
);
|
);
|
||||||
const provider = new anchor.AnchorProvider(
|
const provider = new anchor.AnchorProvider(
|
||||||
devnetConnection,
|
devnetConnection,
|
||||||
new AnchorWallet(payer),
|
new AnchorWallet(payer),
|
||||||
{ commitment: "confirmed" }
|
{ commitment: "processed" }
|
||||||
);
|
);
|
||||||
// const airdropSignature = await devnetConnection.requestAirdrop(
|
// const airdropSignature = await devnetConnection.requestAirdrop(
|
||||||
// payer.publicKey,
|
// payer.publicKey,
|
||||||
|
|
|
@ -4275,7 +4275,7 @@ export async function packTransactions(
|
||||||
): Promise<Transaction[]> {
|
): Promise<Transaction[]> {
|
||||||
const instructions = transactions.map((t) => t.instructions).flat();
|
const instructions = transactions.map((t) => t.instructions).flat();
|
||||||
const txs = packInstructions(instructions, feePayer);
|
const txs = packInstructions(instructions, feePayer);
|
||||||
const { blockhash } = await connection.getLatestBlockhash("confirmed");
|
const { blockhash } = await connection.getLatestBlockhash();
|
||||||
txs.forEach((t) => {
|
txs.forEach((t) => {
|
||||||
t.recentBlockhash = blockhash;
|
t.recentBlockhash = blockhash;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue