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!: deprecate FUEL_NETWORK_URL and LOCAL_NETWORK_URL #2915

Merged
merged 77 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from 74 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
e51a6d3
refactor: integrated launchTestNode in remaining files
maschad Jul 19, 2024
5b075d8
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Jul 19, 2024
9976ff5
docs: update changeset
maschad Jul 21, 2024
67e359d
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Jul 25, 2024
095ad96
test: integrated launchTestNode into all tests excluding doc-snippets
maschad Jul 25, 2024
9a43d4e
wip
maschad Jul 26, 2024
12e1fe3
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Jul 26, 2024
093d259
test: refactored many tests in docs-snippets
maschad Jul 27, 2024
b9e4c7a
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Jul 29, 2024
7009b8f
test: skipping currently failing test suites for ci tests
maschad Jul 29, 2024
29a9ab0
docs: add changeset
maschad Jul 29, 2024
597857e
deps: update dependencies
maschad Jul 29, 2024
f7b1dbf
deps: remove cyclical dependency
maschad Jul 29, 2024
25f9cf6
deps: updated dependencies to use setupTestWallet for now
maschad Jul 29, 2024
7cfaa6c
fix: add error handling for in memory store historical view issues
maschad Jul 29, 2024
303d0db
fix: resolve conflicts
maschad Jul 29, 2024
2cd21ff
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Jul 30, 2024
3be4052
test: enable browser for demo-fuels index test
maschad Jul 30, 2024
2591024
docs: added comments about typegen contract call mismatches
maschad Jul 30, 2024
989cf2a
revert error supression on provider
maschad Jul 30, 2024
4429937
test: increasing block production time
maschad Jul 30, 2024
ea331ad
test: browser test adjusments
maschad Jul 30, 2024
9378913
test: browser test adjustments
maschad Jul 30, 2024
4abbb87
test: update provider test case for snippets
maschad Aug 6, 2024
9d33d33
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Aug 6, 2024
1a486f2
chore: refactor to use new typegen types
maschad Aug 6, 2024
6a948d8
linting
maschad Aug 6, 2024
781aa6c
chore: resolve issue with account tests
maschad Aug 6, 2024
fcdb5ca
chore: undo create-fuels.js change
maschad Aug 6, 2024
5760f90
chore: update poa-interval-period
maschad Aug 6, 2024
6c5a42e
chore: update querying chain docs tests
maschad Aug 6, 2024
c4f08f4
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Aug 8, 2024
c69aacf
test: update FUEL_CORE compatability tests
maschad Aug 8, 2024
3ba2d9e
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Aug 8, 2024
441e56f
linting fixes
maschad Aug 8, 2024
7170dfc
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
Torres-ssf Aug 8, 2024
3306155
docs: use custom port for launchTestNode
maschad Aug 8, 2024
9b806da
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Aug 8, 2024
1a5378e
docs: update docs with PR feedback
maschad Aug 8, 2024
72bdc09
chore: remove unused testing utilities
maschad Aug 8, 2024
66cc914
chore: more PR feedback refactors
maschad Aug 8, 2024
a9c8ec6
ci: update CI workflow test scripts
maschad Aug 8, 2024
3eaccd9
ci: update workflow steps
maschad Aug 8, 2024
2d07030
test: update tests to spin up temp nodes in setup
maschad Aug 9, 2024
9f41a25
linting
maschad Aug 9, 2024
16f39d1
docs: update changesets
maschad Aug 9, 2024
9f1398a
chore: update variable assignment
maschad Aug 9, 2024
9b8ec2f
docs: update imports
maschad Aug 9, 2024
fd799b4
chore: pr feedback changes
maschad Aug 9, 2024
54a9b0b
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Aug 9, 2024
c471267
docs: re-introduce testing wallets docs (#2635)
maschad Aug 10, 2024
283c96e
chore: update changesets + feedback
maschad Aug 10, 2024
cc3d4fd
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Aug 10, 2024
75ebda3
ci: remove unnecessary clean step
maschad Aug 12, 2024
7a95dc7
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Aug 12, 2024
957b951
chore: deprecated urls
petertonysmith94 Aug 12, 2024
afc46cc
chore: changeset
petertonysmith94 Aug 12, 2024
5d73ea4
Merge branch 'master' of https://github.com/FuelLabs/fuels-ts into ps…
petertonysmith94 Aug 12, 2024
02912ec
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Aug 12, 2024
b3c10cc
docs: update contributing docs
maschad Aug 12, 2024
1bb4b70
chore: update test asset IDs
maschad Aug 12, 2024
4c36fa7
Merge branch 'mc/chore/integrate-launch-test-node-in-remaining-packag…
petertonysmith94 Aug 12, 2024
c576dca
Update network url
petertonysmith94 Aug 13, 2024
f818d81
chore: refactor account tests to use helper
maschad Aug 13, 2024
8c12add
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Aug 13, 2024
0f8f2cc
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Aug 14, 2024
8939ed9
chore: pr feedback
maschad Aug 14, 2024
f569034
Merge branch 'master' into mc/chore/integrate-launch-test-node-in-rem…
maschad Aug 14, 2024
17f9ad5
docs: update changesets
maschad Aug 14, 2024
86461db
docs: update changeset to breaking
maschad Aug 14, 2024
63e2c2e
docs: remove unnecessary updates from changeset
maschad Aug 14, 2024
2c5678a
chore: removed `FUEL_NETWORK_URL` env
petertonysmith94 Aug 15, 2024
48ce0dc
chore: updated pvt key envs
petertonysmith94 Aug 15, 2024
a9f1133
Merge branch 'mc/chore/integrate-launch-test-node-in-remaining-packag…
petertonysmith94 Aug 15, 2024
2f71f1d
Merge branch 'master' of https://github.com/FuelLabs/fuels-ts into ps…
petertonysmith94 Aug 15, 2024
211df94
chore: changeset
petertonysmith94 Aug 15, 2024
804dd12
Merge branch 'master' into ps/chore/deprecate-fuel-network-url-and-local
arboleya Aug 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/nervous-shirts-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@fuel-ts/account": patch
"fuels": patch
---

chore: deprecate `FUEL_NETWORK_URL` and `LOCAL_NETWORK_URL`
arboleya marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions .changeset/plenty-apples-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuel-ts/account": minor
---

chore!: integrate `launchTestNode` in remaining packages
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FUEL_NETWORK_URL=
TEST_WALLET_PVT_KEY=
DEVNET_WALLET_PVT_KEY=
TESTNET_WALLET_PVT_KEY=
PUBLISHED_NPM_TAG=
5 changes: 4 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ jobs:
- name: Validate Tests
run: pnpm test:validate

- name: Pretest
run: pnpm pretest

- name: Run Tests - ${{ matrix.env.name }}
run: pnpm ci:test --${{ matrix.env.name }}
run: pnpm test:${{ matrix.env.name }}

- name: Upload Coverage - ${{ matrix.env.name }}
uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions .knip.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"ignore": [
".github/**",
"**/*/fuels.config.*",
"**/*/.vitepress/*",
"/apps/docs/*",
Expand Down
33 changes: 10 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,18 @@ See also:

# Testing

In order to run tests locally, you need `fuel-core` running locally.

To do that run this command in your terminal:
In order to run tests locally, you can run the following commands:

```sh
pnpm node:run
```

And then run the tests in another terminal tab:
# run pretest to ensure all test dependencies are built
pnpm pretest

```sh
# run all tests
# run all tests in a node environment
pnpm test

# you may also run tests in a browser environment
pnpm test:browser

# watch all tests
pnpm test:watch

Expand All @@ -138,17 +136,6 @@ pnpm test:filter packages/my-desired-package/src/my.test.ts
pnpm test -- --coverage --my-other-flag
```

Or if you want to start a local Fuel-Core node and run all tests serially you can do:

```sh
pnpm ci:test
```

This will run `node:run`, `test` and then `node:clean`

> The tests may break if you are running your tests locally using `node:run` in a separate terminal.
> To reset your local fuel-core node data and start from scratch, run `node:clean`

### CI Test

During the CI process an automated end-to-end (e2e) test is executed. This test is crucial as it simulates real-world scenarios on the current test-net, ensuring that the changeset maintains the expected functionality and stability.
Expand All @@ -169,8 +156,8 @@ cp .env.example .env.test
And changing the below variables:

```sh
FUEL_NETWORK_URL=https://testnet.fuel.network/v1/graphql
TEST_WALLET_PVT_KEY=0x...
DEVNET_WALLET_PVT_KEY=0x...
TESTNET_WALLET_PVT_KEY=0x...
```

<!-- TODO: add/fix block explorer URL after testnet support- Checking Wallet Balance: https://fuellabs.github.io/block-explorer-v2/beta-5/?#/address/fuel1x33ajpj0jy5p2wcqqu45e32r75zrwfeh6hwqfv5un670rv4p0mns58enjg -->
Expand Down Expand Up @@ -245,7 +232,7 @@ Manually edit the `internal/fuel-core/VERSION` file, add the right version, and

```sh
pnpm install # will download new binaries
pnpm test:ci
pnpm test
```

If all tests pass, that's it.
Expand Down
48 changes: 29 additions & 19 deletions apps/demo-bun-fuels/src/bun.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,21 @@
* It ensures that built code is fully working.
*/

import { Provider, toHex, Wallet, FUEL_NETWORK_URL } from 'fuels';
import { generateTestWallet, safeExec } from 'fuels/test-utils';
import { toHex, Wallet } from 'fuels';
import { launchTestNode, safeExec } from 'fuels/test-utils';

import { Sample, SampleFactory } from './sway-programs-api';

let baseAssetId: string;

/**
* @group node
* @group browser
*/
describe('ExampleContract', () => {
beforeAll(async () => {
const provider = await Provider.create(FUEL_NETWORK_URL);
baseAssetId = provider.getBaseAssetId();
});

it('should return the input', async () => {
const provider = await Provider.create(FUEL_NETWORK_URL);
const wallet = await generateTestWallet(provider, [[500_000, baseAssetId]]);
using launched = await launchTestNode();
const {
wallets: [wallet],
} = launched;

// Deploy
const factory = new SampleFactory(wallet);
Expand All @@ -49,8 +45,10 @@ describe('ExampleContract', () => {
});

it('deploy method', async () => {
const provider = await Provider.create(FUEL_NETWORK_URL);
const wallet = await generateTestWallet(provider, [[500_000, baseAssetId]]);
using launched = await launchTestNode();
const {
wallets: [wallet],
} = launched;

// Deploy
const deploy = await SampleFactory.deploy(wallet);
Expand All @@ -67,8 +65,12 @@ describe('ExampleContract', () => {
});

it('should throw when simulating via contract factory with wallet with no resources', async () => {
const provider = await Provider.create(FUEL_NETWORK_URL);
const fundedWallet = await generateTestWallet(provider, [[500_000, baseAssetId]]);
using launched = await launchTestNode();
const {
provider,
wallets: [fundedWallet],
} = launched;

const unfundedWallet = Wallet.generate({ provider });

const deploy = await SampleFactory.deploy(fundedWallet);
Expand All @@ -84,8 +86,12 @@ describe('ExampleContract', () => {
});

it('should not throw when dry running via contract factory with wallet with no resources', async () => {
const provider = await Provider.create(FUEL_NETWORK_URL);
const fundedWallet = await generateTestWallet(provider, [[500_000, baseAssetId]]);
using launched = await launchTestNode();
const {
provider,
wallets: [fundedWallet],
} = launched;

const unfundedWallet = Wallet.generate({ provider });

const deploy = await SampleFactory.deploy(fundedWallet);
Expand All @@ -97,9 +103,13 @@ describe('ExampleContract', () => {
});

it('should demo how to use generated files just fine', async () => {
const provider = await Provider.create(FUEL_NETWORK_URL);
const wallet = await generateTestWallet(provider, [[500_000, baseAssetId]]);
using launched = await launchTestNode();
const {
wallets: [wallet],
} = launched;

const { waitForResult } = await SampleFactory.deploy(wallet);

const { contract: depoloyed } = await waitForResult();
const contractsIds = {
sample: depoloyed.id,
Expand Down
52 changes: 31 additions & 21 deletions apps/demo-fuels/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,21 @@
* It ensures that built code is fully working.
*/

import { Provider, toHex, Wallet, FUEL_NETWORK_URL } from 'fuels';
import { generateTestWallet, safeExec } from 'fuels/test-utils';
import { toHex, Wallet } from 'fuels';
import { launchTestNode, safeExec } from 'fuels/test-utils';

import { SampleFactory, Sample } from './sway-programs-api';

let baseAssetId: string;

/**
* @group node
* @group browser
*/
describe('ExampleContract', () => {
beforeAll(async () => {
const provider = await Provider.create(FUEL_NETWORK_URL);
baseAssetId = provider.getBaseAssetId();
});

it('should return the input', async () => {
const provider = await Provider.create(FUEL_NETWORK_URL);
const wallet = await generateTestWallet(provider, [[500_000, baseAssetId]]);
using launched = await launchTestNode();
const {
wallets: [wallet],
} = launched;

// Deploy
const deploy = await SampleFactory.deploy(wallet);
Expand All @@ -44,8 +40,10 @@ describe('ExampleContract', () => {
});

it('should deploy contract', async () => {
const provider = await Provider.create(FUEL_NETWORK_URL);
const wallet = await generateTestWallet(provider, [[500_000, baseAssetId]]);
using launched = await launchTestNode();
const {
wallets: [wallet],
} = launched;

// Deploy
const deploy = await SampleFactory.deploy(wallet);
Expand All @@ -60,8 +58,12 @@ describe('ExampleContract', () => {
});

it('should throw when simulating via contract factory with wallet with no resources', async () => {
const provider = await Provider.create(FUEL_NETWORK_URL);
const fundedWallet = await generateTestWallet(provider, [[500_000, baseAssetId]]);
using launched = await launchTestNode();
const {
provider,
wallets: [fundedWallet],
} = launched;

const unfundedWallet = Wallet.generate({ provider });

const deploy = await SampleFactory.deploy(fundedWallet);
Expand All @@ -77,8 +79,12 @@ describe('ExampleContract', () => {
});

it('should not throw when dry running via contract factory with wallet with no resources', async () => {
const provider = await Provider.create(FUEL_NETWORK_URL);
const fundedWallet = await generateTestWallet(provider, [[500_000, baseAssetId]]);
using launched = await launchTestNode();
const {
provider,
wallets: [fundedWallet],
} = launched;

const unfundedWallet = Wallet.generate({ provider });

const { waitForResult } = await SampleFactory.deploy(fundedWallet);
Expand All @@ -89,12 +95,16 @@ describe('ExampleContract', () => {
});

it('should demo how to use generated files just fine', async () => {
const provider = await Provider.create(FUEL_NETWORK_URL);
const wallet = await generateTestWallet(provider, [[500_000, baseAssetId]]);
using launched = await launchTestNode();
const {
wallets: [wallet],
} = launched;

const deploy = await SampleFactory.deploy(wallet);
const { contract: depoloyed } = await deploy.waitForResult();
const { contract: deployed } = await deploy.waitForResult();

const contractsIds = {
sample: depoloyed.id,
sample: deployed.id,
};

// #region using-generated-files
Expand Down
2 changes: 1 addition & 1 deletion apps/demo-react-cra/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { render, screen } from "@testing-library/react";
import { render } from "@testing-library/react";
import App from "./App";

test("renders learn react link", () => {
Expand Down
Loading
Loading