Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: restructure Account related packages #1675

Merged
merged 68 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
a9a2d19
made hdwallet part of wallet package
Torres-ssf Jan 26, 2024
e368429
made mnemonic package part of wallet package
Torres-ssf Jan 26, 2024
a19d379
made wordlists package part of wallet package
Torres-ssf Jan 26, 2024
f8b9451
made signer package part of wallet package
Torres-ssf Jan 26, 2024
bca8e88
made wallet-manager package part of wallet package
Torres-ssf Jan 26, 2024
62e5b43
made predicate package part of wallet package
Torres-ssf Jan 26, 2024
5bb1cc0
rename base-unlocked-wallet file to base-wallet-unlocked
Torres-ssf Jan 26, 2024
dbf12f2
move fixture wallet-spec to proper place
Torres-ssf Jan 26, 2024
bf3ed3c
move GenerateOptions definition to Account
Torres-ssf Jan 26, 2024
3871d22
renaming helpers
Torres-ssf Jan 26, 2024
3699c75
refact assembleTransferToContractScript
Torres-ssf Jan 26, 2024
10962e6
move file to utils
Torres-ssf Jan 26, 2024
90a9c86
made unit test to be side by side with tested function
Torres-ssf Jan 26, 2024
8f03426
moving test fixture to proper place
Torres-ssf Jan 28, 2024
ffd1c1b
moving test fixture to proper place
Torres-ssf Jan 28, 2024
ac81696
moving test fixture to proper place
Torres-ssf Jan 28, 2024
ccc2870
rename package wallet to account
Torres-ssf Jan 29, 2024
5f4e643
fixing import
Torres-ssf Jan 29, 2024
d7ba558
fixing doc
Torres-ssf Jan 29, 2024
9e987e1
rename export
Torres-ssf Jan 29, 2024
c725eb8
move account related tests to proper place
Torres-ssf Jan 29, 2024
3cf635b
removing readme and changelog files
Torres-ssf Jan 29, 2024
c836901
Merge branch 'master' into st/refactor/restructure-account
Torres-ssf Jan 30, 2024
7a86215
Merge branch 'master' into st/refactor/restructure-account
Torres-ssf Feb 1, 2024
091b684
add changeset
Torres-ssf Feb 1, 2024
5fe7322
Merge branch 'master' into st/refactor/restructure-account
Torres-ssf Feb 1, 2024
8c3283d
made provider package part of account package
Torres-ssf Feb 1, 2024
9e44de6
remove provider entry from existent changeset to avoid CI error
Torres-ssf Feb 1, 2024
55ae198
update eslintignore
Torres-ssf Feb 1, 2024
a194cb7
lintfix
Torres-ssf Feb 1, 2024
882c810
remove .only from test case
Torres-ssf Feb 1, 2024
f92f238
purging AbstractPredicate
Torres-ssf Feb 2, 2024
4be84fe
moving fixtures to proper place
Torres-ssf Feb 2, 2024
2de4de0
moving tests to proper place
Torres-ssf Feb 2, 2024
f0d1fda
updating code snippets
Torres-ssf Feb 2, 2024
b436692
include test files on account tsconfig
Torres-ssf Feb 2, 2024
3c9b690
simplify fixture definition
Torres-ssf Feb 2, 2024
4f4c4c3
remove unused fixture
Torres-ssf Feb 2, 2024
d5379eb
adding new fixture
Torres-ssf Feb 2, 2024
ff99bc9
using fixture in favor of snapshot
Torres-ssf Feb 2, 2024
8a6c46f
moving test around
Torres-ssf Feb 2, 2024
8ec0bb9
lint fix
Torres-ssf Feb 2, 2024
393b7b2
regenerate changeset
Torres-ssf Feb 2, 2024
3071589
remove test added by accident
Torres-ssf Feb 2, 2024
920914a
Merge branch 'master' into st/refactor/restructure-account
Torres-ssf Feb 5, 2024
16905e4
Merge branch 'master' into st/refactor/restructure-account
Torres-ssf Feb 5, 2024
9bfee6c
fix fixture
Torres-ssf Feb 5, 2024
1584a83
Merge branch 'master' into st/refactor/restructure-account
Torres-ssf Feb 5, 2024
8cb75fd
fix typo
Torres-ssf Feb 5, 2024
40271c1
exporting wallet-manager related types
Torres-ssf Feb 5, 2024
dc81ce3
Merge branch 'master' into st/refactor/restructure-account
Torres-ssf Feb 5, 2024
0ec67db
Merge branch 'master' into st/refactor/restructure-account
Torres-ssf Feb 6, 2024
a1688e2
update actions to conform with providers packages being part of account
Torres-ssf Feb 6, 2024
26fa34d
remove default export
Torres-ssf Feb 6, 2024
c7e0c54
ajusting some imports
Torres-ssf Feb 6, 2024
9046a07
add logs to debuug CI
Torres-ssf Feb 6, 2024
199d9aa
ajusting some paths
Torres-ssf Feb 6, 2024
c24535a
match doc page name with its navbar link name
Torres-ssf Feb 6, 2024
801159c
remove debbuging logs
Torres-ssf Feb 6, 2024
fc99f41
fix links
Torres-ssf Feb 6, 2024
abad40c
Merge branch 'master' into st/refactor/restructure-account
danielbate Feb 7, 2024
2b71c71
Merge branch 'master' into st/refactor/restructure-account
Torres-ssf Feb 7, 2024
31082ce
Merge branch 'master' into st/refactor/restructure-account
Torres-ssf Feb 7, 2024
fd64491
moving wallet related classes to wallet dir
Torres-ssf Feb 8, 2024
6a27d05
update existent changeset to avoid breaking CI on changeset PR
Torres-ssf Feb 8, 2024
f1d29ee
Merge branch 'master' into st/refactor/restructure-account
Torres-ssf Feb 8, 2024
b6dcc78
moving test-utils exports to test-utils dir
Torres-ssf Feb 8, 2024
d4a3994
Merge branch 'master' into st/refactor/restructure-account
Torres-ssf Feb 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .changeset/young-impalas-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@fuel-ts/account": minor
"@fuel-ts/contract": minor
"@fuel-ts/errors": minor
"fuels": minor
"@fuel-ts/interfaces": minor
"@fuel-ts/program": minor
"@fuel-ts/script": minor
---

restructure Account related packages
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ apps/demo-react-cra
apps/demo-react-vite

packages/fuels/test/fixtures/project
packages/providers/src/__generated__
packages/account/src/providers/__generated__

out
CHANGELOG.md

*.hbs

templates/nextjs
templates/nextjs
4 changes: 2 additions & 2 deletions .github/actions/ci-setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ runs:
path: |
apps/docs/.typedoc
apps/docs/src/api
packages/providers/src/__generated__
packages/account/src/providers/__generated__
templates/src/sway-api
key: ${{ runner.os }}-generated-${{ github.sha }}

Expand All @@ -37,7 +37,7 @@ runs:
path: |
apps/docs/.typedoc
apps/docs/src/api
packages/providers/src/__generated__
packages/account/src/providers/__generated__
templates/src/sway-api
key: ${{ runner.os }}-generated-${{ github.sha }}

Expand Down
4 changes: 2 additions & 2 deletions .github/actions/test-setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ runs:
path: |
apps/docs/.typedoc
apps/docs/src/api
packages/providers/src/__generated__
packages/account/src/providers/__generated__
key: ${{ runner.os }}-generated-${{ github.sha }}

- name: Cache Build
Expand All @@ -36,7 +36,7 @@ runs:
path: |
apps/docs/.typedoc
apps/docs/src/api
packages/providers/src/__generated__
packages/account/src/providers/__generated__
key: ${{ runner.os }}-generated-${{ github.sha }}

- name: Setup Node.js
Expand Down
2 changes: 1 addition & 1 deletion apps/demo-fuels/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "Apache-2.0",
"dependencies": {
"@fuel-ts/errors": "workspace:^",
"@fuel-ts/wallet": "workspace:^",
"@fuel-ts/account": "workspace:^",
"fuels": "workspace:*"
},
"version": null
Expand Down
2 changes: 1 addition & 1 deletion apps/demo-fuels/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* It ensures that built code is fully working.
*/

import { generateTestWallet } from '@fuel-ts/account/test-utils';
import { safeExec } from '@fuel-ts/errors/test-utils';
import { generateTestWallet } from '@fuel-ts/wallet/test-utils';
import type { BN } from 'fuels';
import { ContractFactory, Provider, toHex, BaseAssetId, Wallet, FUEL_NETWORK_URL } from 'fuels';

Expand Down
2 changes: 1 addition & 1 deletion apps/demo-typegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"devDependencies": {
"@fuel-ts/forc": "workspace:*",
"@fuel-ts/wallet": "workspace:*",
"@fuel-ts/account": "workspace:*",
"@fuel-ts/errors": "workspace:*",
"@fuel-ts/utils": "workspace:*"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/demo-typegen/src/demo.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// #region Testing-in-ts-ts
import { generateTestWallet } from '@fuel-ts/account/test-utils';
import { safeExec } from '@fuel-ts/errors/test-utils';
import { generateTestWallet } from '@fuel-ts/wallet/test-utils';
import type { BN } from 'fuels';
import {
ContractFactory,
Expand Down
3 changes: 1 addition & 2 deletions apps/docs-snippets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"fuels": "workspace:*",
"@fuel-ts/utils": "workspace:*",
"@fuel-ts/errors": "workspace:*",
"@fuel-ts/wallet-manager": "workspace:*",
"@fuel-ts/wallet": "workspace:*"
"@fuel-ts/account": "workspace:*"
},
"keywords": [],
"author": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WalletManager } from '@fuel-ts/wallet-manager';
import { WalletManager } from '@fuel-ts/account';
import { FUEL_NETWORK_URL, Provider, Wallet } from 'fuels';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WalletManager } from '@fuel-ts/wallet-manager';
import { WalletManager } from '@fuel-ts/account';
import { FUEL_NETWORK_URL, Provider } from 'fuels';

/**
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export default defineConfig({
},
{
text: 'Connecting to Testnet',
link: '/guide/providers/connecting-to-an-external-node',
link: '/guide/providers/connecting-to-testnet',
danielbate marked this conversation as resolved.
Show resolved Hide resolved
},
{
text: 'Querying the Chain',
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ A Provider is a Class that provides an abstraction for a connection to a Fuel no

## Wallet and signer

A [`Wallet`](./api/Wallet/Wallet.md) is a Class with direct or indirect access to a private key. You can use a [`Wallet`](./api/Wallet/Wallet.md) to sign messages and transactions to authorize the network to charge your account to perform operations. The terms wallet and signer in the SDK are often used interchangeably, but, technically, a `Signer` enables the signing of transactions and messages; the [`Wallet`](./api/Wallet/Wallet.md) implements the `Signer` functionality.
A [`Wallet`](./api/Account/Wallet.md) is a Class with direct or indirect access to a private key. You can use a [`Wallet`](./api/Account/Wallet.md) to sign messages and transactions to authorize the network to charge your account to perform operations. The terms wallet and signer in the SDK are often used interchangeably, but, technically, a `Signer` enables the signing of transactions and messages; the [`Wallet`](./api/Account/Wallet.md) implements the `Signer` functionality.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Making Calls with Different Wallets or Providers

This guide demonstrates how to make contract calls using different wallets and providers by passing either an [`Account`](../../api/Wallet/Account.md) or a [`Provider`](../../api/Providers/Provider.md) to the contract on instantiation.
This guide demonstrates how to make contract calls using different wallets and providers by passing either an [`Account`](../../api/Account/Account.md) or a [`Provider`](../../api/Account/Provider.md) to the contract on instantiation.

## Changing Wallets

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/guide/contracts/cost-estimation.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Estimating Contract Call Cost

The `getTransactionCost` function provided by the [Provider](../../api/Providers/Provider.md) allows you to estimate the cost of a specific contract call. The return type, `TransactionCost`, is an object containing relevant information for the estimation:
The `getTransactionCost` function provided by the [Provider](../../api/Account/Provider.md) allows you to estimate the cost of a specific contract call. The return type, `TransactionCost`, is an object containing relevant information for the estimation:

<<< @/../../../packages/providers/src/provider.ts#cost-estimation-1{ts:line-numbers}
<<< @/../../../packages/account/src/providers/provider.ts#cost-estimation-1{ts:line-numbers}

The following example demonstrate how to get the estimated transaction cost for:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ However, the SDK always automatically estimates these dependencies and double-ch

The SDK uses the `estimateTxDependencies` helper function to set any missing dependencies identified during the estimation process. This requires simulating the transaction a few times in the background.

<<< @/../../../packages/providers/src/provider.ts#Provider-sendTransaction{ts:line-numbers}
<<< @/../../../packages/account/src/providers/provider.ts#Provider-sendTransaction{ts:line-numbers}

While relying on the SDK's automatic estimation is a decent default behavior, we recommend manually specifying the dependencies if they are known in advance to avoid the performance impact of the estimation process.
4 changes: 2 additions & 2 deletions apps/docs/src/guide/cookbook/custom-transactions.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Custom Transactions

There may be scenarios where you need to build out transactions that involve multiple program types and assets; this can be done by instantiating a [`ScriptTransactionRequest`](../../api/Providers/ScriptTransactionRequest.md). This class allows you to a append multiple program types and assets to a single transaction.
There may be scenarios where you need to build out transactions that involve multiple program types and assets; this can be done by instantiating a [`ScriptTransactionRequest`](../../api/Account/ScriptTransactionRequest.md). This class allows you to a append multiple program types and assets to a single transaction.

Consider the following script that transfers multiple assets to a contract:

<<< @/../../docs-snippets/test/fixtures/forc-projects/script-transfer-to-contract/src/main.sw#custom-transactions-1{ts:line-numbers}

This script can be executed by creating a [`ScriptTransactionRequest`](../../api/Providers/ScriptTransactionRequest.md), appending the resource and contract inputs/outputs and then sending the transaction, as follows:
This script can be executed by creating a [`ScriptTransactionRequest`](../../api/Account/ScriptTransactionRequest.md), appending the resource and contract inputs/outputs and then sending the transaction, as follows:

<<< @/../../docs-snippets/src/guide/scripts/script-custom-transaction.test.ts#custom-transactions-2{ts:line-numbers}
2 changes: 1 addition & 1 deletion apps/docs/src/guide/messages/getting-a-message-proof.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

A message proof is a cryptographic proof that a message was included in a block. You can use the `getMessageProof` method to retrieve a message proof for a given transaction ID and message ID.

<<< @/../../../packages/wallet/src/transfer.test.ts#Message-getMessageProof{ts:line-numbers}
<<< @/../../../packages/account/src/account.test.ts#Message-getMessageProof{ts:line-numbers}

<!-- TODO: Add docs for the two new parameters `commitBlockId` and `commitBlockHeight` -->
2 changes: 1 addition & 1 deletion apps/docs/src/guide/messages/getting-all-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

You can use the `getResourcesToSpend` method to retrieve a list of all the resources (coins + assets) that can be spent by a given address.

<<< @/../../../packages/wallet/src/account.test.ts#Message-getResourcesToSpend{ts:line-numbers}
<<< @/../../../packages/account/src/account.test.ts#Message-getResourcesToSpend{ts:line-numbers}
2 changes: 1 addition & 1 deletion apps/docs/src/guide/messages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ A message is an object that contains some data that when broadcast to the networ

This is the general structure of a `Message` object:

<<< @/../../../packages/providers/src/message.ts#Message-shape{ts:line-numbers}
<<< @/../../../packages/account/src/providers/message.ts#Message-shape{ts:line-numbers}
2 changes: 1 addition & 1 deletion apps/docs/src/guide/predicates/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ After compiling, you will obtain the binary of the predicate and its JSON ABI (A

<<< @/../../docs-snippets/src/guide/predicates/index.test.ts#predicate-index-2{ts:line-numbers}

The created [`Predicate`](../../api/Predicate/Predicate.md) instance, among other things, has three important properties: the predicate `bytes` (byte code), the `chainId`, and the predicate `address`.
The created [`Predicate`](../../api/Account/Predicate.md) instance, among other things, has three important properties: the predicate `bytes` (byte code), the `chainId`, and the predicate `address`.

This address, generated from the byte code, corresponds to the Pay-to-Script-Hash (P2SH) address used in Bitcoin.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ With the predicate instantiated, we can transfer funds to its address. This requ

Now that our predicate holds funds, we can use it to validate a transaction.

First, we need to set its data. Note that the `main` function in our predicate example requires a parameter called `input_address` of type `b256`. We achieve this using the [`Predicate`](../../api/Predicate/Predicate.md) class method `setData`.
First, we need to set its data. Note that the `main` function in our predicate example requires a parameter called `input_address` of type `b256`. We achieve this using the [`Predicate`](../../api/Account/Predicate.md) class method `setData`.

<<< @/../../docs-snippets/src/guide/predicates/send-and-spend-funds-from-predicates.test.ts#send-and-spend-funds-from-predicates-4{ts:line-numbers}

Expand All @@ -40,7 +40,7 @@ Once the predicate resolves with a return value `true` based on its predefined c

---

In a similar approach, you can use the `createTransfer` method, which returns a [`ScriptTransactionRequest`](../../api/Providers/ScriptTransactionRequest.md). Then, we can submit this transaction request by calling the `sendTransaction` method.
In a similar approach, you can use the `createTransfer` method, which returns a [`ScriptTransactionRequest`](../../api/Account/ScriptTransactionRequest.md). Then, we can submit this transaction request by calling the `sendTransaction` method.

This can be useful if you need the transaction ID before actually submitting it to the node.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/guide/providers/connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ At a high level, you can use the Fuel TypeScript SDK to build applications that

For this interaction to work, the SDK must be able to communicate with a `fuel-core` node; you have two options at your disposal:

1. Use the [Testnet](../providers/connecting-to-an-external-node.md)
1. Use the [Testnet](../providers/connecting-to-testnet.md)
2. [Run a local Fuel-Core node](https://docs.fuel.network/guides/running-a-node/) and instantiate a provider that points to that node's IP and port

For application building, you should use the first option.
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/guide/providers/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Providers

An instance of the [`Provider`](../../api/Providers/Provider.md) class lets you connect to a Fuel node. It provides read-only access to the blockchain state. You can use this provider as-is or through a [`Wallet`](../../api/Wallet/Wallet.md) instance.
An instance of the [`Provider`](../../api/Account/Provider.md) class lets you connect to a Fuel node. It provides read-only access to the blockchain state. You can use this provider as-is or through a [`Wallet`](../../api/Account/Wallet.md) instance.

<<< @/../../../packages/providers/test/provider.test.ts#provider-definition{ts:line-numbers}
<<< @/../../../packages/account/src/providers/provider.test.ts#provider-definition{ts:line-numbers}
4 changes: 2 additions & 2 deletions apps/docs/src/guide/providers/querying-the-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Once you have set up a provider, you're ready to interact with the Fuel blockcha
We can connect to either a _*local*_ or an _*external*_ node:

> 1. _Running a [local node](https://docs.fuel.network/guides/running-a-node/)_
> 1. _Connecting to an [external node](./connecting-to-an-external-node.md)_
> 1. _Connecting to an [external node](./connecting-to-testnet.md)_

Let's look at a few examples below.

Expand All @@ -31,4 +31,4 @@ Get all the spendable balances of all assets for an address. This is different f

This method returns all the blocks from the blockchain that match the given query. The below code snippet shows how to get the last 10 blocks.

<<< @/../../../packages/providers/test/provider.test.ts#Provider-get-blocks{ts:line-numbers}
<<< @/../../../packages/account/src/providers/provider.test.ts#Provider-get-blocks{ts:line-numbers}
2 changes: 1 addition & 1 deletion apps/docs/src/guide/providers/retrying-calls.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

The default behavior of calls done via the `Provider` towards a fuel node is that they'll fail if the connection breaks. Specifying retry options allows you to customize how many additional attempts you want to make when the connection to the node breaks before ultimately throwing an error. You can also specify the back-off algorithm as well as the base delay that algorithm will use to calculate the wait time for each request.

<<< @/../../../packages/providers/test/auto-retry-fetch.test.ts#provider-retry-options{ts:line-numbers}
<<< @/../../../packages/account/test/auto-retry-fetch.test.ts#provider-retry-options{ts:line-numbers}
4 changes: 2 additions & 2 deletions apps/docs/src/guide/testing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ For this, you can find two simple utilities on the wallet package:

- [`@fuel-ts/wallet`](https://github.com/FuelLabs/fuels-ts/tree/master/packages/wallet#test-utilities)

On top of these two utilities, if you want to quickly get up and running with a local node, you can use the `launchNodeAndGetWallets` from the `@fuel-ts/wallet/test-utils` package.
On top of these two utilities, if you want to quickly get up and running with a local node, you can use the `launchNodeAndGetWallets` from the `@fuel-ts/account/test-utils` package.

```ts
import { launchNodeAndGetWallets } from "@fuel-ts/wallet/test-utils";
import { launchNodeAndGetWallets } from "@fuel-ts/account/test-utils";

const { stop, wallets, provider } = await launchNodeAndGetWallets();

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/guide/testing/setting-up-a-custom-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The `launchNodeAndGetWallets` method lets you launch a local Fuel node with vari

In the code snippet below, we provide a custom chain config file to the `launchNodeAndGetWallets` method. You can use a chain config file to customize things like the chain's consensus parameters or specify some initial states for the chain. Click here to see what a chain config file looks like: [`chainConfig.json`](https://github.com/FuelLabs/fuels-ts/blob/master/.fuel-core/configs/chainConfig.json)

<<< @/../../../packages/wallet/src/test-utils/launchNodeAndGetWallets.test.ts#launchNode-custom-config{ts:line-numbers}
<<< @/../../../packages/account/src/test-utils/launchNodeAndGetWallets.test.ts#launchNode-custom-config{ts:line-numbers}

## Customization options

Expand All @@ -14,6 +14,6 @@ The `walletCount` option lets you specify how many wallets you want to generate.

The `launchNodeOptions` option lets you specify some additional options for the node. The available options are:

<<< @/../../../packages/wallet/src/test-utils/launchNode.ts#launchNode-launchNodeOptions{ts:line-numbers}
<<< @/../../../packages/account/src/test-utils/launchNode.ts#launchNode-launchNodeOptions{ts:line-numbers}

> Note: You can see all the available fuel-core args by running `pnpm fuels core run -h`.
2 changes: 1 addition & 1 deletion apps/docs/src/guide/testing/tweaking-the-blockchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

You can force-produce blocks using the `produceBlocks` helper to achieve an arbitrary block height. This is especially useful when you want to do some testing regarding transaction maturity.

<<< @/../../../packages/providers/test/provider.test.ts#Provider-produce-blocks{ts:line-numbers}
<<< @/../../../packages/account/src/providers/provider.test.ts#Provider-produce-blocks{ts:line-numbers}

# Producing Blocks With Custom Timestamps

Expand Down
Loading
Loading