From 13b1696d336d5dfdf6f4dbf004d677273f3a43ae Mon Sep 17 00:00:00 2001 From: Nelito Junior Date: Thu, 19 Feb 2026 14:43:39 -0300 Subject: [PATCH 01/13] fix: remove declare blocks from CustomAsset.ts to fix devnet/testnet e2e tests The auto-generated CustomAsset.ts contained TypeScript declare fields that Playwright's Babel transform cannot handle. The deploy script already strips these, but devnet/testnet workflows use committed files directly. --- .../src/contracts/contracts/CustomAsset.ts | 32 - .../contracts/contracts/CustomAsset.ts.bak | 618 ------------------ 2 files changed, 650 deletions(-) delete mode 100644 packages/e2e-contract-tests/src/contracts/contracts/CustomAsset.ts.bak diff --git a/packages/e2e-contract-tests/src/contracts/contracts/CustomAsset.ts b/packages/e2e-contract-tests/src/contracts/contracts/CustomAsset.ts index 155179e6b..e7306124f 100644 --- a/packages/e2e-contract-tests/src/contracts/contracts/CustomAsset.ts +++ b/packages/e2e-contract-tests/src/contracts/contracts/CustomAsset.ts @@ -571,44 +571,12 @@ export class CustomAssetInterface extends Interface { super(abi); } - declare functions: { - decimals: FunctionFragment; - name: FunctionFragment; - symbol: FunctionFragment; - total_assets: FunctionFragment; - total_supply: FunctionFragment; - burn: FunctionFragment; - mint: FunctionFragment; - deposit: FunctionFragment; - deposit_half: FunctionFragment; - deposit_half_and_mint: FunctionFragment; - deposit_half_and_mint_from_external_contract: FunctionFragment; - panic_tx: FunctionFragment; - revert_tx: FunctionFragment; - }; } export class CustomAsset extends __Contract { static readonly abi = abi; static readonly storageSlots = storageSlots; - declare interface: CustomAssetInterface; - declare functions: { - decimals: InvokeFunction<[asset: AssetIdInput], Option>; - name: InvokeFunction<[asset: AssetIdInput], Option>; - symbol: InvokeFunction<[asset: AssetIdInput], Option>; - total_assets: InvokeFunction<[], BN>; - total_supply: InvokeFunction<[asset: AssetIdInput], Option>; - burn: InvokeFunction<[sub_id: string, amount: BigNumberish], void>; - mint: InvokeFunction<[recipient: IdentityInput, sub_id: Option, amount: BigNumberish], void>; - deposit: InvokeFunction<[], BN>; - deposit_half: InvokeFunction<[], BN>; - deposit_half_and_mint: InvokeFunction<[recipient: IdentityInput, sub_id: string, amount: BigNumberish], BN>; - deposit_half_and_mint_from_external_contract: InvokeFunction<[recipient: IdentityInput, sub_id: string, amount: BigNumberish, contract_id: ContractIdInput], BN>; - panic_tx: InvokeFunction<[], void>; - revert_tx: InvokeFunction<[], void>; - }; - constructor( id: string | Address, accountOrProvider: Account | Provider, diff --git a/packages/e2e-contract-tests/src/contracts/contracts/CustomAsset.ts.bak b/packages/e2e-contract-tests/src/contracts/contracts/CustomAsset.ts.bak deleted file mode 100644 index abb9deb79..000000000 --- a/packages/e2e-contract-tests/src/contracts/contracts/CustomAsset.ts.bak +++ /dev/null @@ -1,618 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ - -/* eslint-disable max-classes-per-file */ -/* eslint-disable @typescript-eslint/no-unused-vars */ -/* eslint-disable @typescript-eslint/consistent-type-imports */ - -/* - Fuels version: 0.100.0 - Forc version: 0.67.0 - Fuel-Core version: 0.41.9 -*/ - -import { Contract as __Contract, Interface } from "fuels"; -import type { - Provider, - Account, - StorageSlot, - Address, - BigNumberish, - BN, - Bytes, - FunctionFragment, - InvokeFunction, - StdString, -} from 'fuels'; - -import type { Option, Enum } from "./common"; - -export enum BurnErrorInput { NotEnoughCoins = 'NotEnoughCoins', ZeroAmount = 'ZeroAmount' }; -export enum BurnErrorOutput { NotEnoughCoins = 'NotEnoughCoins', ZeroAmount = 'ZeroAmount' }; -export type IdentityInput = Enum<{ Address: AddressInput, ContractId: ContractIdInput }>; -export type IdentityOutput = Enum<{ Address: AddressOutput, ContractId: ContractIdOutput }>; -export enum MintErrorInput { ZeroAmount = 'ZeroAmount' }; -export enum MintErrorOutput { ZeroAmount = 'ZeroAmount' }; - -export type AddressInput = { bits: string }; -export type AddressOutput = AddressInput; -export type AssetIdInput = { bits: string }; -export type AssetIdOutput = AssetIdInput; -export type ContractIdInput = { bits: string }; -export type ContractIdOutput = ContractIdInput; -export type TotalSupplyEventInput = { asset: AssetIdInput, supply: BigNumberish, sender: IdentityInput }; -export type TotalSupplyEventOutput = { asset: AssetIdOutput, supply: BN, sender: IdentityOutput }; - -const abi = { - "programType": "contract", - "specVersion": "1", - "encodingVersion": "1", - "concreteTypes": [ - { - "type": "()", - "concreteTypeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d" - }, - { - "type": "b256", - "concreteTypeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b" - }, - { - "type": "enum std::identity::Identity", - "concreteTypeId": "ab7cd04e05be58e3fc15d424c2c4a57f824a2a2d97d67252440a3925ebdc1335", - "metadataTypeId": 0 - }, - { - "type": "enum std::option::Option", - "concreteTypeId": "0c2beb9013490c4f753f2757dfe2d8340b22ce3827d596d81d249b7038033cb6", - "metadataTypeId": 1, - "typeArguments": [ - "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b" - ] - }, - { - "type": "enum std::option::Option", - "concreteTypeId": "7c06d929390a9aeeb8ffccf8173ac0d101a9976d99dda01cce74541a81e75ac0", - "metadataTypeId": 1, - "typeArguments": [ - "9a7f1d3e963c10e0a4ea70a8e20a4813d1dc5682e28f74cb102ae50d32f7f98c" - ] - }, - { - "type": "enum std::option::Option", - "concreteTypeId": "d852149004cc9ec0bbe7dc4e37bffea1d41469b759512b6136f2e865a4c06e7d", - "metadataTypeId": 1, - "typeArguments": [ - "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0" - ] - }, - { - "type": "enum std::option::Option", - "concreteTypeId": "2da102c46c7263beeed95818cd7bee801716ba8303dddafdcd0f6c9efda4a0f1", - "metadataTypeId": 1, - "typeArguments": [ - "c89951a24c6ca28c13fd1cfdc646b2b656d69e61a92b91023be7eb58eb914b6b" - ] - }, - { - "type": "enum sway_libs::asset::errors::BurnError", - "concreteTypeId": "3acdc2adac8e0589c5864525e0edc9dc61a9571a4d09c3c57b58ea76d33f4b46", - "metadataTypeId": 2 - }, - { - "type": "enum sway_libs::asset::errors::MintError", - "concreteTypeId": "dff9dfec998a49b40f1c4b09567400f0e712aaf939c08f7d07bc5c63116e1084", - "metadataTypeId": 3 - }, - { - "type": "struct standards::src20::TotalSupplyEvent", - "concreteTypeId": "f255d5cc2114d1b6bc34bef4c28d4b60caccffd9a672ed16b79ea217e1c4a8a3", - "metadataTypeId": 6 - }, - { - "type": "struct std::asset_id::AssetId", - "concreteTypeId": "c0710b6731b1dd59799cf6bef33eee3b3b04a2e40e80a0724090215bbf2ca974", - "metadataTypeId": 8 - }, - { - "type": "struct std::contract_id::ContractId", - "concreteTypeId": "29c10735d33b5159f0c71ee1dbd17b36a3e69e41f00fab0d42e1bd9f428d8a54", - "metadataTypeId": 11 - }, - { - "type": "struct std::string::String", - "concreteTypeId": "9a7f1d3e963c10e0a4ea70a8e20a4813d1dc5682e28f74cb102ae50d32f7f98c", - "metadataTypeId": 12 - }, - { - "type": "u64", - "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0" - }, - { - "type": "u8", - "concreteTypeId": "c89951a24c6ca28c13fd1cfdc646b2b656d69e61a92b91023be7eb58eb914b6b" - } - ], - "metadataTypes": [ - { - "type": "enum std::identity::Identity", - "metadataTypeId": 0, - "components": [ - { - "name": "Address", - "typeId": 7 - }, - { - "name": "ContractId", - "typeId": 11 - } - ] - }, - { - "type": "enum std::option::Option", - "metadataTypeId": 1, - "components": [ - { - "name": "None", - "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d" - }, - { - "name": "Some", - "typeId": 4 - } - ], - "typeParameters": [ - 4 - ] - }, - { - "type": "enum sway_libs::asset::errors::BurnError", - "metadataTypeId": 2, - "components": [ - { - "name": "NotEnoughCoins", - "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d" - }, - { - "name": "ZeroAmount", - "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d" - } - ] - }, - { - "type": "enum sway_libs::asset::errors::MintError", - "metadataTypeId": 3, - "components": [ - { - "name": "ZeroAmount", - "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d" - } - ] - }, - { - "type": "generic T", - "metadataTypeId": 4 - }, - { - "type": "raw untyped ptr", - "metadataTypeId": 5 - }, - { - "type": "struct standards::src20::TotalSupplyEvent", - "metadataTypeId": 6, - "components": [ - { - "name": "asset", - "typeId": 8 - }, - { - "name": "supply", - "typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0" - }, - { - "name": "sender", - "typeId": 0 - } - ] - }, - { - "type": "struct std::address::Address", - "metadataTypeId": 7, - "components": [ - { - "name": "bits", - "typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b" - } - ] - }, - { - "type": "struct std::asset_id::AssetId", - "metadataTypeId": 8, - "components": [ - { - "name": "bits", - "typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b" - } - ] - }, - { - "type": "struct std::bytes::Bytes", - "metadataTypeId": 9, - "components": [ - { - "name": "buf", - "typeId": 10 - }, - { - "name": "len", - "typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0" - } - ] - }, - { - "type": "struct std::bytes::RawBytes", - "metadataTypeId": 10, - "components": [ - { - "name": "ptr", - "typeId": 5 - }, - { - "name": "cap", - "typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0" - } - ] - }, - { - "type": "struct std::contract_id::ContractId", - "metadataTypeId": 11, - "components": [ - { - "name": "bits", - "typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b" - } - ] - }, - { - "type": "struct std::string::String", - "metadataTypeId": 12, - "components": [ - { - "name": "bytes", - "typeId": 9 - } - ] - } - ], - "functions": [ - { - "inputs": [ - { - "name": "asset", - "concreteTypeId": "c0710b6731b1dd59799cf6bef33eee3b3b04a2e40e80a0724090215bbf2ca974" - } - ], - "name": "decimals", - "output": "2da102c46c7263beeed95818cd7bee801716ba8303dddafdcd0f6c9efda4a0f1", - "attributes": [ - { - "name": "storage", - "arguments": [ - "read" - ] - } - ] - }, - { - "inputs": [ - { - "name": "asset", - "concreteTypeId": "c0710b6731b1dd59799cf6bef33eee3b3b04a2e40e80a0724090215bbf2ca974" - } - ], - "name": "name", - "output": "7c06d929390a9aeeb8ffccf8173ac0d101a9976d99dda01cce74541a81e75ac0", - "attributes": [ - { - "name": "storage", - "arguments": [ - "read" - ] - } - ] - }, - { - "inputs": [ - { - "name": "asset", - "concreteTypeId": "c0710b6731b1dd59799cf6bef33eee3b3b04a2e40e80a0724090215bbf2ca974" - } - ], - "name": "symbol", - "output": "7c06d929390a9aeeb8ffccf8173ac0d101a9976d99dda01cce74541a81e75ac0", - "attributes": [ - { - "name": "storage", - "arguments": [ - "read" - ] - } - ] - }, - { - "inputs": [], - "name": "total_assets", - "output": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0", - "attributes": [ - { - "name": "storage", - "arguments": [ - "read" - ] - } - ] - }, - { - "inputs": [ - { - "name": "asset", - "concreteTypeId": "c0710b6731b1dd59799cf6bef33eee3b3b04a2e40e80a0724090215bbf2ca974" - } - ], - "name": "total_supply", - "output": "d852149004cc9ec0bbe7dc4e37bffea1d41469b759512b6136f2e865a4c06e7d", - "attributes": [ - { - "name": "storage", - "arguments": [ - "read" - ] - } - ] - }, - { - "inputs": [ - { - "name": "sub_id", - "concreteTypeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b" - }, - { - "name": "amount", - "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0" - } - ], - "name": "burn", - "output": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d", - "attributes": [ - { - "name": "storage", - "arguments": [ - "read", - "write" - ] - }, - { - "name": "payable", - "arguments": [] - } - ] - }, - { - "inputs": [ - { - "name": "recipient", - "concreteTypeId": "ab7cd04e05be58e3fc15d424c2c4a57f824a2a2d97d67252440a3925ebdc1335" - }, - { - "name": "sub_id", - "concreteTypeId": "0c2beb9013490c4f753f2757dfe2d8340b22ce3827d596d81d249b7038033cb6" - }, - { - "name": "amount", - "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0" - } - ], - "name": "mint", - "output": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d", - "attributes": [ - { - "name": "storage", - "arguments": [ - "read", - "write" - ] - } - ] - }, - { - "inputs": [], - "name": "deposit", - "output": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0", - "attributes": [ - { - "name": "storage", - "arguments": [ - "read", - "write" - ] - }, - { - "name": "payable", - "arguments": [] - } - ] - }, - { - "inputs": [], - "name": "deposit_half", - "output": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0", - "attributes": [ - { - "name": "storage", - "arguments": [ - "read", - "write" - ] - }, - { - "name": "payable", - "arguments": [] - } - ] - }, - { - "inputs": [ - { - "name": "recipient", - "concreteTypeId": "ab7cd04e05be58e3fc15d424c2c4a57f824a2a2d97d67252440a3925ebdc1335" - }, - { - "name": "sub_id", - "concreteTypeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b" - }, - { - "name": "amount", - "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0" - } - ], - "name": "deposit_half_and_mint", - "output": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0", - "attributes": [ - { - "name": "storage", - "arguments": [ - "read", - "write" - ] - }, - { - "name": "payable", - "arguments": [] - } - ] - }, - { - "inputs": [ - { - "name": "recipient", - "concreteTypeId": "ab7cd04e05be58e3fc15d424c2c4a57f824a2a2d97d67252440a3925ebdc1335" - }, - { - "name": "sub_id", - "concreteTypeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b" - }, - { - "name": "amount", - "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0" - }, - { - "name": "contract_id", - "concreteTypeId": "29c10735d33b5159f0c71ee1dbd17b36a3e69e41f00fab0d42e1bd9f428d8a54" - } - ], - "name": "deposit_half_and_mint_from_external_contract", - "output": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0", - "attributes": [ - { - "name": "storage", - "arguments": [ - "read", - "write" - ] - }, - { - "name": "payable", - "arguments": [] - } - ] - }, - { - "inputs": [], - "name": "panic_tx", - "output": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d", - "attributes": null - }, - { - "inputs": [], - "name": "revert_tx", - "output": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d", - "attributes": null - } - ], - "loggedTypes": [ - { - "logId": "4237256875605624201", - "concreteTypeId": "3acdc2adac8e0589c5864525e0edc9dc61a9571a4d09c3c57b58ea76d33f4b46" - }, - { - "logId": "17462098202904023478", - "concreteTypeId": "f255d5cc2114d1b6bc34bef4c28d4b60caccffd9a672ed16b79ea217e1c4a8a3" - }, - { - "logId": "16139176946940135860", - "concreteTypeId": "dff9dfec998a49b40f1c4b09567400f0e712aaf939c08f7d07bc5c63116e1084" - }, - { - "logId": "877053556485065807", - "concreteTypeId": "0c2beb9013490c4f753f2757dfe2d8340b22ce3827d596d81d249b7038033cb6" - } - ], - "messagesTypes": [], - "configurables": [] -}; - -const storageSlots: StorageSlot[] = [ - { - "key": "ad0db2b0fc00bf54d2d0159d8639f4a8f48be8403564992aaaac00d69daa3137", - "value": "0000000000000000000000000000000000000000000000000000000000000000" - } -]; - -export class CustomAssetInterface extends Interface { - constructor() { - super(abi); - } - - declare functions: { - decimals: FunctionFragment; - name: FunctionFragment; - symbol: FunctionFragment; - total_assets: FunctionFragment; - total_supply: FunctionFragment; - burn: FunctionFragment; - mint: FunctionFragment; - deposit: FunctionFragment; - deposit_half: FunctionFragment; - deposit_half_and_mint: FunctionFragment; - deposit_half_and_mint_from_external_contract: FunctionFragment; - panic_tx: FunctionFragment; - revert_tx: FunctionFragment; - }; -} - -export class CustomAsset extends __Contract { - static readonly abi = abi; - static readonly storageSlots = storageSlots; - - declare interface: CustomAssetInterface; - declare functions: { - decimals: InvokeFunction<[asset: AssetIdInput], Option>; - name: InvokeFunction<[asset: AssetIdInput], Option>; - symbol: InvokeFunction<[asset: AssetIdInput], Option>; - total_assets: InvokeFunction<[], BN>; - total_supply: InvokeFunction<[asset: AssetIdInput], Option>; - burn: InvokeFunction<[sub_id: string, amount: BigNumberish], void>; - mint: InvokeFunction<[recipient: IdentityInput, sub_id: Option, amount: BigNumberish], void>; - deposit: InvokeFunction<[], BN>; - deposit_half: InvokeFunction<[], BN>; - deposit_half_and_mint: InvokeFunction<[recipient: IdentityInput, sub_id: string, amount: BigNumberish], BN>; - deposit_half_and_mint_from_external_contract: InvokeFunction<[recipient: IdentityInput, sub_id: string, amount: BigNumberish, contract_id: ContractIdInput], BN>; - panic_tx: InvokeFunction<[], void>; - revert_tx: InvokeFunction<[], void>; - }; - - constructor( - id: string | Address, - accountOrProvider: Account | Provider, - ) { - super(id, abi, accountOrProvider); - } -} From 35f5bf601d254e49bda4bef876e37897705f88aa Mon Sep 17 00:00:00 2001 From: Nelito Junior Date: Thu, 19 Feb 2026 16:21:55 -0300 Subject: [PATCH 02/13] fix: replace brittle XPath selector with DB lookup in getAddressForAccountNumber The e2e test used a hardcoded XPath to find accounts by list position, but the UI sorts accounts alphabetically with the current account pinned first, causing position mismatches and test failures. --- packages/app/playwright/crx/utils/popup.ts | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/packages/app/playwright/crx/utils/popup.ts b/packages/app/playwright/crx/utils/popup.ts index 52a432074..bfbe312e6 100644 --- a/packages/app/playwright/crx/utils/popup.ts +++ b/packages/app/playwright/crx/utils/popup.ts @@ -1,6 +1,7 @@ import type { Page } from '@playwright/test'; import { expect } from '@fuels/playwright-utils'; +import { Address } from 'fuels'; import { getByAriaLabel, hasText, visit, waitAriaLabel } from '../../commons'; import type { MockData } from '../../mocks'; @@ -108,22 +109,9 @@ export async function getClipboardText(popupPage: Page): Promise { export async function getAddressForAccountNumber( popupPage: Page, accountName: string, - accountNumber: number + _accountNumber: number ): Promise { - await getByAriaLabel(popupPage, 'Accounts').click(); - - // Construct the XPath selector dynamically based on the order of the account in the list - const xpathSelector = `/html/body/div[2]/div/div/div/div/article[${accountNumber}]/div[1]/div[2]/div/div/button`; - - // Click on the element - await popupPage.click(`xpath=${xpathSelector}`); - - await getByAriaLabel(popupPage, accountName).click({ - position: { - x: 10, - y: 10, - }, - }); - - return getClipboardText(popupPage); + const account = await getAccountByName(popupPage, accountName); + if (!account?.address) return ''; + return Address.fromDynamicInput(account.address).toString(); } From 299b6665feae8e1d57c55356e802d0bbc3410758 Mon Sep 17 00:00:00 2001 From: Nelito Junior Date: Thu, 19 Feb 2026 22:31:15 -0300 Subject: [PATCH 03/13] Remove duplicate declarations and backup file Remove redundant `declare` blocks from CustomAsset.ts (the `interface` and `functions` type declarations) to clean up generated TypeScript typings. Also delete the outdated CustomAsset.ts.bak backup file. This is a non-functional cleanup to reduce duplicate/type clutter in the contract bindings. --- .../playwright/e2e/ForwardCustomAsset.test.ts | 2 +- .../e2e/ForwardHalfCustomAsset.test.ts | 2 +- .../playwright/e2e/MintAsset.test.ts | 4 +- .../playwright-utils/fuelWalletTestHelper.ts | 60 +++++++++---------- 4 files changed, 32 insertions(+), 36 deletions(-) diff --git a/packages/e2e-contract-tests/playwright/e2e/ForwardCustomAsset.test.ts b/packages/e2e-contract-tests/playwright/e2e/ForwardCustomAsset.test.ts index 5435dd7cc..96cf8f6b3 100644 --- a/packages/e2e-contract-tests/playwright/e2e/ForwardCustomAsset.test.ts +++ b/packages/e2e-contract-tests/playwright/e2e/ForwardCustomAsset.test.ts @@ -30,7 +30,7 @@ test.describe('Forward Custom Asset', () => { context, page, extensionId, - amountToFund: bn.parseUnits('0.001'), + amountToFund: bn.parseUnits('0.01'), })); }); diff --git a/packages/e2e-contract-tests/playwright/e2e/ForwardHalfCustomAsset.test.ts b/packages/e2e-contract-tests/playwright/e2e/ForwardHalfCustomAsset.test.ts index 0e1eadd79..5ac91a30d 100644 --- a/packages/e2e-contract-tests/playwright/e2e/ForwardHalfCustomAsset.test.ts +++ b/packages/e2e-contract-tests/playwright/e2e/ForwardHalfCustomAsset.test.ts @@ -33,7 +33,7 @@ test.describe('Forward Half Custom Asset', () => { context, page, extensionId, - amountToFund: bn.parseUnits('0.001'), + amountToFund: bn.parseUnits('0.01'), })); }); diff --git a/packages/e2e-contract-tests/playwright/e2e/MintAsset.test.ts b/packages/e2e-contract-tests/playwright/e2e/MintAsset.test.ts index 6fd97fa11..ee864da11 100644 --- a/packages/e2e-contract-tests/playwright/e2e/MintAsset.test.ts +++ b/packages/e2e-contract-tests/playwright/e2e/MintAsset.test.ts @@ -38,7 +38,7 @@ test.describe('Mint Assets', () => { context, page, extensionId, - amountToFund: bn.parseUnits('0.001'), + amountToFund: bn.parseUnits('0.01'), })); }); @@ -63,7 +63,7 @@ test.describe('Mint Assets', () => { // test asset is correct const assetId = calculateAssetId(MAIN_CONTRACT_ID, await getBaseAssetId()); - await page.waitForTimeout(10000); // Wait for slow VM + await page.waitForTimeout(2000); // Brief wait before popup detection const walletNotificationPage = await fuelWalletTestHelper.getWalletPopupPage(); diff --git a/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts b/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts index 5ca440c92..fcc3beb60 100644 --- a/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts +++ b/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts @@ -135,46 +135,42 @@ export class FuelWalletTestHelper { } async getWalletPopupPage(): Promise { - console.log( - '🔍 Searching for existing wallet popup page in', - this.context.pages().map((page) => page.url()) - ); - console.log(`Timestamp: ${Date.now()}`); - let walletNotificationPage = this.context.pages().find((page) => { - const url = page.url(); - return url.includes('/popup.html?'); - }); + const findPopup = () => + this.context.pages().find((page) => { + const url = page.url(); + return url.includes('/popup.html?'); + }); - if (!walletNotificationPage) { - console.log('⏳ No existing popup found, waiting for popup event...'); - walletNotificationPage = await this.context.waitForEvent('page', { + // First check if popup is already open + let walletNotificationPage = findPopup(); + if (walletNotificationPage) { + return walletNotificationPage; + } + + // Listen for new page events AND poll existing pages to avoid race conditions + // where the popup opens between the initial check and waitForEvent registration + const popupPromise = this.context + .waitForEvent('page', { predicate: (page) => page.url().includes('/popup'), timeout: 30000, - }); - console.log( - '🔍 Searching for existing wallet popup page in', - this.context.pages().map((page) => page.url()) - ); - console.log(`Timestamp: ${Date.now()}`); - // If the popup is not found, try to find it in the pages again - if (!walletNotificationPage) { - walletNotificationPage = this.context.pages().find((page) => { - const url = page.url(); - return url.includes('/popup.html?'); - }); + }) + .catch(() => undefined); + + const startTime = Date.now(); + while (Date.now() - startTime < 30000) { + walletNotificationPage = findPopup(); + if (walletNotificationPage) { + return walletNotificationPage; } + await new Promise((resolve) => setTimeout(resolve, 500)); } + + // Last resort: check if waitForEvent caught it + walletNotificationPage = (await popupPromise) || findPopup(); + if (!walletNotificationPage) { - console.log( - '🔍 No popup found in', - this.context.pages().map((page) => page.url()) - ); throw new Error('No popup found'); } - console.log( - '🔍 Returning popup page with URL:', - walletNotificationPage?.url() - ); return walletNotificationPage; } From 12ddce6ecf4dbbdd56c34037df1b8fc1a938f5fa Mon Sep 17 00:00:00 2001 From: Nelito Junior Date: Thu, 19 Feb 2026 23:42:59 -0300 Subject: [PATCH 04/13] fix: redeploy testnet contracts and regenerate types --- packages/e2e-contract-tests/src/contract-ids.testnet.json | 4 ++-- .../e2e-contract-tests/src/contracts/contracts/CustomAsset.ts | 3 ++- .../src/contracts/contracts/CustomAssetFactory.ts | 2 +- packages/e2e-contract-tests/src/contracts/contracts/common.ts | 2 +- packages/e2e-contract-tests/src/contracts/contracts/index.ts | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/e2e-contract-tests/src/contract-ids.testnet.json b/packages/e2e-contract-tests/src/contract-ids.testnet.json index d5b94c65f..90b82b57d 100644 --- a/packages/e2e-contract-tests/src/contract-ids.testnet.json +++ b/packages/e2e-contract-tests/src/contract-ids.testnet.json @@ -1,4 +1,4 @@ { - "ExternalContract": "0x77ed3b607f7a316b2b95684be600a2b44c570a4d99bba091205df76fcba53113", - "MainContract": "0xcfd33edad0a69a9bed46547e4e9f0f07dc241e6c6f665b8fa62fc72d49452f24" + "ExternalContract": "0xaaf03c1b56b8e5499b9bf721c8f341831a1804203207c768800f4c06ab7e5898", + "MainContract": "0xc6dcdbb73792db28376817e35690bf6ca4dd11ba72a8b5f0e013c34e52324c90" } diff --git a/packages/e2e-contract-tests/src/contracts/contracts/CustomAsset.ts b/packages/e2e-contract-tests/src/contracts/contracts/CustomAsset.ts index e7306124f..a133f4df1 100644 --- a/packages/e2e-contract-tests/src/contracts/contracts/CustomAsset.ts +++ b/packages/e2e-contract-tests/src/contracts/contracts/CustomAsset.ts @@ -5,7 +5,7 @@ /* eslint-disable @typescript-eslint/consistent-type-imports */ /* - Fuels version: 0.100.6 + Fuels version: 0.103.0 Forc version: 0.68.1 Fuel-Core version: 0.43.1 */ @@ -577,6 +577,7 @@ export class CustomAsset extends __Contract { static readonly abi = abi; static readonly storageSlots = storageSlots; + constructor( id: string | Address, accountOrProvider: Account | Provider, diff --git a/packages/e2e-contract-tests/src/contracts/contracts/CustomAssetFactory.ts b/packages/e2e-contract-tests/src/contracts/contracts/CustomAssetFactory.ts index 963978f13..ce076a317 100644 --- a/packages/e2e-contract-tests/src/contracts/contracts/CustomAssetFactory.ts +++ b/packages/e2e-contract-tests/src/contracts/contracts/CustomAssetFactory.ts @@ -5,7 +5,7 @@ /* eslint-disable @typescript-eslint/consistent-type-imports */ /* - Fuels version: 0.100.6 + Fuels version: 0.103.0 Forc version: 0.68.1 Fuel-Core version: 0.43.1 */ diff --git a/packages/e2e-contract-tests/src/contracts/contracts/common.ts b/packages/e2e-contract-tests/src/contracts/contracts/common.ts index 0d5cb59ff..bd895fab2 100644 --- a/packages/e2e-contract-tests/src/contracts/contracts/common.ts +++ b/packages/e2e-contract-tests/src/contracts/contracts/common.ts @@ -5,7 +5,7 @@ /* eslint-disable @typescript-eslint/consistent-type-imports */ /* - Fuels version: 0.100.6 + Fuels version: 0.103.0 Forc version: 0.68.1 Fuel-Core version: 0.43.1 */ diff --git a/packages/e2e-contract-tests/src/contracts/contracts/index.ts b/packages/e2e-contract-tests/src/contracts/contracts/index.ts index 64172b90e..0371a40fe 100644 --- a/packages/e2e-contract-tests/src/contracts/contracts/index.ts +++ b/packages/e2e-contract-tests/src/contracts/contracts/index.ts @@ -5,7 +5,7 @@ /* eslint-disable @typescript-eslint/consistent-type-imports */ /* - Fuels version: 0.100.6 + Fuels version: 0.103.0 Forc version: 0.68.1 Fuel-Core version: 0.43.1 */ From dbebcbc2635d26f443da62c057a3bf24e67e506f Mon Sep 17 00:00:00 2001 From: Nelito Junior Date: Fri, 20 Feb 2026 09:27:50 -0300 Subject: [PATCH 05/13] fix: redeploy devnet contracts and update contract IDs --- packages/e2e-contract-tests/src/contract-ids.devnet.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/e2e-contract-tests/src/contract-ids.devnet.json b/packages/e2e-contract-tests/src/contract-ids.devnet.json index 87559bb4a..88b3670f8 100644 --- a/packages/e2e-contract-tests/src/contract-ids.devnet.json +++ b/packages/e2e-contract-tests/src/contract-ids.devnet.json @@ -1,4 +1,4 @@ { - "ExternalContract": "0xd979f703306204cbcec50fe740d677f842db363090c0f708a5debbe57ec6ba38", - "MainContract": "0xee66b4695109f8b6497aafbac959c20a398a20dd8a55603e27a6020834dceb21" + "ExternalContract": "0xa7ac82064995d8a534efcc7a0cf24619789ac4664aa29ec20a122183327b9a2c", + "MainContract": "0xee7552b40c6b23ebbfa20217aaef6c3358f41277b548740607fdeae1d6b97790" } From 20df877a11c96865666c511c3e4cb2f273c18b59 Mon Sep 17 00:00:00 2001 From: Nelito Junior Date: Fri, 20 Feb 2026 11:56:40 -0300 Subject: [PATCH 06/13] fix: update devnet network name to match actual chain name 'Fuel Ignition Sepolia Devnet' --- packages/app/src/networks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/networks.ts b/packages/app/src/networks.ts index c10e9e32f..5a89fc416 100644 --- a/packages/app/src/networks.ts +++ b/packages/app/src/networks.ts @@ -24,7 +24,7 @@ export const DEFAULT_NETWORKS: Array< isSelected: false, }, { - name: 'Fuel Sepolia Devnet', + name: 'Fuel Ignition Sepolia Devnet', url: 'https://devnet.fuel.network/v1/graphql', chainId: CHAIN_IDS.fuel.devnet, explorerUrl: 'https://app-devnet.fuel.network', From 65c51ba3478013256adbddf937adeb96e276cde1 Mon Sep 17 00:00:00 2001 From: Nelito Junior Date: Fri, 20 Feb 2026 14:12:57 -0300 Subject: [PATCH 07/13] fix: wait for network switch confirmation in addNetwork click path --- .../src/playwright-utils/fuelWalletTestHelper.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts b/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts index fcc3beb60..a7b3037f4 100644 --- a/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts +++ b/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts @@ -287,6 +287,10 @@ export class FuelWalletTestHelper { if (hasNetwork) { await networkLocator.click(); + // Wait for the network switch to complete before returning + await networksButton + .getByText(chainName) + .waitFor({ state: 'visible', timeout: 10000 }); return; } From 1c0beffad212a3275677f41ed620437893ed0b5a Mon Sep 17 00:00:00 2001 From: Nelito Junior Date: Fri, 20 Feb 2026 17:38:20 -0300 Subject: [PATCH 08/13] fix: use correct chainId in dApp Providers based on network URL --- .../e2e-contract-tests/src/components/Providers.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/e2e-contract-tests/src/components/Providers.tsx b/packages/e2e-contract-tests/src/components/Providers.tsx index a7e89ce3c..11be51cd3 100644 --- a/packages/e2e-contract-tests/src/components/Providers.tsx +++ b/packages/e2e-contract-tests/src/components/Providers.tsx @@ -4,6 +4,7 @@ import { } from '@fuels/connectors'; import { FuelProvider, type UIConfig } from '@fuels/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { CHAIN_IDS } from 'fuels'; import type { FuelConfig, Network } from 'fuels'; import type { ReactNode } from 'react'; @@ -13,11 +14,15 @@ type ProviderProps = { const queryClient = new QueryClient(); -const CHAIN_ID_LOCAL = 0; +const FUEL_PROVIDER_URL: string = import.meta.env.VITE_FUEL_PROVIDER_URL; +const CHAIN_ID = FUEL_PROVIDER_URL?.includes('devnet') + ? CHAIN_IDS.fuel.devnet + : CHAIN_IDS.fuel.testnet; + const NETWORKS: Array = [ { - chainId: CHAIN_ID_LOCAL, - url: import.meta.env.VITE_FUEL_PROVIDER_URL, + chainId: CHAIN_ID, + url: FUEL_PROVIDER_URL, }, ]; From 7fd5e58a2f91f7d91f151fb92de5038209e7b4e9 Mon Sep 17 00:00:00 2001 From: Nelito Junior Date: Fri, 20 Feb 2026 17:44:20 -0300 Subject: [PATCH 09/13] fix: update popup URL predicate in FuelWalletTestHelper to include .html extension --- .../src/playwright-utils/fuelWalletTestHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts b/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts index a7b3037f4..770ecb5e0 100644 --- a/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts +++ b/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts @@ -151,7 +151,7 @@ export class FuelWalletTestHelper { // where the popup opens between the initial check and waitForEvent registration const popupPromise = this.context .waitForEvent('page', { - predicate: (page) => page.url().includes('/popup'), + predicate: (page) => page.url().includes('/popup.html?'), timeout: 30000, }) .catch(() => undefined); From 6951a53056776da261e2839623a7433f60d14143 Mon Sep 17 00:00:00 2001 From: Nelito Junior Date: Fri, 20 Feb 2026 20:07:43 -0300 Subject: [PATCH 10/13] revert: restore original amountToFund 0.001 in e2e contract tests --- .../playwright/e2e/ForwardCustomAsset.test.ts | 2 +- .../playwright/e2e/ForwardHalfCustomAsset.test.ts | 2 +- packages/e2e-contract-tests/playwright/e2e/MintAsset.test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/e2e-contract-tests/playwright/e2e/ForwardCustomAsset.test.ts b/packages/e2e-contract-tests/playwright/e2e/ForwardCustomAsset.test.ts index 96cf8f6b3..5435dd7cc 100644 --- a/packages/e2e-contract-tests/playwright/e2e/ForwardCustomAsset.test.ts +++ b/packages/e2e-contract-tests/playwright/e2e/ForwardCustomAsset.test.ts @@ -30,7 +30,7 @@ test.describe('Forward Custom Asset', () => { context, page, extensionId, - amountToFund: bn.parseUnits('0.01'), + amountToFund: bn.parseUnits('0.001'), })); }); diff --git a/packages/e2e-contract-tests/playwright/e2e/ForwardHalfCustomAsset.test.ts b/packages/e2e-contract-tests/playwright/e2e/ForwardHalfCustomAsset.test.ts index 5ac91a30d..0e1eadd79 100644 --- a/packages/e2e-contract-tests/playwright/e2e/ForwardHalfCustomAsset.test.ts +++ b/packages/e2e-contract-tests/playwright/e2e/ForwardHalfCustomAsset.test.ts @@ -33,7 +33,7 @@ test.describe('Forward Half Custom Asset', () => { context, page, extensionId, - amountToFund: bn.parseUnits('0.01'), + amountToFund: bn.parseUnits('0.001'), })); }); diff --git a/packages/e2e-contract-tests/playwright/e2e/MintAsset.test.ts b/packages/e2e-contract-tests/playwright/e2e/MintAsset.test.ts index ee864da11..dfb878aad 100644 --- a/packages/e2e-contract-tests/playwright/e2e/MintAsset.test.ts +++ b/packages/e2e-contract-tests/playwright/e2e/MintAsset.test.ts @@ -38,7 +38,7 @@ test.describe('Mint Assets', () => { context, page, extensionId, - amountToFund: bn.parseUnits('0.01'), + amountToFund: bn.parseUnits('0.001'), })); }); From a5bf4767e59512e9990714f13e271b2758ba9570 Mon Sep 17 00:00:00 2001 From: Nelito Junior Date: Mon, 23 Feb 2026 10:44:57 -0300 Subject: [PATCH 11/13] chore: add changelog entry for patch updates to playwright-utils and fuels-wallet --- .changeset/sweet-teachers-live.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/sweet-teachers-live.md diff --git a/.changeset/sweet-teachers-live.md b/.changeset/sweet-teachers-live.md new file mode 100644 index 000000000..ab8e74ea8 --- /dev/null +++ b/.changeset/sweet-teachers-live.md @@ -0,0 +1,6 @@ +--- +"@fuels/playwright-utils": patch +"fuels-wallet": patch +--- + +fix: Workflows From 60a4a716bde9d990c08b361f571ecdfe6a55e3ae Mon Sep 17 00:00:00 2001 From: Nelito Junior Date: Mon, 23 Feb 2026 10:56:09 -0300 Subject: [PATCH 12/13] chore: update fast-xml-parser version range in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 04b0a558e..dcada51de 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "@adobe/css-tools@<4.3.2": ">=4.3.2", "@babel/traverse@<7.23.2": ">=7.23.2", "braces@<3.0.3": ">=3.0.3", - "fast-xml-parser@<4.4.1": ">=4.4.1", + "fast-xml-parser@>=4.1.3 <5.3.5": ">=5.3.5", "ws@>=8.0.0 <8.17.1": ">=8.17.1", "micromatch@<4.0.8": ">=4.0.8", "send@<0.19.0": ">=0.19.0", From d735c555995fbb33c4569ef56bac10c9704fc12e Mon Sep 17 00:00:00 2001 From: Nelito Junior Date: Mon, 23 Feb 2026 11:26:56 -0300 Subject: [PATCH 13/13] chore: update fast-xml-parser and strnum versions in pnpm-lock.yaml --- pnpm-lock.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5f4007398..fadf882ce 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,7 +20,7 @@ overrides: '@adobe/css-tools@<4.3.2': '>=4.3.2' '@babel/traverse@<7.23.2': '>=7.23.2' braces@<3.0.3: '>=3.0.3' - fast-xml-parser@<4.4.1: '>=4.4.1' + fast-xml-parser@>=4.1.3 <5.3.5: '>=5.3.5' ws@>=8.0.0 <8.17.1: '>=8.17.1' micromatch@<4.0.8: '>=4.0.8' send@<0.19.0: '>=0.19.0' @@ -8793,8 +8793,8 @@ packages: fast-uri@3.0.6: resolution: {integrity: sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==} - fast-xml-parser@4.5.3: - resolution: {integrity: sha512-RKihhV+SHsIUGXObeVy9AXiBbFwkVk7Syp8XgwN5U3JV416+Gwp/GO9i0JYKmikykgz/UHRrrV4ROuZEo/T0ig==} + fast-xml-parser@5.3.7: + resolution: {integrity: sha512-JzVLro9NQv92pOM/jTCR6mHlJh2FGwtomH8ZQjhFj/R29P2Fnj38OgPJVtcvYw6SuKClhgYuwUZf5b3rd8u2mA==} hasBin: true fastq@1.15.0: @@ -12715,8 +12715,8 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - strnum@1.1.2: - resolution: {integrity: sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==} + strnum@2.1.2: + resolution: {integrity: sha512-l63NF9y/cLROq/yqKXSLtcMeeyOfnSQlfMSlzFt/K73oIaD8DGaQWd7Z34X9GPiKqP5rbSh84Hl4bOlLcjiSrQ==} style-loader@3.3.3: resolution: {integrity: sha512-53BiGLXAcll9maCYtZi2RCQZKa8NQQai5C4horqKyRmHj9H7QmcUyucrH+4KW/gBQbXM2AsB0axoEcFZPlfPcw==} @@ -21774,7 +21774,7 @@ snapshots: chalk: 4.1.2 execa: 5.1.1 fast-glob: 3.3.3 - fast-xml-parser: 4.5.3 + fast-xml-parser: 5.3.7 logkitty: 0.7.1 '@react-native-community/cli-platform-apple@14.1.0': @@ -21783,7 +21783,7 @@ snapshots: chalk: 4.1.2 execa: 5.1.1 fast-glob: 3.3.3 - fast-xml-parser: 4.5.3 + fast-xml-parser: 5.3.7 ora: 5.4.1 '@react-native-community/cli-platform-ios@14.1.0': @@ -29108,9 +29108,9 @@ snapshots: fast-uri@3.0.6: {} - fast-xml-parser@4.5.3: + fast-xml-parser@5.3.7: dependencies: - strnum: 1.1.2 + strnum: 2.1.2 fastq@1.15.0: dependencies: @@ -34581,7 +34581,7 @@ snapshots: strip-json-comments@3.1.1: {} - strnum@1.1.2: {} + strnum@2.1.2: {} style-loader@3.3.3(webpack@5.88.2(@swc/core@1.3.92(@swc/helpers@0.5.17))(esbuild@0.25.6)): dependencies: