diff --git a/.changeset/dull-feet-beg.md b/.changeset/dull-feet-beg.md new file mode 100644 index 00000000000..1691320fefd --- /dev/null +++ b/.changeset/dull-feet-beg.md @@ -0,0 +1,4 @@ +--- +--- + +chore: fixing code typos diff --git a/packages/account/src/mnemonic/mnemonic.test.ts b/packages/account/src/mnemonic/mnemonic.test.ts index 97c05632e2e..096842da605 100644 --- a/packages/account/src/mnemonic/mnemonic.test.ts +++ b/packages/account/src/mnemonic/mnemonic.test.ts @@ -113,36 +113,36 @@ describe('Mnemonic', () => { }); test('Validate a 12 complete Mnemonic phrase', () => { - const mnemonicphrase = + const mnemonicPhrase = 'aware fringe excess tank asset quick suffer second cloth deliver file above'; - const validation = Mnemonic.isMnemonicValid(mnemonicphrase); + const validation = Mnemonic.isMnemonicValid(mnemonicPhrase); expect(validation).toEqual(true); }); test('Validate a 15 complete Mnemonic phrase', () => { - const mnemonicphrase = + const mnemonicPhrase = 'lucky buzz drink topic lunar proud warfare pass silver police chef liberty soap about process'; - const validation = Mnemonic.isMnemonicValid(mnemonicphrase); + const validation = Mnemonic.isMnemonicValid(mnemonicPhrase); expect(validation).toEqual(true); }); test('Validate a 18 complete Mnemonic phrase', () => { - const mnemonicphrase = + const mnemonicPhrase = 'aware fringe excess tank asset quick suffer second cloth deliver file above'; - const validation = Mnemonic.isMnemonicValid(mnemonicphrase); + const validation = Mnemonic.isMnemonicValid(mnemonicPhrase); expect(validation).toEqual(true); }); test('Validate a 21 complete Mnemonic phrase', () => { - const mnemonicphrase = + const mnemonicPhrase = 'movie fold other broccoli deliver bleak rookie record walnut coin decline blossom wheat thing silk group library absorb'; - const validation = Mnemonic.isMnemonicValid(mnemonicphrase); + const validation = Mnemonic.isMnemonicValid(mnemonicPhrase); expect(validation).toEqual(true); }); test('Validate a 24 complete Mnemonic phrase', () => { - const mnemonicphrase = + const mnemonicPhrase = 'trick modify monster anger volcano thrive jealous lens warm program milk flavor bike torch fish eye aspect cable loan little bachelor town office sound'; - const validation = Mnemonic.isMnemonicValid(mnemonicphrase); + const validation = Mnemonic.isMnemonicValid(mnemonicPhrase); expect(validation).toEqual(true); }); diff --git a/packages/account/src/providers/provider.test.ts b/packages/account/src/providers/provider.test.ts index 0fc82fdbd5f..f7cf94ba802 100644 --- a/packages/account/src/providers/provider.test.ts +++ b/packages/account/src/providers/provider.test.ts @@ -491,7 +491,7 @@ describe('Provider', () => { /** * Mocking and initializing Provider with an invalid fetcher just - * to ensure it'll be properly overriden in `connect` method below + * to ensure it'll be properly overridden in `connect` method below */ const fetchChainAndNodeInfo = vi .spyOn(Provider.prototype, 'fetchChainAndNodeInfo') @@ -763,7 +763,7 @@ describe('Provider', () => { code: ErrorCode.SCRIPT_REVERTED, }); - // Ensure user's resouces were unset from the cache + // Ensure user's resources were unset from the cache [...utxos, ...messages].forEach((key) => { expect(provider.cache?.isCached(key)).toBeFalsy(); }); @@ -1343,7 +1343,7 @@ describe('Provider', () => { const { error } = await safeExec(async () => { for await (const iterator of await provider.operations.statusChange({ - transactionId: 'doesnt matter, will be aborted', + transactionId: "doesn't matter, will be aborted", })) { // shouldn't be reached and should fail if reached expect(iterator).toBeFalsy(); @@ -1355,7 +1355,7 @@ describe('Provider', () => { message: 'The operation was aborted due to timeout', }); }); - it('should ensure calculateMaxgas considers gasLimit for ScriptTransactionRequest', async () => { + it('should ensure calculateMaxGas considers gasLimit for ScriptTransactionRequest', async () => { using launched = await setupTestProviderAndWallets(); const { provider } = launched; const { gasPerByte, maxGasPerTx } = await provider.getGasConfig(); @@ -1385,7 +1385,7 @@ describe('Provider', () => { }); }); - it('should ensure calculateMaxgas does NOT considers gasLimit for CreateTransactionRequest', async () => { + it('should ensure calculateMaxGas does NOT considers gasLimit for CreateTransactionRequest', async () => { using launched = await setupTestProviderAndWallets(); const { provider } = launched; const { gasPerByte, maxGasPerTx } = await provider.getGasConfig(); @@ -1897,7 +1897,7 @@ describe('Provider', () => { await safeExec(async () => { for await (const iterator of await provider.operations.statusChange({ - transactionId: 'doesnt matter, will be aborted', + transactionId: "doesn't matter, will be aborted", })) { // Just running a subscription to trigger the middleware // shouldn't be reached and should fail if reached diff --git a/packages/account/src/providers/provider.ts b/packages/account/src/providers/provider.ts index 8e7ff4a8d0a..ada8f071292 100644 --- a/packages/account/src/providers/provider.ts +++ b/packages/account/src/providers/provider.ts @@ -1965,8 +1965,8 @@ export default class Provider { if (commitBlockHeight) { inputObject = { ...inputObject, - // Conver BN into a number string required on the query - // This should problably be fixed on the fuel client side + // Convert BN into a number string required on the query + // This should probably be fixed on the fuel client side commitBlockHeight: commitBlockHeight.toNumber().toString(), }; } diff --git a/packages/account/src/providers/resource-cache.test.ts b/packages/account/src/providers/resource-cache.test.ts index f4f42839162..261619eed63 100644 --- a/packages/account/src/providers/resource-cache.test.ts +++ b/packages/account/src/providers/resource-cache.test.ts @@ -33,7 +33,7 @@ describe('Resource Cache', () => { ); }); - it('can validade if it is cached [UTXO]', () => { + it('can validate if it is cached [UTXO]', () => { const resourceCache = new ResourceCache(1000); const utxoId = randomValue(); @@ -45,7 +45,7 @@ describe('Resource Cache', () => { expect(resourceCache.isCached(utxoId)).toBeTruthy(); }); - it('can validade if it is cached [Message]', () => { + it('can validate if it is cached [Message]', () => { const resourceCache = new ResourceCache(1000); const messageNonce = randomValue(); diff --git a/packages/account/src/providers/transaction-response/getDecodedLogs.ts b/packages/account/src/providers/transaction-response/getDecodedLogs.ts index 91bafef69c5..14cdc54deab 100644 --- a/packages/account/src/providers/transaction-response/getDecodedLogs.ts +++ b/packages/account/src/providers/transaction-response/getDecodedLogs.ts @@ -19,7 +19,7 @@ export function getDecodedLogs( * The "mainAbi" parameter represents the ABI of the main contract used to create the transaction * or the ABI from a script used within a "BaseInvocationScope" context. * The "externalAbis" parameter is a record of contract ABIs that are also part of the transaction. - * These ABIs were added using `contract.addContracts` or through a multicall with `contract.multiCall`. + * These ABIs were added using `contract.addContracts` or through a multi-call with `contract.multiCall`. * * @param receipts - The array of transaction result receipts. * @param mainAbi - The ABI of the script or main contract. diff --git a/packages/account/src/providers/utils/extract-tx-error.ts b/packages/account/src/providers/utils/extract-tx-error.ts index 839080eb930..17d6b971daf 100644 --- a/packages/account/src/providers/utils/extract-tx-error.ts +++ b/packages/account/src/providers/utils/extract-tx-error.ts @@ -69,24 +69,24 @@ export const assembleRevertError = ( } case FAILED_ASSERT_EQ_SIGNAL: { - const sufix = + const suffix = logs.length >= 2 ? ` comparing ${stringify(lastLog)} and ${stringify(lastButOneLog)}.` : '.'; reason = 'assert_eq'; - errorMessage = `The transaction reverted because of an "assert_eq" statement${sufix}`; + errorMessage = `The transaction reverted because of an "assert_eq" statement${suffix}`; break; } case FAILED_ASSERT_NE_SIGNAL: { - const sufix = + const suffix = logs.length >= 2 ? ` comparing ${stringify(lastButOneLog)} and ${stringify(lastLog)}.` : '.'; reason = 'assert_ne'; - errorMessage = `The transaction reverted because of an "assert_ne" statement${sufix}`; + errorMessage = `The transaction reverted because of an "assert_ne" statement${suffix}`; break; } diff --git a/packages/address/src/address.ts b/packages/address/src/address.ts index bee16489617..36741606df3 100644 --- a/packages/address/src/address.ts +++ b/packages/address/src/address.ts @@ -197,7 +197,7 @@ export class Address { * Takes a dynamic string or `Address` and creates an `Address` * * @param addressId - A string containing B256, or Public Key - * @throws Error - Unknown address if the format is not recognised + * @throws Error - Unknown address if the format is not recognized * @returns A new `Address` instance * * @deprecated Use `new Address` instead diff --git a/packages/fuel-gauge/src/advanced-logging.test.ts b/packages/fuel-gauge/src/advanced-logging.test.ts index 2cf0d503bfb..e60979e04c7 100644 --- a/packages/fuel-gauge/src/advanced-logging.test.ts +++ b/packages/fuel-gauge/src/advanced-logging.test.ts @@ -145,7 +145,7 @@ describe('Advanced Logging', () => { ]); }); - describe('should properly decode all logs in a multicall with inter-contract calls', () => { + describe('should properly decode all logs in a multiCall with inter-contract calls', () => { const testStruct = { a: true, b: 100000, @@ -161,7 +161,7 @@ describe('Advanced Logging', () => { 'fuelfuel', ]; - it('when using InvacationScope', async () => { + it('when using InvocationScope', async () => { using launched = await launchTestNode({ contractsConfigs: [ { factory: AdvancedLoggingFactory }, diff --git a/packages/fuel-gauge/src/contract.test.ts b/packages/fuel-gauge/src/contract.test.ts index 46cc029706d..afbec5c27b4 100644 --- a/packages/fuel-gauge/src/contract.test.ts +++ b/packages/fuel-gauge/src/contract.test.ts @@ -112,7 +112,7 @@ describe('Contract', () => { expect(value.toHex()).toEqual(toHex(1338)); }); - it('adds multiple contracts on multicalls', async () => { + it('adds multiple contracts on multi-calls', async () => { using launched = await launchTestNode({ contractsConfigs, }); @@ -227,7 +227,7 @@ describe('Contract', () => { expect(failed).toEqual(true); }); - it('adds multiple contracts on multicalls', async () => { + it('adds multiple contracts on multi-calls', async () => { using launched = await launchTestNode({ contractsConfigs, }); @@ -354,7 +354,7 @@ describe('Contract', () => { ); }); - it('can forward gas to multicall calls', async () => { + it('can forward gas to multi-call calls', async () => { using contract = await setupTestContract(); const { waitForResult } = await contract @@ -611,7 +611,7 @@ describe('Contract', () => { expect(result.status).toBe('success'); }); - it('should ensure multicall allows multiple heap types', async () => { + it('should ensure multi-call allows multiple heap types', async () => { using contract = await setupTestContract(); const vector = [5, 4, 3, 2, 1]; @@ -891,7 +891,7 @@ describe('Contract', () => { expect(bn(maxFeePolicy?.data).toNumber()).toBe(maxFee); }); - it('should ensure gas price and gas limit are validated when transfering to contract', async () => { + it('should ensure gas price and gas limit are validated when transferring to contract', async () => { using launched = await launchTestNode({ contractsConfigs, }); @@ -915,7 +915,7 @@ describe('Contract', () => { }).rejects.toThrowError(/Gas limit '1' is lower than the required: ./); }); - it('should tranfer asset to a deployed contract just fine (NOT NATIVE ASSET)', async () => { + it('should transfer asset to a deployed contract just fine (NOT NATIVE ASSET)', async () => { const asset = '0x0101010101010101010101010101010101010101010101010101010101010101'; using launched = await launchTestNode({ @@ -939,7 +939,7 @@ describe('Contract', () => { expect(finalBalance).toBe(initialBalance + amountToContract); }); - it('should tranfer asset to a deployed contract just fine (FROM PREDICATE)', async () => { + it('should transfer asset to a deployed contract just fine (FROM PREDICATE)', async () => { using launched = await launchTestNode({ contractsConfigs, }); @@ -994,7 +994,7 @@ describe('Contract', () => { ); }); - it('should ensure assets can be transfered to wallets (SINGLE TRANSFER)', async () => { + it('should ensure assets can be transferred to wallets (SINGLE TRANSFER)', async () => { using contract = await setupTestContract(); const { provider } = contract; @@ -1017,7 +1017,7 @@ describe('Contract', () => { expect(finalBalance.toNumber()).toBe(amountToTransfer); }); - it('should ensure assets can be transfered to wallets (MULTI TRANSFER)', async () => { + it('should ensure assets can be transferred to wallets (MULTI TRANSFER)', async () => { using launched = await launchTestNode(); const { provider, @@ -1271,7 +1271,7 @@ describe('Contract', () => { expect(bn(maxFeePolicy?.data).toNumber()).toBe(maxFee); }); - it('should ensure "maxFee" and "gasLimit" can be set on a multicall', async () => { + it('should ensure "maxFee" and "gasLimit" can be set on a multi-call', async () => { using contract = await setupTestContract(); const gasLimit = 500_000; diff --git a/packages/fuel-gauge/src/dry-run-multiple-txs.test.ts b/packages/fuel-gauge/src/dry-run-multiple-txs.test.ts index 4bb77c2986e..0a5e7d99d58 100644 --- a/packages/fuel-gauge/src/dry-run-multiple-txs.test.ts +++ b/packages/fuel-gauge/src/dry-run-multiple-txs.test.ts @@ -260,7 +260,7 @@ describe('dry-run-multiple-txs', () => { }, }); - // request 4 we dry run it 1 time because it has reveted + // request 4 we dry run it 1 time because it has reverted expect(estimatedRequests[3]).toStrictEqual({ receipts: expect.any(Array), missingContractIds: [], diff --git a/packages/fuel-gauge/src/edge-cases.test.ts b/packages/fuel-gauge/src/edge-cases.test.ts index e71299e996b..08a4762f69a 100644 --- a/packages/fuel-gauge/src/edge-cases.test.ts +++ b/packages/fuel-gauge/src/edge-cases.test.ts @@ -48,10 +48,10 @@ describe('Edge Cases', () => { await response.waitForResult(); - const subsciption = await provider.operations.statusChange({ transactionId }); + const subscription = await provider.operations.statusChange({ transactionId }); // eslint-disable-next-line @typescript-eslint/no-unused-vars - for await (const iterator of subsciption) { + for await (const iterator of subscription) { // we leave this intentionally empty so that we test that the subscription will end the loop when the connection is closed } }); diff --git a/packages/fuel-gauge/src/funding-transaction.test.ts b/packages/fuel-gauge/src/funding-transaction.test.ts index fa5b415b31d..70f1cd5e0d7 100644 --- a/packages/fuel-gauge/src/funding-transaction.test.ts +++ b/packages/fuel-gauge/src/funding-transaction.test.ts @@ -119,13 +119,13 @@ describe('Funding Transactions', () => { }); // sender has 2 UTXOs for 200_000 each, so it has enough resources to spend 1000 of baseAssetId - const enoughtResources = await sender.getResourcesToSpend([ + const enoughResources = await sender.getResourcesToSpend([ [100, await provider.getBaseAssetId()], ]); // confirm we only fetched 1 UTXO from the expected amount - expect(enoughtResources.length).toBe(1); - expect(enoughtResources[0].amount.toNumber()).toBe(200_000); + expect(enoughResources.length).toBe(1); + expect(enoughResources[0].amount.toNumber()).toBe(200_000); const request = new ScriptTransactionRequest({ gasLimit: 1_000, @@ -134,7 +134,7 @@ describe('Funding Transactions', () => { const amountToTransfer = 100; request.addCoinOutput(receiver.address, amountToTransfer, await provider.getBaseAssetId()); - request.addResources(enoughtResources); + request.addResources(enoughResources); const txCost = await sender.getTransactionCost(request); diff --git a/packages/fuel-gauge/src/predicate-conditional-inputs.test.ts b/packages/fuel-gauge/src/predicate-conditional-inputs.test.ts index 5e514ebd30c..8aed3f4d26d 100644 --- a/packages/fuel-gauge/src/predicate-conditional-inputs.test.ts +++ b/packages/fuel-gauge/src/predicate-conditional-inputs.test.ts @@ -46,14 +46,14 @@ describe('PredicateConditionalInputs', () => { const request = new ScriptTransactionRequest(); // fetch predicate resources to spend - const predicateResoruces = await predicate.getResourcesToSpend([[amountToTransfer, ASSET_A]]); + const predicateResources = await predicate.getResourcesToSpend([[amountToTransfer, ASSET_A]]); const aliceResources = await aliceWallet.getResourcesToSpend([ [1, await provider.getBaseAssetId()], ]); request .addResources(aliceResources) - .addResources(predicateResoruces) + .addResources(predicateResources) .addCoinOutput(aliceWallet.address, amountToTransfer, ASSET_A); const txCost = await aliceWallet.getTransactionCost(request); diff --git a/packages/fuel-gauge/src/token-test-contract.test.ts b/packages/fuel-gauge/src/token-test-contract.test.ts index 4baef1dd0ef..80935b08152 100644 --- a/packages/fuel-gauge/src/token-test-contract.test.ts +++ b/packages/fuel-gauge/src/token-test-contract.test.ts @@ -62,7 +62,7 @@ describe('TokenTestContract', () => { expect(tokenBalance?.amount.toHex()).toEqual(toHex(50)); }); - it('Automatically add variableOuputs', async () => { + it('Automatically add variableOutputs', async () => { using launched = await launchTestNode({ contractsConfigs: [ { diff --git a/packages/fuel-gauge/src/transaction-response.test.ts b/packages/fuel-gauge/src/transaction-response.test.ts index 740d4dc1e2a..9950c66c5a5 100644 --- a/packages/fuel-gauge/src/transaction-response.test.ts +++ b/packages/fuel-gauge/src/transaction-response.test.ts @@ -458,10 +458,10 @@ describe('TransactionResponse', () => { expect(getLatestGasPriceSpy).toHaveBeenCalledTimes(1); expect(result.id).toBe(tx.id); - const finalisedResult = await tx.waitForResult(); - expect(finalisedResult.fee.toNumber()).toBeGreaterThan(0); + const finalizedResult = await tx.waitForResult(); + expect(finalizedResult.fee.toNumber()).toBeGreaterThan(0); expect(getLatestGasPriceSpy).toHaveBeenCalledTimes(1); - expect(finalisedResult.id).toBe(tx.id); + expect(finalizedResult.id).toBe(tx.id); }); it('builds response and assembles result [from contract call]', async () => {