From 90ec1387937765748dc3056a890ace51bc2928e4 Mon Sep 17 00:00:00 2001 From: chad Date: Wed, 17 Jul 2024 14:09:01 -0500 Subject: [PATCH] refactor: further PR feedback --- packages/fuel-gauge/src/funding-transaction.test.ts | 2 +- packages/fuel-gauge/src/options.test.ts | 7 ++----- packages/fuel-gauge/src/payable-annotation.test.ts | 2 +- packages/fuel-gauge/src/raw-slice.test.ts | 2 +- packages/fuel-gauge/src/revert-error.test.ts | 2 +- .../fuel-gauge/src/script-with-configurable.test.ts | 8 ++++---- packages/fuel-gauge/src/transaction-response.test.ts | 11 ++++++----- packages/fuel-gauge/src/transaction.test.ts | 1 + 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/packages/fuel-gauge/src/funding-transaction.test.ts b/packages/fuel-gauge/src/funding-transaction.test.ts index d15500bc9da..32f66bed68b 100644 --- a/packages/fuel-gauge/src/funding-transaction.test.ts +++ b/packages/fuel-gauge/src/funding-transaction.test.ts @@ -117,7 +117,7 @@ describe('Funding Transactions', () => { mainWallet, }); - // sender has 2 UTXOs for 500_000 each, so it has enough resources to spend 1000 of baseAssetId + // sender has 2 UTXOs for 200_000 each, so it has enough resources to spend 1000 of baseAssetId const enoughtResources = await sender.getResourcesToSpend([[100, provider.getBaseAssetId()]]); // confirm we only fetched 1 UTXO from the expected amount diff --git a/packages/fuel-gauge/src/options.test.ts b/packages/fuel-gauge/src/options.test.ts index ad3cf7d87ad..394c9cdbd05 100644 --- a/packages/fuel-gauge/src/options.test.ts +++ b/packages/fuel-gauge/src/options.test.ts @@ -9,7 +9,7 @@ const U8_MAX = 255; const U16_MAX = 65535; const U32_MAX = 4294967295; -async function launchOptionsContract() { +function launchOptionsContract() { return launchTestContract({ bytecode: OptionsAbiHex, deployer: OptionsAbi__factory, @@ -228,10 +228,7 @@ describe('Options Tests', () => { }); it('echoes option enum diff sizes', async () => { - using contractInstance = await launchTestContract({ - bytecode: OptionsAbiHex, - deployer: OptionsAbi__factory, - }); + using contractInstance = await launchOptionsContract(); const call1 = await contractInstance.functions.echo_enum_diff_sizes(undefined).call(); const { value } = await call1.waitForResult(); diff --git a/packages/fuel-gauge/src/payable-annotation.test.ts b/packages/fuel-gauge/src/payable-annotation.test.ts index 750a944a14a..54a6fe5083f 100644 --- a/packages/fuel-gauge/src/payable-annotation.test.ts +++ b/packages/fuel-gauge/src/payable-annotation.test.ts @@ -5,7 +5,7 @@ import PayableAnnotationAbiHex from '../test/typegen/contracts/PayableAnnotation import { launchTestContract } from './utils'; -async function launchPayableContract() { +function launchPayableContract() { return launchTestContract({ bytecode: PayableAnnotationAbiHex, deployer: PayableAnnotationAbi__factory, diff --git a/packages/fuel-gauge/src/raw-slice.test.ts b/packages/fuel-gauge/src/raw-slice.test.ts index c284bfca39b..86b74970c2a 100644 --- a/packages/fuel-gauge/src/raw-slice.test.ts +++ b/packages/fuel-gauge/src/raw-slice.test.ts @@ -19,7 +19,7 @@ type Wrapper = { inner_enum: SomeEnum; }; -async function setupRawSliceContract() { +function setupRawSliceContract() { return launchTestContract({ deployer: RawSliceAbi__factory, bytecode: RawSliceAbiHex, diff --git a/packages/fuel-gauge/src/revert-error.test.ts b/packages/fuel-gauge/src/revert-error.test.ts index b9abc9352f3..dd53b87a1a8 100644 --- a/packages/fuel-gauge/src/revert-error.test.ts +++ b/packages/fuel-gauge/src/revert-error.test.ts @@ -10,7 +10,7 @@ import TokenContractAbiHex from '../test/typegen/contracts/TokenContractAbi.hex' import { launchTestContract } from './utils'; -async function launchContract() { +function launchContract() { return launchTestContract({ deployer: RevertErrorAbi__factory, bytecode: RevertErrorAbiHex, diff --git a/packages/fuel-gauge/src/script-with-configurable.test.ts b/packages/fuel-gauge/src/script-with-configurable.test.ts index 27aba35e6c6..5a5e5390f3e 100644 --- a/packages/fuel-gauge/src/script-with-configurable.test.ts +++ b/packages/fuel-gauge/src/script-with-configurable.test.ts @@ -13,7 +13,7 @@ const defaultValues = { */ describe('Script With Configurable', () => { it('should returns true when input value matches default configurable constant', async () => { - using launched = await launchTestNode({}); + using launched = await launchTestNode(); const { wallets: [wallet], @@ -34,7 +34,7 @@ describe('Script With Configurable', () => { }); it('should returns false when input value differs from default configurable constant', async () => { - using launched = await launchTestNode({}); + using launched = await launchTestNode(); const { wallets: [wallet], @@ -59,7 +59,7 @@ describe('Script With Configurable', () => { }); it('should returns true when input value matches manually set configurable constant', async () => { - using launched = await launchTestNode({}); + using launched = await launchTestNode(); const { wallets: [wallet], @@ -82,7 +82,7 @@ describe('Script With Configurable', () => { }); it('should returns false when input value differs from manually set configurable constant', async () => { - using launched = await launchTestNode({}); + using launched = await launchTestNode(); const { wallets: [wallet], diff --git a/packages/fuel-gauge/src/transaction-response.test.ts b/packages/fuel-gauge/src/transaction-response.test.ts index 8a145224e54..77fd8269cf5 100644 --- a/packages/fuel-gauge/src/transaction-response.test.ts +++ b/packages/fuel-gauge/src/transaction-response.test.ts @@ -102,8 +102,12 @@ describe('TransactionResponse', () => { expect(response.gqlTransaction?.id).toBe(transactionId); }); - it('should ensure getTransactionSummary fetchs a transaction and assembles transaction summary', async () => { - using launched = await launchTestNode({}); + it('should ensure getTransactionSummary fetches a transaction and assembles transaction summary', async () => { + using launched = await launchTestNode({ + nodeOptions: { + args: ['--poa-instant', 'false', '--poa-interval-period', '1s'], + }, + }); const { provider, @@ -207,9 +211,6 @@ describe('TransactionResponse', () => { * before the waitForResult (provider.operations.statusChange) call is made * */ using launched = await launchTestNode({ - walletsConfig: { - amountPerCoin: 500_000, - }, nodeOptions: { args: ['--poa-instant', 'false', '--poa-interval-period', '2s', '--tx-pool-ttl', '1s'], loggingEnabled: false, diff --git a/packages/fuel-gauge/src/transaction.test.ts b/packages/fuel-gauge/src/transaction.test.ts index 81db1975da7..564510d5611 100644 --- a/packages/fuel-gauge/src/transaction.test.ts +++ b/packages/fuel-gauge/src/transaction.test.ts @@ -10,6 +10,7 @@ describe('Transaction', () => { using launched = await launchTestNode({ nodeOptions: { args: ['--poa-instant', 'false', '--poa-interval-period', '1ms'], + loggingEnabled: false, }, }); const { provider } = launched;