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

feat: update beta-5 compatibility #990

Merged
merged 56 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
6cb5ac9
feat: add beta-5 updates
luizstacio Nov 27, 2023
b8ea4ce
feat: update wallet to beta-5
luizstacio Nov 27, 2023
f45553a
chore: remove changes
luizstacio Nov 27, 2023
ccf35b6
chore: revert changes on import enum
luizstacio Nov 27, 2023
0ee25c1
fix: send max flow
luizstacio Nov 30, 2023
1b9744b
chore: update to fuels next version
luizstacio Dec 6, 2023
43bbd0f
fix: tests CLI for e2e contracts
luizstacio Dec 7, 2023
450857e
feat: update fuels deps
luizstacio Dec 7, 2023
9d28189
feat: update fuels deps
luizstacio Dec 7, 2023
68d82b2
feat: update lock yaml
luizstacio Dec 7, 2023
4af2746
chore: fix docs
luizstacio Dec 7, 2023
67e5413
feat: update schemas
luizstacio Dec 7, 2023
34a9e1d
chore: remove script test
luizstacio Dec 7, 2023
6e18b87
chore: fix test runner
luizstacio Dec 7, 2023
b056386
fix: gasLimits
luizstacio Dec 8, 2023
763e70e
fix: chain mocks
luizstacio Dec 8, 2023
a758cbd
feat: divide gasLimit by 2 on tests
luizstacio Dec 8, 2023
51294ff
fix: e2e tests on app
luizstacio Dec 8, 2023
e17a893
update: types generated
luizstacio Dec 8, 2023
711ec3c
fix: tests on playwright
luizstacio Dec 8, 2023
01030d3
chore: remove forc and update fuel-core
luizstacio Dec 11, 2023
8930d1d
chore: fix codegen missing scalar
luizstacio Dec 11, 2023
b5105ca
chore: update beta-5 to temp url
luizstacio Dec 12, 2023
27a8d3b
test: fix max send to account for fee calculation
luizstacio Dec 12, 2023
b8ba2a3
chore: change fuel-core version and playwright config
luizstacio Dec 12, 2023
c0dfee8
chore: update graphql schema
luizstacio Dec 13, 2023
221f004
chore: rever fuel-core changes
luizstacio Dec 13, 2023
a8de9a3
Merge branch 'master' of github.com:FuelLabs/fuels-wallet into ls/fea…
luizstacio Dec 13, 2023
cd25baf
chore: add changesets
luizstacio Dec 13, 2023
d25b4ac
chore: update fuel-core 0.22.0
luizstacio Dec 13, 2023
906d3e4
Merge branch 'master' of github.com:FuelLabs/fuels-wallet into ls/fea…
luizstacio Dec 13, 2023
8ec5920
chore: use sdk from PR with fix for fake UTXO fund
LuizAsFight Dec 15, 2023
9920295
fix: use new PR from SDK
LuizAsFight Dec 18, 2023
66b51fb
fix: audit
LuizAsFight Dec 18, 2023
ef98753
chore: use sdk next
LuizAsFight Dec 20, 2023
6bd6f2f
Merge branch 'master' of github.com:FuelLabs/fuels-wallet into ls/fea…
LuizAsFight Dec 22, 2023
c150ecc
chore: update beta-5 urls
luizstacio Dec 23, 2023
a95bb5e
chore: update fuels to latest next version
luizstacio Jan 8, 2024
013b84f
Merge branch 'master' of github.com:FuelLabs/fuels-wallet into ls/fea…
luizstacio Jan 8, 2024
419e600
chore: remove vite change
luizstacio Jan 8, 2024
3508765
fix: get popup page (WIP)
luizstacio Jan 8, 2024
3da0d9b
chore: revert changes on test helper
luizstacio Jan 8, 2024
19eb2e5
fix: specs deps
luizstacio Jan 8, 2024
58bf678
chore: fix provider url
luizstacio Jan 8, 2024
f8c353c
chore: update fuels-ts to latest version
luizstacio Jan 8, 2024
ba7b950
fix: return error to dapp
LuizAsFight Jan 9, 2024
2005190
Merge branch 'ls/feat/beta-5' of github.com:FuelLabs/fuels-wallet int…
LuizAsFight Jan 9, 2024
a6b9c0e
chore: update axios deps
luizstacio Jan 10, 2024
4467ad8
chore: address comments on review
luizstacio Jan 10, 2024
5bbbe16
Merge branch 'master' into ls/feat/beta-5
luizstacio Jan 10, 2024
69be51c
fix: send alt token
luizstacio Jan 11, 2024
577abab
chore: remove ref for beta-4
luizstacio Jan 11, 2024
dc1ef2f
refact: split code from machine into service
luizstacio Jan 11, 2024
477eff0
Merge branch 'master' into ls/feat/beta-5
luizstacio Jan 11, 2024
785fb3f
feat: update peerdeps
luizstacio Jan 11, 2024
d12b39d
Merge branch 'ls/feat/beta-5' of github.com:FuelLabs/fuels-wallet int…
luizstacio Jan 11, 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
9 changes: 9 additions & 0 deletions .changeset/friendly-avocados-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@fuel-wallet/playwright-utils': minor
'@fuel-wallet/react': minor
'@fuel-wallet/types': minor
'fuels-wallet': minor
'@fuel-wallet/sdk': minor
---

Update wallet to beta-5
13 changes: 0 additions & 13 deletions .github/setup-forc/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,3 @@ runs:
override: true

- uses: Swatinem/rust-cache@v1

- name: Set git config
run: |
git config --global core.bigfilethreshold 100m
shell:
bash

- uses: actions/checkout@v2
- name: Install Fuel toolchain
uses: FuelLabs/action-fuel-toolchain@master
with:
name: beta-4
components: forc@${{ inputs.forc-version }}, fuel-core@${{ inputs.fuel-core-version }}
20 changes: 5 additions & 15 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: FuelLabs/github-actions/setups/node@master
- uses: ./.github/setup-forc
- uses: FuelLabs/github-actions/setups/docker@master
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

## This is needed because for some reason setup-forc and setup-node
## Override eachothers installations

- name: Run PNPM install
id: pnpm-cache
run:
Expand All @@ -132,23 +129,16 @@ jobs:
run: pnpm node:up:test

- name: Build Application
run: pnpm build:test-e2e-contracts
run: pnpm build:all
env:
## increase node.js m memory limit for building
## with sourcemaps
NODE_OPTIONS: "--max-old-space-size=4096"
NODE_ENV: test

- name: Build Contracts
run: forc build --path packages/e2e-contract-tests/contracts/custom_asset

- name: Deploy Contracts
run: |
forc deploy --path packages/e2e-contract-tests/contracts/custom_asset --node-url http://localhost:4001/graphql --default-salt 0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298
forc deploy --path packages/e2e-contract-tests/contracts/custom_asset --node-url http://localhost:4001/graphql --salt 0x0000000000000000000000000000000000000000000000000000000000000001 0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298

- name: Generate Contract Types
run: pnpm build:e2e-contracts-types
- name: Build & Deploy Contracts
run: pnpm deploy:contracts
working-directory: ./packages/e2e-contract-tests

# E2E tests running with Playwright
- name: Install Playwright Browsers
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
WALLET_SECRET_KEY: ${WALLET_SECRET}
DISPENSE_AMOUNT: ${DISPENSE_AMOUNT}
FUEL_NODE_URL: http://${PROJECT:-fuel-node}_fuel-core:4000/graphql
image: ghcr.io/fuellabs/faucet:v0.5.5
image: ghcr.io/fuellabs/faucet:v0.6.2
ports:
- '${FUEL_FAUCET_PORT:-4040}:3000'
links:
Expand Down
2 changes: 1 addition & 1 deletion docker/fuel-core/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/fuellabs/fuel-core:v0.20.7
FROM ghcr.io/fuellabs/fuel-core:v0.22.0

ENV MIN_GAS_PRICE="${MIN_GAS_PRICE}"
ENV CONSENSUS_KEY="${CONSENSUS_KEY}"
Expand Down
42 changes: 26 additions & 16 deletions docker/fuel-core/chainConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,32 @@
"type": "LocalTest"
},
"block_gas_limit": 5000000000,
"transaction_parameters": {
"contract_max_size": 16777216,
"max_inputs": 255,
"max_outputs": 255,
"max_witnesses": 255,
"max_gas_per_tx": 10000000,
"max_script_length": 1048576,
"max_script_data_length": 1048576,
"max_storage_slots": 255,
"max_predicate_length": 1048576,
"max_predicate_data_length": 1048576,
"max_gas_per_predicate": 10000000,
"gas_price_factor": 92,
"gas_per_byte": 4,
"max_message_data_length": 1048576,
"chain_id": 0
"consensus_parameters": {
"tx_params": {
"max_inputs": 255,
"max_outputs": 255,
"max_witnesses": 255,
"max_gas_per_tx": 10000000,
"max_size": 17825792
},
"predicate_params": {
"max_predicate_length": 1048576,
"max_predicate_data_length": 1048576,
"max_gas_per_predicate": 10000000,
"max_message_data_length": 1048576
},
"script_params": {
"max_script_length": 1048576,
"max_script_data_length": 1048576
},
"contract_params": {
"contract_max_size": 16777216,
"max_storage_slots": 255
},
"fee_params": {
"gas_price_factor": 92,
"gas_per_byte": 4
}
},
"gas_costs": {
"add": 1,
Expand Down
5 changes: 0 additions & 5 deletions fuel-toolchain.toml

This file was deleted.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
"build:app": "turbo run build:app",
"build:test": "NODE_ENV=test pnpm build:app",
"build:libs": "turbo run build",
"build:e2e-contracts": "turbo run build:e2e-contracts",
"build:test-e2e-contracts": "NODE_ENV=test pnpm build:e2e-contracts",
"build:e2e-contracts-types": "pnpm run --filter=@fuel-wallet/e2e-contract-tests build:contracts",
"changeset": "changeset",
"changeset:empty": "changeset --empty",
"changeset:release": "changeset publish --no-git-tag",
Expand Down
4 changes: 2 additions & 2 deletions packages/app/.env.production
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VITE_CRX_NAME="Fuel Wallet"
VITE_CRX_RELEASE=true
VITE_FUEL_PROVIDER_URL=https://beta-4.fuel.network/graphql
VITE_FUEL_FAUCET_URL=https://faucet-beta-4.fuel.network/
VITE_FUEL_PROVIDER_URL=https://beta-5.fuel.network/graphql
VITE_FUEL_FAUCET_URL=https://faucet-beta-5.fuel.network/
VITE_MNEMONIC_WORDS=12
VITE_FAUCET_RECAPTCHA_KEY=6Ld3cEwfAAAAAMd4QTs7aO85LyKGdgj0bFsdBfre
VITE_AUTO_LOCK_IN_MINUTES=10
Expand Down
4 changes: 3 additions & 1 deletion packages/app/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ const config: CodegenConfig = {
HexString: 'string',
Bytes32: 'string',
UtxoId: 'string',
U8: 'string',
U16: 'string',
U32: 'string',
U64: 'string',
Address: 'string',
BlockId: 'string',
Expand All @@ -46,7 +49,6 @@ const config: CodegenConfig = {
Tai64Timestamp: 'string',
TxPointer: 'string',
Nonce: 'string',
U32: 'string',
},
},
},
Expand Down
5 changes: 3 additions & 2 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"@fontsource/source-code-pro": "^5.0.13",
"@fuel-ts/wallet-manager": "0.67.0",
"@fuel-ts/wallet-manager": "0.71.0",
"@fuel-ui/css": "0.21.1",
"@fuel-ui/icons": "0.21.1",
"@fuel-ui/react": "0.21.1",
Expand All @@ -46,11 +46,12 @@
"events": "^3.3.0",
"fake-indexeddb": "^4.0.2",
"framer-motion": "^10.16.4",
"fuels": "0.67.0",
"fuels": "0.71.0",
"graphql": "^16.8.1",
"graphql-request": "^6.1.0",
"graphql-tag": "^2.12.6",
"json-rpc-2.0": "^1.6.0",
"lodash.clonedeep": "^4.0.8",
"lodash.debounce": "^4.0.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/app/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const config: PlaywrightTestConfig = {
use: {
baseURL: `http://localhost:${PORT}/`,
permissions: ['clipboard-read', 'clipboard-write'],
headless: false,
headless: true,
},
};

Expand Down
2 changes: 1 addition & 1 deletion packages/app/playwright/commons/gas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { Provider, BN } from 'fuels';
export const getGasConfig = async (provider: Provider) => {
const chain = await provider.getChain();
const nodeInfo = await provider.fetchNode();
const gasLimit = chain.consensusParameters.maxGasPerTx;
const gasLimit = chain.consensusParameters.maxGasPerTx.div(2);
luizstacio marked this conversation as resolved.
Show resolved Hide resolved
const gasPrice = nodeInfo.minGasPrice;

return { gasLimit, gasPrice };
Expand Down
2 changes: 1 addition & 1 deletion packages/app/playwright/crx/crx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ test.describe('FuelWallet Extension', () => {
// TODO: remove this gas config once SDK fixes and start with correct values
const chain = await wallet.provider.getChain();
const nodeInfo = await wallet.provider.fetchNode();
const gasLimit = chain.consensusParameters.maxGasPerTx;
const gasLimit = chain.consensusParameters.maxGasPerTx.div(2);
const gasPrice = nodeInfo.minGasPrice;
const response = await wallet.transfer(
receiver,
Expand Down
1 change: 0 additions & 1 deletion packages/app/playwright/e2e/CreateWallet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ test.describe('CreateWallet', () => {
await hasText(page, /Confirm phrase/i);
await getButtonByText(page, /Paste/i).click();
await getButtonByText(page, /Next/i).click();
// await page.pause();

/** Adding password */
await hasText(page, /Create password for encryption/i);
Expand Down
2 changes: 1 addition & 1 deletion packages/app/playwright/e2e/Networks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ test.describe('Networks', () => {
await expect(buttonCreate).toBeDisabled();
const urlInput = getInputByName(page, 'url');
await expect(urlInput).toBeFocused();
await urlInput.fill('https://beta-4.fuel.network/graphql');
await urlInput.fill('https://beta-5.fuel.network/graphql');
await hasText(page, /Testnet/i, 0, 15000);
await expect(buttonCreate).toBeEnabled();
await buttonCreate.click();
Expand Down
20 changes: 17 additions & 3 deletions packages/app/playwright/e2e/SendTransaction.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Account } from '@fuel-wallet/types';
import type { Browser, Page } from '@playwright/test';
import test, { chromium } from '@playwright/test';
import test, { chromium, expect } from '@playwright/test';
import { bn, Provider, Wallet } from 'fuels';

import {
Expand All @@ -10,6 +10,7 @@ import {
getInputByName,
getByAriaLabel,
hasAriaLabel,
getElementByText,
} from '../commons';
import { seedWallet } from '../commons/seedWallet';
import { ALT_ASSET, mockData } from '../mocks';
Expand Down Expand Up @@ -142,13 +143,26 @@ test.describe('SendTransaction', () => {

// Fill amount
await getByAriaLabel(page, 'Max').click();
const value = await getInputByName(page, 'amount').inputValue();
const maxAmount = await getInputByName(page, 'amount').inputValue();

// Get calculated fee
await hasText(page, /(.*)ETH/);
const el = await getElementByText(page, /(.*)ETH/);
const feeAmountText = (await el.textContent()).replace(' ETH', '').trim();
const feeAmount = bn.parseUnits(feeAmountText);

// Max amount after calculating fee
const maxAmountAfterFee = await getInputByName(page, 'amount').inputValue();
const totalAmount = feeAmount.add(bn.parseUnits(maxAmountAfterFee));
await expect(bn.parseUnits(maxAmount).toString()).toBe(
totalAmount.toString()
);

// Submit transaction
await getButtonByText(page, 'Confirm').click();

// Approve transaction
await hasText(page, `${value} ETH`);
await hasText(page, `${maxAmountAfterFee} ETH`);
await getButtonByText(page, 'Approve').click();

// Wait for transaction to be confirmed
Expand Down
2 changes: 1 addition & 1 deletion packages/app/playwright/mocks/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const ALT_ASSET = {

export const FUEL_NETWORK = {
name: 'Fuel Testnet',
url: 'https://beta-4.fuel.network/graphql',
url: 'https://beta-5.fuel.network/graphql',
};

export async function getAccount(page: Page) {
Expand Down
Loading
Loading