feat: add skipPreflight option

This commit is contained in:
Justin Starry
2020-06-03 19:55:42 +08:00
committed by Michael Vines
parent a6e07e44da
commit 8547ae43ce
12 changed files with 263 additions and 68 deletions

View File

@ -84,7 +84,7 @@ test('create and query nonce account', async () => {
const balance = await connection.getBalance(from.publicKey);
expect(balance).toBe(minimumAmount * 2);
mockGetRecentBlockhash('recent');
mockGetRecentBlockhash('max');
mockRpc.push([
url,
{
@ -103,7 +103,7 @@ test('create and query nonce account', async () => {
authorizedPubkey: from.publicKey,
lamports: minimumAmount,
});
await connection.sendTransaction(transaction, [from, nonceAccount]);
await connection.sendTransaction(transaction, [from, nonceAccount], {skipPreflight: true});
mockRpc.push([
url,
@ -201,7 +201,7 @@ test('create and query nonce account with seed', async () => {
const balance = await connection.getBalance(from.publicKey);
expect(balance).toBe(minimumAmount * 2);
mockGetRecentBlockhash('recent');
mockGetRecentBlockhash('max');
mockRpc.push([
url,
{
@ -222,7 +222,7 @@ test('create and query nonce account with seed', async () => {
authorizedPubkey: from.publicKey,
lamports: minimumAmount,
});
await connection.sendTransaction(transaction, [from]);
await connection.sendTransaction(transaction, [from], {skipPreflight: true});
mockRpc.push([
url,