feat: update commitment variants (#15253)

* feat: update commitment variants

* fix: make pretty

* fix: deprecate, but leave in commitment types
This commit is contained in:
Josh
2021-02-17 16:15:09 -08:00
committed by GitHub
parent 7f7370c306
commit 8c8f8f3130
12 changed files with 132 additions and 126 deletions

View File

@ -22,7 +22,7 @@ if (process.env.TEST_LIVE) {
it('load BPF C program', async () => {
const data = await fs.readFile('test/fixtures/noop-c/noop.so');
const connection = new Connection(url, 'singleGossip');
const connection = new Connection(url, 'confirmed');
const {feeCalculator} = await connection.getRecentBlockhash();
const fees =
feeCalculator.lamportsPerSignature *
@ -59,13 +59,13 @@ if (process.env.TEST_LIVE) {
programId: program.publicKey,
});
await sendAndConfirmTransaction(connection, transaction, [from], {
commitment: 'singleGossip',
preflightCommitment: 'singleGossip',
commitment: 'confirmed',
preflightCommitment: 'confirmed',
});
}).timeout(5000);
describe('load BPF Rust program', () => {
const connection = new Connection(url, 'singleGossip');
const connection = new Connection(url, 'confirmed');
let program = new Account();
let payerAccount = new Account();
@ -141,8 +141,8 @@ if (process.env.TEST_LIVE) {
transaction,
[payerAccount],
{
commitment: 'max', // `getParsedConfirmedTransaction` requires max commitment
preflightCommitment: connection.commitment || 'max',
commitment: 'finalized', // `getParsedConfirmedTransaction` requires max commitment
preflightCommitment: connection.commitment || 'finalized',
},
);