Skip to content

Commit

Permalink
refactor: further PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
maschad committed Jul 17, 2024
1 parent 28a1ab2 commit 7f7d1d3
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/fuel-gauge/src/funding-transaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions packages/fuel-gauge/src/options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion packages/fuel-gauge/src/payable-annotation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/fuel-gauge/src/raw-slice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Wrapper = {
inner_enum: SomeEnum;
};

async function setupRawSliceContract() {
function setupRawSliceContract() {
return launchTestContract({
deployer: RawSliceAbi__factory,
bytecode: RawSliceAbiHex,
Expand Down
2 changes: 1 addition & 1 deletion packages/fuel-gauge/src/revert-error.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions packages/fuel-gauge/src/script-with-configurable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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],
Expand All @@ -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],
Expand All @@ -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],
Expand Down
11 changes: 6 additions & 5 deletions packages/fuel-gauge/src/transaction-response.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions packages/fuel-gauge/src/transaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe('Transaction', () => {
using launched = await launchTestNode({
nodeOptions: {
args: ['--poa-instant', 'false', '--poa-interval-period', '1ms'],
loggingEnabled: false,
},
});
const { provider } = launched;
Expand Down

0 comments on commit 7f7d1d3

Please sign in to comment.