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: bumped fuels version to 0.98.0 #1766

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 1 addition & 1 deletion .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Forc Setup'

inputs:
forc-components:
default: 'forc@0.65.2, fuel-core@0.39.0'
default: 'forc@0.66.5, fuel-core@0.40.2'

runs:
using: 'composite'
Expand Down
4 changes: 2 additions & 2 deletions Forc.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[[package]]
name = "core"
source = "path+from-root-8357A6DDC5F39D14"
source = "path+from-root-6A8836696D55BC6E"

[[package]]
name = "custom_asset"
Expand All @@ -23,7 +23,7 @@ dependencies = ["std"]

[[package]]
name = "std"
source = "git+https://github.com/fuellabs/sway?tag=v0.65.2#66bb430395daf5b8f7205f7b9d8d008e2e812d54"
source = "git+https://github.com/fuellabs/sway?tag=v0.66.5#94a066652468b4afa3bd396dacef482ed590976b"
dependencies = ["core"]

[[package]]
Expand Down
2 changes: 1 addition & 1 deletion examples/cra-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@fuels/connectors": "0.35.1",
"@fuels/react": "0.35.1",
"@tanstack/react-query": "5.28.4",
"fuels": "0.96.1",
"fuels": "0.98.0",
"react": "18.3.1",
"react-dom": "18.3.1"
},
Expand Down
4 changes: 2 additions & 2 deletions fuel-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
channel = "testnet"

[components]
fuel-core = "0.38.0"
forc = "0.65.2"
fuel-core = "0.40.2"
forc = "0.66.5"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"send@<0.19.0": ">=0.19.0",
"serve-static@<1.16.0": ">=1.16.0",
"rollup@>=4.0.0 <4.22.4": ">=4.22.4",
"fuels": "0.96.1",
"fuels": "0.98.0",
"secp256k1@=5.0.0": ">=5.0.1",
"elliptic@<6.6.0": ">=6.6.0",
"cross-spawn@<7.0.5": ">=7.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"events": "3.3.0",
"fake-indexeddb": "4.0.2",
"framer-motion": "10.16.4",
"fuels": "0.96.1",
"fuels": "0.98.0",
"json-edit-react": "1.13.3",
"json-rpc-2.0": "1.7.0",
"lodash.debounce": "4.0.8",
Expand Down
4 changes: 2 additions & 2 deletions packages/app/playwright/commons/seedWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export async function seedCurrentAccount(page: Page, amount: BN) {
}

export async function seedWallet(address: string, amount: BN) {
const provider = await Provider.create(VITE_FUEL_PROVIDER_URL);
const provider = new Provider(VITE_FUEL_PROVIDER_URL);
const genesisWallet = Wallet.fromPrivateKey(GENESIS_SECRET, provider);

const transfETH = await genesisWallet.transfer(
Address.fromString(address),
amount,
provider.getBaseAssetId()
await provider.getBaseAssetId()
);
await transfETH.wait();

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 @@ -98,7 +98,7 @@ test.describe('FuelWallet Extension', () => {
});

test('SDK operations', async ({ context, baseURL, extensionId }) => {
const provider = await Provider.create(process.env.VITE_FUEL_PROVIDER_URL);
const provider = new Provider(process.env.VITE_FUEL_PROVIDER_URL);
// Use a single instance of the page to avoid
// multiple waiting times, and window.fuel checking.
const blankPage = await context.newPage();
Expand Down
4 changes: 2 additions & 2 deletions packages/app/playwright/e2e/SendTransaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test.describe('SendTransaction', () => {
const { accounts } = await mockData(page);
account = accounts[0];
await seedWallet(account.address, bn(100_000_000));
provider = await Provider.create(process.env.VITE_FUEL_PROVIDER_URL);
provider = new Provider(process.env.VITE_FUEL_PROVIDER_URL);
});

test('Send transaction', async () => {
Expand Down Expand Up @@ -358,7 +358,7 @@ test.describe('SendTransaction', () => {
});

test('Send transaction to an asset address should fail', async () => {
const assetAddress = provider.getBaseAssetId();
const assetAddress = await provider.getBaseAssetId();
await visit(page, '/send');
await getInputByName(page, 'address').fill(assetAddress);
await getInputByName(page, 'amount').fill('0.001');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { FuelAddress } from './FuelAddress';

const accountAddressB256 =
'0x2230bd556418ddc58b48065208b3958a8db247f11394023e17ff143db7235c6c';
const accountAddressBech32 =
'fuel1ygct64tyrrwutz6gqefq3vu432xmy3l3zw2qy0shlu2rmdert3kqx97pfj';

describe('FuelAddress', () => {
it('a11y', async () => {
Expand All @@ -19,9 +17,4 @@ describe('FuelAddress', () => {
renderWithProvider(<FuelAddress address={accountAddressB256} />);
expect(screen.getByText('0x2230...5C6C')).toBeInTheDocument();
});

it('should show b256 address from bech32', () => {
renderWithProvider(<FuelAddress address={accountAddressBech32} />);
expect(screen.getByText('0x2230...5C6C')).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import type { ThemeUtilsCSS } from '@fuel-ui/css';
import { cssObj } from '@fuel-ui/css';
import { Box, Copyable, Icon, IconButton, Text } from '@fuel-ui/react';
import {
Address,
type B256Address,
type Bech32Address,
type ChecksumAddress,
} from 'fuels';
import { Address, type B256Address, type ChecksumAddress } from 'fuels';
import { useMemo } from 'react';
import { shortAddress } from '~/systems/Core';
import { useExplorerLink } from '../../hooks/useExplorerLink';

export type AddressProps = {
address: ChecksumAddress | Bech32Address | B256Address;
address: ChecksumAddress | B256Address;
canOpenExplorer?: boolean;
css?: ThemeUtilsCSS;
isContract?: boolean;
Expand All @@ -27,7 +22,7 @@
const account = useMemo<string>(() => {
if (!address) return '';
if (isContract) return Address.fromDynamicInput(address).toB256();
return Address.fromDynamicInput(address).toString();

Check warning on line 25 in packages/app/src/systems/Account/components/FuelAddress/FuelAddress.tsx

View workflow job for this annotation

GitHub Actions / Test

RETRY 1: AccountList › a11y

FuelError: Unknown address format: only 'B256', or 'Public Key (512)' are supported. at Function.fromDynamicInput (../../node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]_utf-8-_kke7zlhdtybaboj5z2a256ponq/node_modules/@fuel-ts/address/src/address.ts:224:11) at src/systems/Account/components/FuelAddress/FuelAddress.tsx:25:20 at mountMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16406:19) at Object.useMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16851:16) at useMemo (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:1650:21) at FuelAddress (src/systems/Account/components/FuelAddress/FuelAddress.tsx:22:26) at renderWithHooks (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:15486:18) at mountIndeterminateComponent (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:20103:13) at beginWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:21626:16) at beginWork$1 (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:27465:14) at performUnitOfWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26599:12) at workLoopSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26505:5) at renderRootSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26473:7) at recoverFromConcurrentError (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25889:20) at performConcurrentWorkOnRoot (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25789:22) at flushActQueue (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2667:24) at act (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2582:11) at ../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/act-compat.js:46:25 at renderRoot (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:161:26) at rtlRender (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:247:10) at render (../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_babel-je_vka76qd3ub75mc7tcbaccwqfy4/node_modules/@fuel-ui/test-utils/src/render.tsx:12:18) at testA11y (../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_babel-je_vka76qd3ub75mc7tcbaccwqfy4/node_modules/@fuel-ui/test-utils/src/accessibility.ts:13:42) at Object.<anonymous> (src/systems/Account/components/AccountList/AccountList.test.tsx:21:19)

Check warning on line 25 in packages/app/src/systems/Account/components/FuelAddress/FuelAddress.tsx

View workflow job for this annotation

GitHub Actions / Test

RETRY 3: AccountList › a11y

FuelError: Unknown address format: only 'B256', or 'Public Key (512)' are supported. at Function.fromDynamicInput (../../node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]_utf-8-_kke7zlhdtybaboj5z2a256ponq/node_modules/@fuel-ts/address/src/address.ts:224:11) at src/systems/Account/components/FuelAddress/FuelAddress.tsx:25:20 at mountMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16406:19) at Object.useMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16851:16) at useMemo (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:1650:21) at FuelAddress (src/systems/Account/components/FuelAddress/FuelAddress.tsx:22:26) at renderWithHooks (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:15486:18) at mountIndeterminateComponent (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:20103:13) at beginWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:21626:16) at beginWork$1 (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:27465:14) at performUnitOfWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26599:12) at workLoopSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26505:5) at renderRootSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26473:7) at recoverFromConcurrentError (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25889:20) at performConcurrentWorkOnRoot (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25789:22) at flushActQueue (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2667:24) at act (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2582:11) at ../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/act-compat.js:46:25 at renderRoot (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:161:26) at rtlRender (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:247:10) at render (../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_babel-je_vka76qd3ub75mc7tcbaccwqfy4/node_modules/@fuel-ui/test-utils/src/render.tsx:12:18) at testA11y (../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_babel-je_vka76qd3ub75mc7tcbaccwqfy4/node_modules/@fuel-ui/test-utils/src/accessibility.ts:13:42) at Object.<anonymous> (src/systems/Account/components/AccountList/AccountList.test.tsx:21:19)

Check warning on line 25 in packages/app/src/systems/Account/components/FuelAddress/FuelAddress.tsx

View workflow job for this annotation

GitHub Actions / Test

RETRY 5: AccountList › a11y

FuelError: Unknown address format: only 'B256', or 'Public Key (512)' are supported. at Function.fromDynamicInput (../../node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]_utf-8-_kke7zlhdtybaboj5z2a256ponq/node_modules/@fuel-ts/address/src/address.ts:224:11) at src/systems/Account/components/FuelAddress/FuelAddress.tsx:25:20 at mountMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16406:19) at Object.useMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16851:16) at useMemo (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:1650:21) at FuelAddress (src/systems/Account/components/FuelAddress/FuelAddress.tsx:22:26) at renderWithHooks (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:15486:18) at mountIndeterminateComponent (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:20103:13) at beginWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:21626:16) at beginWork$1 (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:27465:14) at performUnitOfWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26599:12) at workLoopSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26505:5) at renderRootSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26473:7) at recoverFromConcurrentError (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25889:20) at performConcurrentWorkOnRoot (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25789:22) at flushActQueue (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2667:24) at act (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2582:11) at ../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/act-compat.js:46:25 at renderRoot (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:161:26) at rtlRender (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:247:10) at render (../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_babel-je_vka76qd3ub75mc7tcbaccwqfy4/node_modules/@fuel-ui/test-utils/src/render.tsx:12:18) at testA11y (../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_babel-je_vka76qd3ub75mc7tcbaccwqfy4/node_modules/@fuel-ui/test-utils/src/accessibility.ts:13:42) at Object.<anonymous> (src/systems/Account/components/AccountList/AccountList.test.tsx:21:19)

Check failure on line 25 in packages/app/src/systems/Account/components/FuelAddress/FuelAddress.tsx

View workflow job for this annotation

GitHub Actions / Test

AccountList › a11y

FuelError: Unknown address format: only 'B256', or 'Public Key (512)' are supported. at Function.fromDynamicInput (../../node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]_utf-8-_kke7zlhdtybaboj5z2a256ponq/node_modules/@fuel-ts/address/src/address.ts:224:11) at src/systems/Account/components/FuelAddress/FuelAddress.tsx:25:20 at mountMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16406:19) at Object.useMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16851:16) at useMemo (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:1650:21) at FuelAddress (src/systems/Account/components/FuelAddress/FuelAddress.tsx:22:26) at renderWithHooks (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:15486:18) at mountIndeterminateComponent (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:20103:13) at beginWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:21626:16) at beginWork$1 (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:27465:14) at performUnitOfWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26599:12) at workLoopSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26505:5) at renderRootSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26473:7) at recoverFromConcurrentError (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25889:20) at performConcurrentWorkOnRoot (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25789:22) at flushActQueue (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2667:24) at act (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2582:11) at ../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/act-compat.js:46:25 at renderRoot (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:161:26) at rtlRender (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:247:10) at render (../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_babel-je_vka76qd3ub75mc7tcbaccwqfy4/node_modules/@fuel-ui/test-utils/src/render.tsx:12:18) at testA11y (../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_babel-je_vka76qd3ub75mc7tcbaccwqfy4/node_modules/@fuel-ui/test-utils/src/accessibility.ts:13:42) at Object.<anonymous> (src/systems/Account/components/AccountList/AccountList.test.tsx:21:19)

Check warning on line 25 in packages/app/src/systems/Account/components/FuelAddress/FuelAddress.tsx

View workflow job for this annotation

GitHub Actions / Test

RETRY 1: AccountList › should render two accounts

FuelError: Unknown address format: only 'B256', or 'Public Key (512)' are supported. at Function.fromDynamicInput (../../node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]_utf-8-_kke7zlhdtybaboj5z2a256ponq/node_modules/@fuel-ts/address/src/address.ts:224:11) at src/systems/Account/components/FuelAddress/FuelAddress.tsx:25:20 at mountMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16406:19) at Object.useMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16851:16) at useMemo (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:1650:21) at FuelAddress (src/systems/Account/components/FuelAddress/FuelAddress.tsx:22:26) at renderWithHooks (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:15486:18) at mountIndeterminateComponent (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:20103:13) at beginWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:21626:16) at beginWork$1 (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:27465:14) at performUnitOfWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26599:12) at workLoopSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26505:5) at renderRootSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26473:7) at recoverFromConcurrentError (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25889:20) at performConcurrentWorkOnRoot (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25789:22) at flushActQueue (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2667:24) at act (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2582:11) at ../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/act-compat.js:46:25 at renderRoot (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:161:26) at rtlRender (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:247:10) at render (../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_babel-je_vka76qd3ub75mc7tcbaccwqfy4/node_modules/@fuel-ui/test-utils/src/render.tsx:12:18) at Object.<anonymous> (src/systems/Account/components/AccountList/AccountList.test.tsx:27:11)

Check warning on line 25 in packages/app/src/systems/Account/components/FuelAddress/FuelAddress.tsx

View workflow job for this annotation

GitHub Actions / Test

RETRY 3: AccountList › should render two accounts

FuelError: Unknown address format: only 'B256', or 'Public Key (512)' are supported. at Function.fromDynamicInput (../../node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]_utf-8-_kke7zlhdtybaboj5z2a256ponq/node_modules/@fuel-ts/address/src/address.ts:224:11) at src/systems/Account/components/FuelAddress/FuelAddress.tsx:25:20 at mountMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16406:19) at Object.useMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16851:16) at useMemo (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:1650:21) at FuelAddress (src/systems/Account/components/FuelAddress/FuelAddress.tsx:22:26) at renderWithHooks (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:15486:18) at mountIndeterminateComponent (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:20103:13) at beginWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:21626:16) at beginWork$1 (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:27465:14) at performUnitOfWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26599:12) at workLoopSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26505:5) at renderRootSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26473:7) at recoverFromConcurrentError (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25889:20) at performConcurrentWorkOnRoot (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25789:22) at flushActQueue (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2667:24) at act (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2582:11) at ../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/act-compat.js:46:25 at renderRoot (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:161:26) at rtlRender (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:247:10) at render (../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_babel-je_vka76qd3ub75mc7tcbaccwqfy4/node_modules/@fuel-ui/test-utils/src/render.tsx:12:18) at Object.<anonymous> (src/systems/Account/components/AccountList/AccountList.test.tsx:27:11)

Check failure on line 25 in packages/app/src/systems/Account/components/FuelAddress/FuelAddress.tsx

View workflow job for this annotation

GitHub Actions / Test

AccountList › should render two accounts

FuelError: Unknown address format: only 'B256', or 'Public Key (512)' are supported. at Function.fromDynamicInput (../../node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]_utf-8-_kke7zlhdtybaboj5z2a256ponq/node_modules/@fuel-ts/address/src/address.ts:224:11) at src/systems/Account/components/FuelAddress/FuelAddress.tsx:25:20 at mountMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16406:19) at Object.useMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16851:16) at useMemo (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:1650:21) at FuelAddress (src/systems/Account/components/FuelAddress/FuelAddress.tsx:22:26) at renderWithHooks (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:15486:18) at mountIndeterminateComponent (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:20103:13) at beginWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:21626:16) at beginWork$1 (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:27465:14) at performUnitOfWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26599:12) at workLoopSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26505:5) at renderRootSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26473:7) at recoverFromConcurrentError (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25889:20) at performConcurrentWorkOnRoot (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25789:22) at flushActQueue (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2667:24) at act (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2582:11) at ../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/act-compat.js:46:25 at renderRoot (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:161:26) at rtlRender (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:247:10) at render (../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_babel-je_vka76qd3ub75mc7tcbaccwqfy4/node_modules/@fuel-ui/test-utils/src/render.tsx:12:18) at Object.<anonymous> (src/systems/Account/components/AccountList/AccountList.test.tsx:27:11)

Check failure on line 25 in packages/app/src/systems/Account/components/FuelAddress/FuelAddress.tsx

View workflow job for this annotation

GitHub Actions / Test

AccountList › should show hidden accounts when click on toggle button

FuelError: Unknown address format: only 'B256', or 'Public Key (512)' are supported. at Function.fromDynamicInput (../../node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]_utf-8-_kke7zlhdtybaboj5z2a256ponq/node_modules/@fuel-ts/address/src/address.ts:224:11) at src/systems/Account/components/FuelAddress/FuelAddress.tsx:25:20 at mountMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16406:19) at Object.useMemo (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16851:16) at useMemo (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:1650:21) at FuelAddress (src/systems/Account/components/FuelAddress/FuelAddress.tsx:22:26) at renderWithHooks (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:15486:18) at mountIndeterminateComponent (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:20103:13) at beginWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:21626:16) at beginWork$1 (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:27465:14) at performUnitOfWork (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26599:12) at workLoopSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26505:5) at renderRootSync (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:26473:7) at recoverFromConcurrentError (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25889:20) at performConcurrentWorkOnRoot (../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:25789:22) at flushActQueue (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2667:24) at act (../../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:2582:11) at ../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/act-compat.js:46:25 at renderRoot (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:161:26) at rtlRender (../../node_modules/.pnpm/@testing-library[email protected][email protected][email protected][email protected]/node_modules/@testing-library/react/dist/pure.js:247:10) at render (../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_babel-je_vka76qd3ub75mc7tcbaccwqfy4/node_modules/@fuel-ui/test-utils/src/render.tsx:12:18) at Object.<anonymous> (src/systems/Account/components/AccountList/AccountList.test.tsx:36:28)
}, [isContract, address]);

const { openExplorer, href } = useExplorerLink(account);
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/systems/Account/services/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { AssetsCache } from '~/systems/Asset/cache/AssetsCache';
import { chromeStorage } from '~/systems/Core/services/chromeStorage';
import type { Maybe } from '~/systems/Core/types';
import { db } from '~/systems/Core/utils/database';
import { readFromOPFS } from '~/systems/Core/utils/opfs';
import { getUniqueString } from '~/systems/Core/utils/string';
import { getTestNoDexieDbData } from '../utils/getTestNoDexieDbData';
import { readFromOPFS } from '~/systems/Core/utils/opfs';

export type AccountInputs = {
addAccount: {
Expand Down Expand Up @@ -108,7 +108,7 @@ export class AccountService {
const provider = await createProvider(providerUrl!);
const balances = await getBalances(provider, account.publicKey);
const balanceAssets = await AssetsCache.fetchAllAssets(
provider.getChainId(),
await provider.getChainId(),
balances.map((balance) => balance.assetId)
);
// includes "asset" prop in balance, centralizing the complexity here instead of in rest of UI
Expand Down Expand Up @@ -142,7 +142,7 @@ export class AccountService {
});

// includes eth balance info, centralizing the complexity here instead of in rest of UI
const baseAssetId = provider.getBaseAssetId();
const baseAssetId = await provider.getBaseAssetId();
const ethAsset = balances.find(
(balance) => balance.assetId === baseAssetId.toString()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,10 @@ export class BackgroundService {
this.communicationProtocol
);

// We need to forward bech32 addresses to the popup, regardless if we receive a b256 here
// our database is storing fuel addresses
const bech32Address = Address.fromDynamicInput(address).toString();
const b256Address = Address.fromDynamicInput(address).toString();

const signedMessage = await popupService.sendTransaction({
address: bech32Address,
address: b256Address,
Comment on lines -317 to +320
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have removed the bech32 address.

From this comment, it appears we store bech32 in the database? Would be good to validate this.

provider,
transaction,
origin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import {
FuelConnectorEventTypes,
type NetworkEvent,
} from 'fuels';
import { chromeStorage } from '~/systems/Core/services/chromeStorage';
import type { CommunicationProtocol } from './CommunicationProtocol';
import { DatabaseObservable } from './DatabaseObservable';
import { chromeStorage } from '~/systems/Core/services/chromeStorage';

export class DatabaseEvents {
readonly databaseObservable: DatabaseObservable<
Expand Down Expand Up @@ -75,7 +75,7 @@ export class DatabaseEvents {
}
);

// -- START Events for sync db with chrome storage
// -- START Events for sync db with chrome storage
this.databaseObservable.on<'accounts:create', Account>(
'accounts:create',
async (event) => {
Expand All @@ -101,7 +101,7 @@ export class DatabaseEvents {
}
}
);
// -- END Events for sync db with chrome storage
// -- END Events for sync db with chrome storage

this.databaseObservable.on<'accounts:update', Account>(
'accounts:update',
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/systems/Core/services/chromeStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ export const chromeStorage = {
vaults: new ChromeStorageTable<Vault>('vaults'),
clear: () => {
chrome?.storage?.local?.clear();
}
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const getMockedTransaction = async (
const transactionRequest = await TxService.createTransfer({
to: destinyAddress.toString(),
amount: bn.parseUnits('0.1'),
assetId: provider.getBaseAssetId(),
assetId: await provider.getBaseAssetId(),
tip: bn(0),
gasLimit: bn(1_000_000),
});
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/systems/Network/services/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ export class NetworkService {

if (!networkByChainId || !networkByUrl) {
const provider = await createProvider(url);
const providerName = provider.getChain().name;
const providerChainId = provider.getChainId();
const providerName = (await provider.getChain()).name;
const providerChainId = await provider.getChainId();

if (providerChainId !== chainId) {
throw new Error(
Expand Down Expand Up @@ -308,7 +308,7 @@ export class NetworkService {

if (!networkByUrl) {
const provider = await createProvider(url);
const providerName = provider.getChain().name;
const providerName = (await provider.getChain()).name;
const providerChainId = await provider.getChainId();

await NetworkService.validateNetworkVersion({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { cssObj } from '@fuel-ui/css';
import { Alert, Box, Form, Input, Text } from '@fuel-ui/react';
import { motion } from 'framer-motion';
import { type BN, bn } from 'fuels';
import { useEffect, useMemo, useRef, useState } from 'react';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { AssetSelect } from '~/systems/Asset';
import {
ControlledField,
Expand Down Expand Up @@ -35,6 +35,7 @@ export function SendSelect({
provider,
}: SendSelectProps) {
const [watchMax, setWatchMax] = useState(false);
const [baseAssetId, setBaseAssetId] = useState<string | null>(null);
const isAmountFocused = useRef<boolean>(false);
const baseFeeRef = useRef<BN | null>(baseFee);
const tipRef = useRef<BN>(tip);
Expand All @@ -49,17 +50,21 @@ export function SendSelect({
name: 'asset',
});

useEffect(() => {
provider
?.getBaseAssetId()
.then((id) => setBaseAssetId(id))
.catch((e) => console.error(e));
}, [provider]);

const decimals = useMemo(() => {
const selectedAsset = balances?.find((a) => a.asset?.assetId === assetId);
return selectedAsset?.asset?.decimals;
}, [assetId, balances]);

const isSendingBaseAssetId = useMemo(() => {
return (
assetId &&
provider?.getBaseAssetId().toLowerCase() === assetId.toLowerCase()
);
}, [provider, assetId]);
return assetId && baseAssetId?.toLowerCase() === assetId.toLowerCase();
}, [baseAssetId, assetId]);
Comment on lines 65 to +67
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getBaseAssetId method is now asynchronous, so I have added as state element and a useEffect to load this.

Wasn't 100% on this change, would be good to validate this.


useEffect(() => {
if (
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/systems/Send/hooks/useSend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ const schemaFactory = (provider?: Provider) =>
return false;
}

const baseAssetId = await provider?.getBaseAssetId();
const isSendingBaseAssetId =
asset &&
provider?.getBaseAssetId().toLowerCase() === asset.toLowerCase();
asset && baseAssetId?.toLowerCase() === asset.toLowerCase();
if (isSendingBaseAssetId) {
// It means "baseFee" is being calculated
if (!baseFee) {
Expand Down Expand Up @@ -141,7 +141,7 @@ const schemaFactory = (provider?: Provider) =>
}

const assetCached = await AssetsCache.getInstance().getAsset({
chainId: provider.getChainId(),
chainId: await provider.getChainId(),
assetId: value,
dbAssets: [],
save: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cssObj } from '@fuel-ui/css';
import { Box, Icon } from '@fuel-ui/react';
import type { Bech32Address, Operation, TransactionStatus } from 'fuels';
import type { B256Address, Operation, TransactionStatus } from 'fuels';
import { useAccounts } from '~/systems/Account';

import { getTxIcon, getTxIconBgColor, getTxIconColor } from '../../utils';
Expand All @@ -16,7 +16,7 @@ export function TxIcon({ operation, status }: TxIconProps) {
<Box.Flex css={styles.root(status)}>
<Icon
size={22}
icon={getTxIcon(operation, account?.address as Bech32Address)}
icon={getTxIcon(operation, account?.address as B256Address)}
color={getTxIconColor(status)}
/>
</Box.Flex>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { cssObj } from '@fuel-ui/css';
import { Avatar, Box, Card, Heading, Icon, Image, Text } from '@fuel-ui/react';
import type { OperationTransactionAddress } from 'fuels';
import { Address, AddressType, ChainName, isB256, isBech32 } from 'fuels';
import { Address, AddressType, ChainName, isB256 } from 'fuels';
import { type FC, useMemo } from 'react';
import { EthAddress, FuelAddress, useAccounts } from '~/systems/Account';

Expand All @@ -24,7 +24,7 @@ export const TxRecipientCard: TxRecipientCardComponent = ({
}) => {
const { accounts } = useAccounts();
const address = recipient?.address || '';
const isValidAddress = isB256(address) || isBech32(address);
const isValidAddress = isB256(address);
const fuelAddress = isValidAddress
? Address.fromString(address).toString()
: '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const useAssetsAmount = (params: UseAmountAmountParams) => {
const assetsWithAmount: (AssetFuelAmount | null)[] = await Promise.all(
params.operationsCoin.map(async (operationCoin) => {
const assetCached = await assetsCache.getAsset({
chainId: provider.getChainId(),
chainId: await provider.getChainId(),
assetId: operationCoin.assetId,
dbAssets: [],
save: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Bech32Address, Operation, TransactionSummary } from 'fuels';
import type { B256Address, Operation, TransactionSummary } from 'fuels';
import { Address, OperationName } from 'fuels';
import { useMemo } from 'react';
import { useAccounts } from '~/systems/Account';
Expand All @@ -14,10 +14,10 @@ type UseTxMetadataProps = {
export function getAddress(address?: string) {
if (!address) return '';
if (address === 'Network') return address;
return Address.fromString(address).bech32Address;
return Address.fromString(address).b256Address;
}

export function getLabel(operation: Operation, address?: Bech32Address) {
export function getLabel(operation: Operation, address?: B256Address) {
const { name } = operation;
const me = address ? Address.fromString(address).toHexString() : '';

Expand All @@ -39,7 +39,7 @@ export function useTxMetadata({

// Avoid screen to break with empty operations
const mainOperation = operations[0] || {};
const label = getLabel(mainOperation, account?.address as Bech32Address);
const label = getLabel(mainOperation, account?.address as B256Address);
const timeFormattedRaw = time ? formatDate(time) : undefined;
const timeFormatted = timeFormattedRaw?.replace(
'a few seconds ago',
Expand Down
Loading
Loading