From f62957ede71bc2c4df58d73eba8150b8bf706ea2 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Wed, 22 Jan 2025 18:24:42 -0300 Subject: [PATCH 01/30] feat: speed up account balance fetch --- .../src/systems/Account/services/account.ts | 2 +- .../machines/transactionRequestMachine.tsx | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/app/src/systems/Account/services/account.ts b/packages/app/src/systems/Account/services/account.ts index 36965055be..ce6e2ed63f 100644 --- a/packages/app/src/systems/Account/services/account.ts +++ b/packages/app/src/systems/Account/services/account.ts @@ -27,7 +27,7 @@ export type AccountInputs = { }; fetchBalance: { providerUrl: string; - account?: Maybe; + address: string | undefined; }; fetchAccount: { address: string; diff --git a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx index f1d222d472..e524a79b07 100644 --- a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx +++ b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx @@ -452,13 +452,17 @@ export const transactionRequestMachine = createMachine( if (!input?.address || !input?.providerUrl) { throw new Error('Invalid fetchAccount input'); } - const account = await AccountService.fetchAccount({ - address: input.address, - }); - const accountWithBalances = await AccountService.fetchBalance({ - account, - providerUrl: input.providerUrl, - }); + const [_, accountWithBalances] = await Promise.all([ + AccountService.getCurrentAccount().then((res) => { + if (res?.address !== input.address) { + throw new Error('Current account does not match the address'); + } + }), + AccountService.fetchBalance({ + address: input.address, + providerUrl: input.providerUrl, + }), + ]); return accountWithBalances; }, From bd56c085a635ff161909b298c49d493930362e96 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Wed, 22 Jan 2025 19:06:31 -0300 Subject: [PATCH 02/30] feat: use accounts machine instead of fetching accounts each time --- .../src/systems/Account/services/account.ts | 2 +- .../DApp/hooks/useTransactionRequest.tsx | 35 ++++----- .../machines/transactionRequestMachine.tsx | 71 +++---------------- packages/app/src/systems/DApp/methods.ts | 21 ++++++ .../app/src/systems/Send/hooks/useSend.tsx | 9 ++- .../pages/TxApprove/TxApprove.stories.tsx | 3 +- .../Transaction/services/transaction.tsx | 12 ++-- 7 files changed, 63 insertions(+), 90 deletions(-) diff --git a/packages/app/src/systems/Account/services/account.ts b/packages/app/src/systems/Account/services/account.ts index ce6e2ed63f..36965055be 100644 --- a/packages/app/src/systems/Account/services/account.ts +++ b/packages/app/src/systems/Account/services/account.ts @@ -27,7 +27,7 @@ export type AccountInputs = { }; fetchBalance: { providerUrl: string; - address: string | undefined; + account?: Maybe; }; fetchAccount: { address: string; diff --git a/packages/app/src/systems/DApp/hooks/useTransactionRequest.tsx b/packages/app/src/systems/DApp/hooks/useTransactionRequest.tsx index 6ff1ba477f..554cf9872c 100644 --- a/packages/app/src/systems/DApp/hooks/useTransactionRequest.tsx +++ b/packages/app/src/systems/DApp/hooks/useTransactionRequest.tsx @@ -26,9 +26,6 @@ const selectors = { proposedTxRequest(state: TransactionRequestState) { return state.context.response?.proposedTxRequest; }, - isLoadingAccounts(state: TransactionRequestState) { - return state.matches('fetchingAccount'); - }, errors(state: TransactionRequestState) { if (!state.context.errors) return {}; const simulateTxErrors = state.context.errors?.simulateTxErrors; @@ -36,22 +33,19 @@ const selectors = { const txApproveError = state.context.errors?.txApproveError; return { txApproveError, simulateTxErrors, hasSimulateTxErrors }; }, - status(externalLoading?: boolean) { - return useCallback( - (state: TransactionRequestState) => { - const isLoading = state.hasTag('loading'); - const isClosed = state.matches('done') || state.matches('failed'); - - if (state.matches('idle')) return TxRequestStatus.idle; - if (externalLoading || isLoading) return TxRequestStatus.loading; - if (state.matches('txFailed')) return TxRequestStatus.failed; - if (state.matches('txSuccess')) return TxRequestStatus.success; - if (state.matches('sendingTx')) return TxRequestStatus.sending; - if (isClosed) return TxRequestStatus.inactive; - return TxRequestStatus.waitingApproval; - }, - [externalLoading] - ); + status() { + return useCallback((state: TransactionRequestState) => { + const isLoading = state.hasTag('loading'); + const isClosed = state.matches('done') || state.matches('failed'); + + if (state.matches('idle')) return TxRequestStatus.idle; + if (isLoading) return TxRequestStatus.loading; + if (state.matches('txFailed')) return TxRequestStatus.failed; + if (state.matches('txSuccess')) return TxRequestStatus.success; + if (state.matches('sendingTx')) return TxRequestStatus.sending; + if (isClosed) return TxRequestStatus.inactive; + return TxRequestStatus.waitingApproval; + }, []); }, title(state: TransactionRequestState) { if (state.matches('txSuccess')) return 'Transaction sent'; @@ -95,12 +89,11 @@ export function useTransactionRequest(opts: UseTransactionRequestOpts = {}) { }, }); - const isLoadingAccounts = useSelector(service, selectors.isLoadingAccounts); const account = useSelector(service, selectors.account); const ctx = useSelector(service, selectors.context); const errors = useSelector(service, selectors.errors); const providerUrl = ctx.input.providerUrl; - const txStatusSelector = selectors.status(isLoadingAccounts); + const txStatusSelector = selectors.status(); const txStatus = useSelector(service, txStatusSelector); const title = useSelector(service, selectors.title); const txSummarySimulated = useSelector(service, selectors.txSummarySimulated); diff --git a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx index e524a79b07..974e74320d 100644 --- a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx +++ b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx @@ -1,8 +1,7 @@ -import type { Account } from '@fuel-wallet/types'; +import type { Account, AccountWithBalance } from '@fuel-wallet/types'; import type { BN, TransactionRequest, TransactionSummary } from 'fuels'; import type { InterpreterFrom, StateFrom } from 'xstate'; import { assign, createMachine } from 'xstate'; -import { AccountService } from '~/systems/Account'; import { FetchMachine, assignErrorMessage, delay } from '~/systems/Core'; import type { GroupedErrors, VMApiError } from '~/systems/Transaction'; import type { TxInputs } from '~/systems/Transaction/services'; @@ -23,11 +22,10 @@ type MachineContext = { origin?: string; title?: string; favIconUrl?: string; - address?: string; isOriginRequired?: boolean; providerUrl?: string; transactionRequest?: TransactionRequest; - account?: Account; + account?: AccountWithBalance; tip?: BN; gasLimit?: BN; skipCustomFee?: boolean; @@ -78,9 +76,6 @@ type MachineServices = { simulateTransaction: { data: SimulateTransactionReturn; }; - fetchAccount: { - data: Account; - }; }; type MachineEvents = @@ -143,32 +138,13 @@ export const transactionRequestMachine = createMachine( }, { actions: ['assignGasLimit'], - target: 'fetchingAccount', - }, - ], - }, - }, - fetchingAccount: { - entry: ['openDialog'], - tags: ['loading'], - invoke: { - src: 'fetchAccount', - data: { - input: (ctx: MachineContext) => ctx.input, - }, - onDone: [ - { - cond: FetchMachine.hasError, - target: 'failed', - }, - { - actions: ['assignAccount'], target: 'simulatingTransaction', }, ], }, }, simulatingTransaction: { + entry: ['openDialog'], tags: ['loading'], invoke: { src: 'simulateTransaction', @@ -283,28 +259,25 @@ export const transactionRequestMachine = createMachine( maxGasLimit: ev.data.maxGasLimit, }, })), - assignAccount: assign({ - input: (ctx, ev) => ({ - ...ctx.input, - account: ev.data, - }), - }), assignTxRequestData: assign({ input: (ctx, ev) => { const { transactionRequest, origin, - address, providerUrl, title, favIconUrl, skipCustomFee, + account, } = ev.input || {}; if (!providerUrl) { throw new Error('providerUrl is required'); } - if (!address) { + if (!account) { + throw new Error('account is required'); + } + if (!account.address) { throw new Error('address is required'); } if (!transactionRequest) { @@ -317,7 +290,7 @@ export const transactionRequestMachine = createMachine( return { transactionRequest, origin, - address, + account, providerUrl, title, favIconUrl, @@ -427,7 +400,7 @@ export const transactionRequestMachine = createMachine( async fetch(params) { const { input } = params; if ( - !input?.address || + !input?.account || !input?.transactionRequest || !input?.providerUrl ) { @@ -443,30 +416,6 @@ export const transactionRequestMachine = createMachine( }; }, }), - fetchAccount: FetchMachine.create< - { address: string; providerUrl: string }, - Account - >({ - showError: true, - async fetch({ input }) { - if (!input?.address || !input?.providerUrl) { - throw new Error('Invalid fetchAccount input'); - } - const [_, accountWithBalances] = await Promise.all([ - AccountService.getCurrentAccount().then((res) => { - if (res?.address !== input.address) { - throw new Error('Current account does not match the address'); - } - }), - AccountService.fetchBalance({ - address: input.address, - providerUrl: input.providerUrl, - }), - ]); - - return accountWithBalances; - }, - }), }, } ); diff --git a/packages/app/src/systems/DApp/methods.ts b/packages/app/src/systems/DApp/methods.ts index 35e76cdf2d..51dd98926f 100644 --- a/packages/app/src/systems/DApp/methods.ts +++ b/packages/app/src/systems/DApp/methods.ts @@ -2,6 +2,7 @@ import { ExtensionPageConnection } from '@fuel-wallet/connections'; import { transactionRequestify } from 'fuels'; import { IS_CRX } from '~/config'; import { Services, store } from '~/store'; +import { AccountService } from '~/systems/Account/services/account'; import type { MessageInputs, PopUpServiceInputs, @@ -51,11 +52,31 @@ export class RequestMethods extends ExtensionPageConnection { const { origin, address, provider, transaction, title, favIconUrl } = input; const providerUrl = provider.url; const transactionRequest = transactionRequestify(JSON.parse(transaction)); + let currentAccountWithBalance = store.getStateFrom(Services.accounts) + .context.account; + if (!currentAccountWithBalance && address) { + const account = await AccountService.fetchAccount({ + address: input.address, + }); + currentAccountWithBalance = await AccountService.fetchBalance({ + account, + providerUrl, + }); + } + if ( + currentAccountWithBalance?.address !== address || + !currentAccountWithBalance + ) { + throw new Error( + `Origin: ${address} does not match current account: ${currentAccountWithBalance?.address}` + ); + } const state = await store .requestTransaction({ origin, transactionRequest, address, + account: currentAccountWithBalance, providerUrl, title, favIconUrl, diff --git a/packages/app/src/systems/Send/hooks/useSend.tsx b/packages/app/src/systems/Send/hooks/useSend.tsx index 05dfbcf8ba..f9ebec788f 100644 --- a/packages/app/src/systems/Send/hooks/useSend.tsx +++ b/packages/app/src/systems/Send/hooks/useSend.tsx @@ -12,6 +12,8 @@ import { useTransactionRequest } from '~/systems/DApp'; import { TxRequestStatus } from '~/systems/DApp/machines/transactionRequestMachine'; import type { TxInputs } from '~/systems/Transaction/services'; +import { Services } from '~/store'; +import { store } from '~/store'; import { AssetsCache } from '~/systems/Asset/cache/AssetsCache'; import { useProvider } from '~/systems/Network/hooks/useProvider'; import { formatGasLimit } from '~/systems/Transaction'; @@ -273,9 +275,13 @@ const DEFAULT_VALUES: SendFormValues = { export function useSend() { const navigate = useNavigate(); const txRequest = useTransactionRequest(); - const { account } = useAccounts(); const provider = useProvider(); + const account = store.useSelector( + Services.accounts, + (state) => state.context.account + ); + const service = useInterpret(() => sendMachine.withConfig({ actions: { @@ -299,6 +305,7 @@ export function useSend() { txRequest.handlers.request({ providerUrl, transactionRequest, + account, address, fees: { baseFee, diff --git a/packages/app/src/systems/Transaction/pages/TxApprove/TxApprove.stories.tsx b/packages/app/src/systems/Transaction/pages/TxApprove/TxApprove.stories.tsx index a38c1bcec1..d357aa8de6 100644 --- a/packages/app/src/systems/Transaction/pages/TxApprove/TxApprove.stories.tsx +++ b/packages/app/src/systems/Transaction/pages/TxApprove/TxApprove.stories.tsx @@ -21,12 +21,13 @@ export default { const Template: StoryFn = (_args, { loaded }) => { const txRequest = useTransactionRequest(); - const { transactionRequest, network, address } = loaded || {}; + const { transactionRequest, network, account, address } = loaded || {}; // biome-ignore lint/correctness/useExhaustiveDependencies: useEffect(() => { txRequest.handlers.request({ address, + account, transactionRequest, providerUrl: network?.url, }); diff --git a/packages/app/src/systems/Transaction/services/transaction.tsx b/packages/app/src/systems/Transaction/services/transaction.tsx index 1ec72b9562..3a61eb8019 100644 --- a/packages/app/src/systems/Transaction/services/transaction.tsx +++ b/packages/app/src/systems/Transaction/services/transaction.tsx @@ -1,4 +1,4 @@ -import type { Account } from '@fuel-wallet/types'; +import type { Account, AccountWithBalance } from '@fuel-wallet/types'; import type { TransactionRequest, WalletLocked } from 'fuels'; import { clone } from 'ramda'; @@ -45,10 +45,11 @@ export type TxInputs = { request: { providerUrl: string; transactionRequest: TransactionRequest; - address?: string; - origin?: string; + address: string | undefined; + origin?: string | undefined; title?: string; favIconUrl?: string; + account: AccountWithBalance | undefined; skipCustomFee?: boolean; fees?: { baseFee?: BN; @@ -58,7 +59,7 @@ export type TxInputs = { }; }; send: { - address: string; + account?: Account; transactionRequest: TransactionRequest; providerUrl?: string; }; @@ -152,7 +153,8 @@ export class TxService { } static async send({ - address, + account, + // address: _address, transactionRequest, providerUrl = '', }: TxInputs['send']) { From 3a9b1b4739bce6ad017e528a20a4d4cb5341f734 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Thu, 23 Jan 2025 12:27:55 -0300 Subject: [PATCH 03/30] chore: changeset --- .changeset/young-laws-flash.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/young-laws-flash.md diff --git a/.changeset/young-laws-flash.md b/.changeset/young-laws-flash.md new file mode 100644 index 0000000000..1b534a45c0 --- /dev/null +++ b/.changeset/young-laws-flash.md @@ -0,0 +1,6 @@ +--- +"@fuel-wallet/connections": minor +"fuels-wallet": minor +--- + +Improve wallet transaction performance while calculating gas From 818e45747e66e8ba6bc48fc43bb9231f581f678e Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:01:08 -0300 Subject: [PATCH 04/30] improve: merge calculation of default tip and gas limit --- .../machines/transactionRequestMachine.tsx | 57 ++++--------------- .../src/systems/Send/machines/sendMachine.ts | 56 ++++-------------- .../Transaction/services/transaction.tsx | 18 ++---- 3 files changed, 26 insertions(+), 105 deletions(-) diff --git a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx index 974e74320d..8344f34f70 100644 --- a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx +++ b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx @@ -47,12 +47,9 @@ type MachineContext = { }; }; -type EstimateDefaultTipsReturn = { +type EstimateGasLimitAndDefaultTipsReturn = { regularTip: BN; fastTip: BN; -}; - -type EstimateGasLimitReturn = { maxGasLimit: BN; }; @@ -67,11 +64,8 @@ type MachineServices = { send: { data: TransactionSummary; }; - estimateDefaultTips: { - data: EstimateDefaultTipsReturn; - }; - estimateGasLimit: { - data: EstimateGasLimitReturn; + estimatingGasLimitAndDefaultTips: { + data: EstimateGasLimitAndDefaultTipsReturn; }; simulateTransaction: { data: SimulateTransactionReturn; @@ -108,36 +102,21 @@ export const transactionRequestMachine = createMachine( on: { START: { actions: ['assignTxRequestData'], - target: 'estimatingInitialTips', + target: 'estimatingGasLimitAndDefaultTips', }, }, }, - estimatingInitialTips: { + estimatingGasLimitAndDefaultTips: { tags: ['loading'], invoke: { - src: 'estimateDefaultTips', + src: 'estimatingGasLimitAndDefaultTips', onDone: [ { cond: FetchMachine.hasError, target: 'failed', }, { - actions: ['assignDefaultTips'], - target: 'estimatingGasLimit', - }, - ], - }, - }, - estimatingGasLimit: { - invoke: { - src: 'estimateGasLimit', - onDone: [ - { - cond: FetchMachine.hasError, - target: 'failed', - }, - { - actions: ['assignGasLimit'], + actions: ['assignGasLimitAndDefaultTips'], target: 'simulatingTransaction', }, ], @@ -246,16 +225,11 @@ export const transactionRequestMachine = createMachine( delays: { TIMEOUT: 1300 }, actions: { reset: assign(() => ({})), - assignDefaultTips: assign((ctx, ev) => ({ + assignGasLimitAndDefaultTips: assign((ctx, ev) => ({ fees: { ...ctx.fees, regularTip: ev.data.regularTip, fastTip: ev.data.fastTip, - }, - })), - assignGasLimit: assign((ctx, ev) => ({ - fees: { - ...ctx.fees, maxGasLimit: ev.data.maxGasLimit, }, })), @@ -358,23 +332,14 @@ export const transactionRequestMachine = createMachine( }), }, services: { - estimateDefaultTips: FetchMachine.create< + estimatingGasLimitAndDefaultTips: FetchMachine.create< never, - EstimateDefaultTipsReturn + EstimateGasLimitAndDefaultTipsReturn >({ showError: false, maxAttempts: 1, async fetch() { - const defaultTips = await TxService.estimateDefaultTips(); - return defaultTips; - }, - }), - estimateGasLimit: FetchMachine.create({ - showError: false, - maxAttempts: 1, - async fetch() { - const gasLimit = await TxService.estimateGasLimit(); - return gasLimit; + return await TxService.estimateGasLimitAndDefaultTips(); }, }), simulateTransaction: FetchMachine.create< diff --git a/packages/app/src/systems/Send/machines/sendMachine.ts b/packages/app/src/systems/Send/machines/sendMachine.ts index 7da036b12b..2f5998e89c 100644 --- a/packages/app/src/systems/Send/machines/sendMachine.ts +++ b/packages/app/src/systems/Send/machines/sendMachine.ts @@ -28,12 +28,9 @@ export type MachineContext = { error?: string; }; -type EstimateDefaultTipsReturn = { +type EstimateGasLimitAndDefaultTipsReturn = { regularTip: BN; fastTip: BN; -}; - -type EstimateGasLimitReturn = { maxGasLimit: BN; }; @@ -49,11 +46,8 @@ type MachineServices = { createTransactionRequest: { data: CreateTransactionReturn; }; - estimateDefaultTips: { - data: EstimateDefaultTipsReturn; - }; - estimateGasLimit: { - data: EstimateGasLimitReturn; + estimatingGasLimitAndDefaultTips: { + data: EstimateGasLimitAndDefaultTipsReturn; }; }; @@ -82,27 +76,11 @@ export const sendMachine = createMachine( services: {} as MachineServices, }, id: '(machine)', - initial: 'estimatingInitialTips', + initial: 'estimatingGasLimitAndDefaultTips', states: { - estimatingInitialTips: { - invoke: { - src: 'estimateDefaultTips', - onDone: [ - { - cond: FetchMachine.hasError, - target: 'idle', - actions: [assignError()], - }, - { - actions: ['assignDefaultTips'], - target: 'estimatingGasLimit', - }, - ], - }, - }, - estimatingGasLimit: { + estimatingGasLimitAndDefaultTips: { invoke: { - src: 'estimateGasLimit', + src: 'estimatingGasLimitAndDefaultTips', onDone: [ { cond: FetchMachine.hasError, @@ -110,7 +88,7 @@ export const sendMachine = createMachine( actions: [assignError()], }, { - actions: ['assignGasLimit'], + actions: ['assignGasLimitAndDefaultTips'], target: 'idle', }, ], @@ -165,12 +143,9 @@ export const sendMachine = createMachine( }, { actions: { - assignDefaultTips: assign((_ctx, ev) => ({ + assignGasLimitAndDefaultTips: assign((_ctx, ev) => ({ regularTip: ev.data.regularTip, fastTip: ev.data.fastTip, - error: undefined, - })), - assignGasLimit: assign((_ctx, ev) => ({ maxGasLimit: ev.data.maxGasLimit, error: undefined, })), @@ -187,23 +162,14 @@ export const sendMachine = createMachine( })), }, services: { - estimateDefaultTips: FetchMachine.create< + estimatingGasLimitAndDefaultTips: FetchMachine.create< never, - EstimateDefaultTipsReturn + EstimateGasLimitAndDefaultTipsReturn >({ showError: false, maxAttempts: 1, async fetch() { - const defaultTips = await TxService.estimateDefaultTips(); - return defaultTips; - }, - }), - estimateGasLimit: FetchMachine.create({ - showError: false, - maxAttempts: 1, - async fetch() { - const gasLimit = await TxService.estimateGasLimit(); - return gasLimit; + return await TxService.estimateGasLimitAndDefaultTips(); }, }), createTransactionRequest: FetchMachine.create< diff --git a/packages/app/src/systems/Transaction/services/transaction.tsx b/packages/app/src/systems/Transaction/services/transaction.tsx index 3a61eb8019..01b48044a6 100644 --- a/packages/app/src/systems/Transaction/services/transaction.tsx +++ b/packages/app/src/systems/Transaction/services/transaction.tsx @@ -1,5 +1,5 @@ import type { Account, AccountWithBalance } from '@fuel-wallet/types'; -import type { TransactionRequest, WalletLocked } from 'fuels'; +import type { Provider, TransactionRequest, WalletLocked } from 'fuels'; import { clone } from 'ramda'; import { @@ -376,24 +376,14 @@ export class TxService { }; } - static async estimateDefaultTips() { + static async estimateGasLimitAndDefaultTips() { const currentNetwork = await NetworkService.getSelectedNetwork(); const provider = await createProvider(currentNetwork?.url || ''); - - const { regularTip, fastTip } = await getCurrentTips(provider); - + const [{ regularTip, fastTip }, { consensusParameters }] = + await Promise.all([await getCurrentTips(provider), provider.getChain()]); return { regularTip: bn(regularTip), fastTip: bn(fastTip), - }; - } - - static async estimateGasLimit() { - const currentNetwork = await NetworkService.getSelectedNetwork(); - const provider = await createProvider(currentNetwork?.url || ''); - const consensusParameters = provider.getChain().consensusParameters; - - return { maxGasLimit: consensusParameters.txParameters.maxGasPerTx, }; } From b9693d50419a55482100e82e3768f270cf6c93bd Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:53:26 -0300 Subject: [PATCH 05/30] fix: remove await inside promise.all --- packages/app/src/systems/Transaction/services/transaction.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/systems/Transaction/services/transaction.tsx b/packages/app/src/systems/Transaction/services/transaction.tsx index 01b48044a6..51fedc3b94 100644 --- a/packages/app/src/systems/Transaction/services/transaction.tsx +++ b/packages/app/src/systems/Transaction/services/transaction.tsx @@ -380,7 +380,7 @@ export class TxService { const currentNetwork = await NetworkService.getSelectedNetwork(); const provider = await createProvider(currentNetwork?.url || ''); const [{ regularTip, fastTip }, { consensusParameters }] = - await Promise.all([await getCurrentTips(provider), provider.getChain()]); + await Promise.all([getCurrentTips(provider), provider.getChain()]); return { regularTip: bn(regularTip), fastTip: bn(fastTip), From 399207625386b948ef30117ee71285f0a2dc9543 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:53:44 -0300 Subject: [PATCH 06/30] fix: exception on undefined provider (edge case) --- packages/app/src/systems/Transaction/utils/fee.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/app/src/systems/Transaction/utils/fee.ts b/packages/app/src/systems/Transaction/utils/fee.ts index fd66015cf5..8759b123d4 100644 --- a/packages/app/src/systems/Transaction/utils/fee.ts +++ b/packages/app/src/systems/Transaction/utils/fee.ts @@ -28,8 +28,9 @@ export async function calculateTotalFee({ export async function getCurrentTips(provider: Provider) { const DEFAULT_REGULAR_TIP = 0; const DEFAULT_FAST_TIP = 1000; - const blockWithTransactions = - await provider.getBlockWithTransactions('latest'); + const blockWithTransactions = await provider + ?.getBlockWithTransactions('latest') + .catch(() => null); if (!blockWithTransactions) { return { regularTip: DEFAULT_REGULAR_TIP, From bc69766874ce176601cddb768fd0ffee01717150 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:14:39 -0300 Subject: [PATCH 07/30] feat: decrease unnecessarily long delay in tx and send machines --- .../src/systems/DApp/machines/transactionRequestMachine.tsx | 3 +-- packages/app/src/systems/Send/machines/sendMachine.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx index 8344f34f70..73100840f5 100644 --- a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx +++ b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx @@ -147,7 +147,7 @@ export const transactionRequestMachine = createMachine( }, }, after: { - 1000: { + 200: { target: 'simulatingTransaction', }, }, @@ -222,7 +222,6 @@ export const transactionRequestMachine = createMachine( }, }, { - delays: { TIMEOUT: 1300 }, actions: { reset: assign(() => ({})), assignGasLimitAndDefaultTips: assign((ctx, ev) => ({ diff --git a/packages/app/src/systems/Send/machines/sendMachine.ts b/packages/app/src/systems/Send/machines/sendMachine.ts index 2f5998e89c..bac777ca4f 100644 --- a/packages/app/src/systems/Send/machines/sendMachine.ts +++ b/packages/app/src/systems/Send/machines/sendMachine.ts @@ -122,7 +122,7 @@ export const sendMachine = createMachine( }, }, after: { - 1000: { + 200: { target: 'creatingTx', }, }, From 010adaf0e0151fbdc6a9b53de62830009d575580 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:22:32 -0300 Subject: [PATCH 08/30] chore: changeset --- .changeset/lemon-maps-rest.md | 6 ++++++ .changeset/lovely-kings-explode.md | 6 ++++++ .changeset/pretty-llamas-perform.md | 6 ++++++ .changeset/slow-bulldogs-call.md | 6 ++++++ .changeset/wise-items-float.md | 6 ++++++ 5 files changed, 30 insertions(+) create mode 100644 .changeset/lemon-maps-rest.md create mode 100644 .changeset/lovely-kings-explode.md create mode 100644 .changeset/pretty-llamas-perform.md create mode 100644 .changeset/slow-bulldogs-call.md create mode 100644 .changeset/wise-items-float.md diff --git a/.changeset/lemon-maps-rest.md b/.changeset/lemon-maps-rest.md new file mode 100644 index 0000000000..158b72676b --- /dev/null +++ b/.changeset/lemon-maps-rest.md @@ -0,0 +1,6 @@ +--- +"@fuel-wallet/connections": patch +"fuels-wallet": patch +--- + +Sped up gas calculation in SendMachine and TxRequestMachine by merging calculations of default tip and gas limit into a single parallelized promise. diff --git a/.changeset/lovely-kings-explode.md b/.changeset/lovely-kings-explode.md new file mode 100644 index 0000000000..7769c760bb --- /dev/null +++ b/.changeset/lovely-kings-explode.md @@ -0,0 +1,6 @@ +--- +"@fuel-wallet/connections": patch +"fuels-wallet": patch +--- + +Decrease unnecessarily long delay in tx and send machines while waiting for a possible new user input diff --git a/.changeset/pretty-llamas-perform.md b/.changeset/pretty-llamas-perform.md new file mode 100644 index 0000000000..f0ac23c8c3 --- /dev/null +++ b/.changeset/pretty-llamas-perform.md @@ -0,0 +1,6 @@ +--- +"@fuel-wallet/connections": patch +"fuels-wallet": patch +--- + +Sped up account balance calculation by making requests in parallel diff --git a/.changeset/slow-bulldogs-call.md b/.changeset/slow-bulldogs-call.md new file mode 100644 index 0000000000..24f4d0d196 --- /dev/null +++ b/.changeset/slow-bulldogs-call.md @@ -0,0 +1,6 @@ +--- +"@fuel-wallet/connections": minor +"fuels-wallet": minor +--- + +Centralized provider logic, avoid creating provider for the same network url diff --git a/.changeset/wise-items-float.md b/.changeset/wise-items-float.md new file mode 100644 index 0000000000..511da50f2b --- /dev/null +++ b/.changeset/wise-items-float.md @@ -0,0 +1,6 @@ +--- +"@fuel-wallet/connections": patch +"fuels-wallet": patch +--- + +Sped up gas calculation in SendMachine and TxRequestMachine by using already present information on account/balance from AccountMachine instead of re-fetching From a32ac8f51bc2112ce7608f8452fd63063d5a012e Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:32:00 -0300 Subject: [PATCH 09/30] fix: e2e tests --- packages/app/playwright/crx/assets.test.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/app/playwright/crx/assets.test.ts b/packages/app/playwright/crx/assets.test.ts index 813bd8d9f3..46f6d783f3 100644 --- a/packages/app/playwright/crx/assets.test.ts +++ b/packages/app/playwright/crx/assets.test.ts @@ -41,9 +41,14 @@ test.describe('Check assets', () => { }); test('should show valid asset value 0.002000', async () => { - expect( - await page.getByText('0.002000', { exact: true }).isVisible() - ).toBeTruthy(); + await expect + .poll( + async () => { + return await page.getByText('0.002000', { exact: true }).isVisible(); + }, + { timeout: 10000 } + ) + .toBeTruthy(); }); test('should show USDCIcon AlertTriangle', async () => { From 4eb532c72f22f1610ba5856f99f349ecebf95aa6 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:00:46 -0300 Subject: [PATCH 10/30] feat: improve tests by remove unecessary timeouts --- .../playwright/e2e/SendTransaction.test.ts | 58 +++++++++++-------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/packages/app/playwright/e2e/SendTransaction.test.ts b/packages/app/playwright/e2e/SendTransaction.test.ts index 464d1e34ea..dbd98a64d6 100644 --- a/packages/app/playwright/e2e/SendTransaction.test.ts +++ b/packages/app/playwright/e2e/SendTransaction.test.ts @@ -59,8 +59,6 @@ test.describe('SendTransaction', () => { const btnLocator = getButtonByText(page, 'Review'); - await expectButtonToBeEnabled(btnLocator); - await page.waitForTimeout(5000); await expectButtonToBeEnabled(btnLocator); await btnLocator.click(); @@ -95,10 +93,9 @@ test.describe('SendTransaction', () => { // make sure the button is enabled const btnLocator = getButtonByText(page, 'Review'); - await expectButtonToBeEnabled(btnLocator); - await page.waitForTimeout(5000); await expectButtonToBeEnabled(btnLocator); await btnLocator.click(); + await page.pause(); // Approve transaction await hasText(page, '0.001 ETH'); @@ -140,8 +137,6 @@ test.describe('SendTransaction', () => { const btnLocator = getButtonByText(page, 'Review'); - await expectButtonToBeEnabled(btnLocator); - await page.waitForTimeout(5000); await expectButtonToBeEnabled(btnLocator); await btnLocator.click(); @@ -173,12 +168,9 @@ test.describe('SendTransaction', () => { // Waiting button change to Review in order to ensure that fee amount is updated await page.waitForSelector('button:has-text("Review")'); - await page.waitForTimeout(1000); const btnLocator = getButtonByText(page, 'Review'); - await expectButtonToBeEnabled(btnLocator); - await page.waitForTimeout(5000); await expectButtonToBeEnabled(btnLocator); await btnLocator.click(); @@ -215,12 +207,9 @@ test.describe('SendTransaction', () => { // Waiting button change to Review in order to change fee amount await page.waitForSelector('button:has-text("Review")'); - await page.waitForTimeout(1000); const btnLocator = getButtonByText(page, 'Review'); - await expectButtonToBeEnabled(btnLocator); - await page.waitForTimeout(5000); await expectButtonToBeEnabled(btnLocator); await btnLocator.click(); @@ -253,27 +242,38 @@ test.describe('SendTransaction', () => { // Waiting button change to Review in order to ensure that fee amount is updated await page.waitForSelector('button:has-text("Review")'); - await page.waitForTimeout(1000); // Selecting and extracting regular fee amount + await expect + .poll( + async () => { + return await getByAriaLabel(page, 'fee value:Regular').isVisible(); + }, + { timeout: 10000 } + ) + .toBeTruthy(); const regularFeeComponent = getByAriaLabel(page, 'fee value:Regular'); await regularFeeComponent.click(); // Waiting button change to Review in order to ensure that fee amount is updated await page.waitForSelector('button:has-text("Review")'); - await page.waitForTimeout(1000); const btnLocatorBeforeApprv = getButtonByText(page, 'Review'); - await expectButtonToBeEnabled(btnLocatorBeforeApprv); - await page.waitForTimeout(5000); await expectButtonToBeEnabled(btnLocatorBeforeApprv); await btnLocatorBeforeApprv.click(); // Waiting button change to Approve in order to get updated fee amount await page.waitForSelector('button:has-text("Submit")'); - await page.waitForTimeout(1000); + await expect + .poll( + async () => { + return await getButtonByText(page, 'Back').isVisible(); + }, + { timeout: 10000 } + ) + .toBeTruthy(); // Going back to select other fee value await getButtonByText(page, 'Back').click(); @@ -283,27 +283,37 @@ test.describe('SendTransaction', () => { // Waiting button change to Review in order to change fee amount await page.waitForSelector('button:has-text("Review")'); - await page.waitForTimeout(1000); const btnLocator = getButtonByText(page, 'Review'); - await expectButtonToBeEnabled(btnLocator); - await page.waitForTimeout(5000); await expectButtonToBeEnabled(btnLocator); await btnLocator.click(); // Waiting button change to Approve in order to get updated fee amount await page.waitForSelector('button:has-text("Submit")'); - await page.waitForTimeout(1000); await hasText(page, '0.001 ETH'); - await page.waitForTimeout(1000); + await expect + .poll( + async () => { + return await getButtonByText(page, 'Submit').isEnabled(); + }, + { timeout: 10000 } + ) + .toBeTruthy(); await getButtonByText(page, 'Submit').click(); await hasText(page, '0.001 ETH'); // Wait for transaction to be confirmed - await hasText(page, 'success'); + await expect + .poll( + async () => { + return await hasText(page, 'success'); + }, + { timeout: 10000 } + ) + .toBeTruthy(); }); test('Send max amount transaction', async () => { @@ -343,8 +353,6 @@ test.describe('SendTransaction', () => { const btnLocator = getButtonByText(page, 'Review'); - await expectButtonToBeEnabled(btnLocator); - await page.waitForTimeout(5000); await expectButtonToBeEnabled(btnLocator); await btnLocator.click(); From 1f6941994db1cda64aa2f2cebad803fb6d97b731 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:01:02 -0300 Subject: [PATCH 11/30] fix: send machine not being able to read the account variable --- .../app/src/systems/Send/hooks/useSend.tsx | 86 +++++++++++-------- .../src/playwright-utils/button.ts | 4 +- 2 files changed, 52 insertions(+), 38 deletions(-) diff --git a/packages/app/src/systems/Send/hooks/useSend.tsx b/packages/app/src/systems/Send/hooks/useSend.tsx index f9ebec788f..bb0d5ce036 100644 --- a/packages/app/src/systems/Send/hooks/useSend.tsx +++ b/packages/app/src/systems/Send/hooks/useSend.tsx @@ -6,7 +6,7 @@ import { useCallback, useEffect, useMemo } from 'react'; import { useForm, useWatch } from 'react-hook-form'; import { useNavigate } from 'react-router-dom'; import * as yup from 'yup'; -import { useAccounts } from '~/systems/Account'; +import type { AccountsMachineState } from '~/systems/Account'; import { Pages } from '~/systems/Core'; import { useTransactionRequest } from '~/systems/DApp'; import { TxRequestStatus } from '~/systems/DApp/machines/transactionRequestMachine'; @@ -18,7 +18,7 @@ import { AssetsCache } from '~/systems/Asset/cache/AssetsCache'; import { useProvider } from '~/systems/Network/hooks/useProvider'; import { formatGasLimit } from '~/systems/Transaction'; import { sendMachine } from '../machines/sendMachine'; -import type { SendMachineState } from '../machines/sendMachine'; +import type { MachineContext, SendMachineState } from '../machines/sendMachine'; export enum SendStatus { loading = 'loading', @@ -45,6 +45,9 @@ const selectors = { readyToSend(state: SendMachineState) { return state.matches('readyToSend'); }, + account(state: AccountsMachineState) { + return state.context.account; + }, error(state: SendMachineState) { if (state.context.error?.includes('Gas limit')) { return ''; @@ -277,47 +280,56 @@ export function useSend() { const txRequest = useTransactionRequest(); const provider = useProvider(); - const account = store.useSelector( - Services.accounts, - (state) => state.context.account + const account = store.useSelector(Services.accounts, selectors.account); + + // Needed so we don't overload machine with a new obj account each render. This lead to the machine not using an updated reference of the account object. + const callTransactionRequest = useCallback( + (ctx: MachineContext) => { + const { + providerUrl, + transactionRequest, + address, + baseFee, + regularTip, + fastTip, + maxGasLimit, + } = ctx; + if (!providerUrl || !transactionRequest || !address) { + throw new Error('Params are required'); + } + + txRequest.handlers.request({ + providerUrl, + transactionRequest, + account, + address, + fees: { + baseFee, + regularTip, + fastTip, + maxGasLimit, + }, + skipCustomFee: true, + }); + }, + [account, txRequest.handlers.request] ); - const service = useInterpret(() => - sendMachine.withConfig({ + const sendMachineOpts = useMemo( + () => ({ actions: { goToHome() { navigate(Pages.index()); }, - callTransactionRequest(ctx) { - const { - providerUrl, - transactionRequest, - address, - baseFee, - regularTip, - fastTip, - maxGasLimit, - } = ctx; - if (!providerUrl || !transactionRequest || !address) { - throw new Error('Params are required'); - } - - txRequest.handlers.request({ - providerUrl, - transactionRequest, - account, - address, - fees: { - baseFee, - regularTip, - fastTip, - maxGasLimit, - }, - skipCustomFee: true, - }); - }, + callTransactionRequest, }, - }) + }), + [callTransactionRequest, navigate] + ); + + const service = useInterpret( + () => sendMachine.withContext({ account }), + sendMachineOpts ); const baseFee = useSelector(service, selectors.baseFee); @@ -355,7 +367,7 @@ export function useSend() { const fastTip = useSelector(service, selectors.fastTip); const sendStatusSelector = selectors.status(txRequest.txStatus); const sendStatus = useSelector(service, sendStatusSelector); - const readyToSend = useSelector(service, selectors.readyToSend); + const readyToSend = useSelector(service, selectors.readyToSend) && !!account; const input = useSelector(service, selectors.input); const balanceAssetSelected = useMemo(() => { diff --git a/packages/playwright-utils/src/playwright-utils/button.ts b/packages/playwright-utils/src/playwright-utils/button.ts index 80439d22bf..7f4d0dc174 100644 --- a/packages/playwright-utils/src/playwright-utils/button.ts +++ b/packages/playwright-utils/src/playwright-utils/button.ts @@ -21,7 +21,9 @@ export function expectButtonToBeEnabled( return expect .poll(async () => await button.isEnabled(), { timeout: timeout ?? 7000, - intervals: intervals ?? [1000, 2000, 3000, 4000, 5000, 6000, 7000], + intervals: intervals ?? [ + 0, 500, 1000, 2000, 3000, 4000, 5000, 6000, 7000, + ], message: message ?? 'Button is not enabled', }) .toBeTruthy(); From 7a6ca5d5b61e48bab8bcf8a4f5126436f5ab0c5e Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:04:45 -0300 Subject: [PATCH 12/30] chore: revert to withConfig --- packages/app/src/systems/Send/hooks/useSend.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/systems/Send/hooks/useSend.tsx b/packages/app/src/systems/Send/hooks/useSend.tsx index bb0d5ce036..6ba0e0d3b7 100644 --- a/packages/app/src/systems/Send/hooks/useSend.tsx +++ b/packages/app/src/systems/Send/hooks/useSend.tsx @@ -328,7 +328,7 @@ export function useSend() { ); const service = useInterpret( - () => sendMachine.withContext({ account }), + () => sendMachine.withConfig(sendMachineOpts), sendMachineOpts ); From 913f03997969ae7922ef8750b8a4c08dde5694ec Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:04:51 -0300 Subject: [PATCH 13/30] chore: remove pause --- packages/app/playwright/e2e/SendTransaction.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/app/playwright/e2e/SendTransaction.test.ts b/packages/app/playwright/e2e/SendTransaction.test.ts index dbd98a64d6..6351411651 100644 --- a/packages/app/playwright/e2e/SendTransaction.test.ts +++ b/packages/app/playwright/e2e/SendTransaction.test.ts @@ -95,7 +95,6 @@ test.describe('SendTransaction', () => { await expectButtonToBeEnabled(btnLocator); await btnLocator.click(); - await page.pause(); // Approve transaction await hasText(page, '0.001 ETH'); From dcfcd2bc5c23d73baef3f006364ad92d5e5bb1f4 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:10:48 -0300 Subject: [PATCH 14/30] chore --- packages/app/src/systems/Send/hooks/useSend.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/app/src/systems/Send/hooks/useSend.tsx b/packages/app/src/systems/Send/hooks/useSend.tsx index 6ba0e0d3b7..0abace28db 100644 --- a/packages/app/src/systems/Send/hooks/useSend.tsx +++ b/packages/app/src/systems/Send/hooks/useSend.tsx @@ -282,7 +282,6 @@ export function useSend() { const account = store.useSelector(Services.accounts, selectors.account); - // Needed so we don't overload machine with a new obj account each render. This lead to the machine not using an updated reference of the account object. const callTransactionRequest = useCallback( (ctx: MachineContext) => { const { @@ -328,7 +327,8 @@ export function useSend() { ); const service = useInterpret( - () => sendMachine.withConfig(sendMachineOpts), + // biome-ignore lint/suspicious/noExplicitAny: Even though account doesn't exist in the machine context, we need to pass it so the machine understands that it must update its references when account changes. + () => sendMachine.withContext({ account } as any), sendMachineOpts ); From 75fe623149fd1c74802fa9913815f7352ed1573f Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:26:58 -0300 Subject: [PATCH 15/30] fix: not getting an updated reference for acc --- .../app/src/systems/Send/hooks/useSend.tsx | 78 +++++++++---------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/packages/app/src/systems/Send/hooks/useSend.tsx b/packages/app/src/systems/Send/hooks/useSend.tsx index 0abace28db..7760d40bad 100644 --- a/packages/app/src/systems/Send/hooks/useSend.tsx +++ b/packages/app/src/systems/Send/hooks/useSend.tsx @@ -2,7 +2,7 @@ import { yupResolver } from '@hookform/resolvers/yup'; import { useInterpret, useSelector } from '@xstate/react'; import type { BN, BNInput } from 'fuels'; import { Address, type Provider, bn, isB256 } from 'fuels'; -import { useCallback, useEffect, useMemo } from 'react'; +import { useCallback, useEffect, useMemo, useRef } from 'react'; import { useForm, useWatch } from 'react-hook-form'; import { useNavigate } from 'react-router-dom'; import * as yup from 'yup'; @@ -281,55 +281,50 @@ export function useSend() { const provider = useProvider(); const account = store.useSelector(Services.accounts, selectors.account); + const callTransactionRequest = useRef<(ctx: MachineContext) => void>(); - const callTransactionRequest = useCallback( - (ctx: MachineContext) => { - const { - providerUrl, - transactionRequest, - address, + callTransactionRequest.current = (ctx: MachineContext) => { + const { + providerUrl, + transactionRequest, + address, + baseFee, + regularTip, + fastTip, + maxGasLimit, + } = ctx; + if (!providerUrl || !transactionRequest || !address) { + throw new Error('Params are required'); + } + + console.log('fsk here account', !!account); + txRequest.handlers.request({ + providerUrl, + transactionRequest, + account, + address, + fees: { baseFee, regularTip, fastTip, maxGasLimit, - } = ctx; - if (!providerUrl || !transactionRequest || !address) { - throw new Error('Params are required'); - } - - txRequest.handlers.request({ - providerUrl, - transactionRequest, - account, - address, - fees: { - baseFee, - regularTip, - fastTip, - maxGasLimit, - }, - skipCustomFee: true, - }); - }, - [account, txRequest.handlers.request] - ); + }, + skipCustomFee: true, + }); + }; - const sendMachineOpts = useMemo( - () => ({ + console.log('fsk here account is an obj', !!account); + const service = useInterpret(() => + sendMachine.withConfig({ actions: { goToHome() { navigate(Pages.index()); }, - callTransactionRequest, + callTransactionRequest(ctx) { + callTransactionRequest.current?.(ctx); + }, }, - }), - [callTransactionRequest, navigate] - ); - - const service = useInterpret( - // biome-ignore lint/suspicious/noExplicitAny: Even though account doesn't exist in the machine context, we need to pass it so the machine understands that it must update its references when account changes. - () => sendMachine.withContext({ account } as any), - sendMachineOpts + }) ); const baseFee = useSelector(service, selectors.baseFee); @@ -367,7 +362,10 @@ export function useSend() { const fastTip = useSelector(service, selectors.fastTip); const sendStatusSelector = selectors.status(txRequest.txStatus); const sendStatus = useSelector(service, sendStatusSelector); - const readyToSend = useSelector(service, selectors.readyToSend) && !!account; + const readyToSend = + useSelector(service, selectors.readyToSend) && + !!account && + !!callTransactionRequest.current; const input = useSelector(service, selectors.input); const balanceAssetSelected = useMemo(() => { From af2c5a9863600dd46f8d1dd61a25999419e72ec6 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Fri, 24 Jan 2025 19:25:47 -0300 Subject: [PATCH 16/30] chore --- packages/app/src/systems/Send/hooks/useSend.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/app/src/systems/Send/hooks/useSend.tsx b/packages/app/src/systems/Send/hooks/useSend.tsx index 7760d40bad..6a707914ed 100644 --- a/packages/app/src/systems/Send/hooks/useSend.tsx +++ b/packages/app/src/systems/Send/hooks/useSend.tsx @@ -297,7 +297,6 @@ export function useSend() { throw new Error('Params are required'); } - console.log('fsk here account', !!account); txRequest.handlers.request({ providerUrl, transactionRequest, @@ -313,7 +312,6 @@ export function useSend() { }); }; - console.log('fsk here account is an obj', !!account); const service = useInterpret(() => sendMachine.withConfig({ actions: { From cd02b0d6d5dd06b3db4da17b7e8c84d498597056 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Fri, 24 Jan 2025 19:26:01 -0300 Subject: [PATCH 17/30] feat: use already available fee data when possible --- .../machines/transactionRequestMachine.tsx | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx index 73100840f5..1a4be6daae 100644 --- a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx +++ b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx @@ -100,10 +100,20 @@ export const transactionRequestMachine = createMachine( states: { idle: { on: { - START: { - actions: ['assignTxRequestData'], - target: 'estimatingGasLimitAndDefaultTips', - }, + START: [ + { + cond: (_ctx, event) => + event.input?.fees?.maxGasLimit !== undefined && + event.input?.fees?.fastTip !== undefined && + event.input?.fees?.regularTip !== undefined, + actions: ['assignTxRequestData'], + target: 'simulatingTransaction', + }, + { + actions: ['assignTxRequestData'], + target: 'estimatingGasLimitAndDefaultTips', + }, + ], }, }, estimatingGasLimitAndDefaultTips: { @@ -242,6 +252,7 @@ export const transactionRequestMachine = createMachine( favIconUrl, skipCustomFee, account, + fees, } = ev.input || {}; if (!providerUrl) { @@ -268,6 +279,7 @@ export const transactionRequestMachine = createMachine( title, favIconUrl, skipCustomFee, + fees, }; }, fees: (_ctx, ev) => { From 51acf68d2d7f0ed1898f534fe4a0639a20272d41 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Mon, 27 Jan 2025 19:27:28 -0300 Subject: [PATCH 18/30] chore --- .../src/systems/DApp/machines/transactionRequestMachine.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx index 1a4be6daae..bb7b413ff0 100644 --- a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx +++ b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx @@ -103,9 +103,9 @@ export const transactionRequestMachine = createMachine( START: [ { cond: (_ctx, event) => - event.input?.fees?.maxGasLimit !== undefined && - event.input?.fees?.fastTip !== undefined && - event.input?.fees?.regularTip !== undefined, + event.input?.fees?.maxGasLimit != null && + event.input?.fees?.fastTip != null && + event.input?.fees?.regularTip != null, actions: ['assignTxRequestData'], target: 'simulatingTransaction', }, From 6803acad1dffba536ef4ff6d5fc068b9a1b2bd8d Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Mon, 27 Jan 2025 19:28:09 -0300 Subject: [PATCH 19/30] revert: changeinput timeout --- .../app/src/systems/DApp/machines/transactionRequestMachine.tsx | 2 +- packages/app/src/systems/Send/machines/sendMachine.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx index bb7b413ff0..e767dd6be4 100644 --- a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx +++ b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx @@ -157,7 +157,7 @@ export const transactionRequestMachine = createMachine( }, }, after: { - 200: { + 1000: { target: 'simulatingTransaction', }, }, diff --git a/packages/app/src/systems/Send/machines/sendMachine.ts b/packages/app/src/systems/Send/machines/sendMachine.ts index bac777ca4f..2f5998e89c 100644 --- a/packages/app/src/systems/Send/machines/sendMachine.ts +++ b/packages/app/src/systems/Send/machines/sendMachine.ts @@ -122,7 +122,7 @@ export const sendMachine = createMachine( }, }, after: { - 200: { + 1000: { target: 'creatingTx', }, }, From 276aafb4dca764cb2ea3a6f1377a77b8bc31d623 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Mon, 27 Jan 2025 19:28:43 -0300 Subject: [PATCH 20/30] chore --- packages/app/src/systems/Send/machines/sendMachine.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/app/src/systems/Send/machines/sendMachine.ts b/packages/app/src/systems/Send/machines/sendMachine.ts index 2f5998e89c..1933444d03 100644 --- a/packages/app/src/systems/Send/machines/sendMachine.ts +++ b/packages/app/src/systems/Send/machines/sendMachine.ts @@ -169,7 +169,8 @@ export const sendMachine = createMachine( showError: false, maxAttempts: 1, async fetch() { - return await TxService.estimateGasLimitAndDefaultTips(); + const estimated = await TxService.estimateGasLimitAndDefaultTips(); + return estimated; }, }), createTransactionRequest: FetchMachine.create< From dce1c547c686b994370e56b9060a6fc7a01b5c7d Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Mon, 27 Jan 2025 19:29:39 -0300 Subject: [PATCH 21/30] chore --- .../src/systems/DApp/machines/transactionRequestMachine.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx index e767dd6be4..4a715b2c5e 100644 --- a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx +++ b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx @@ -350,7 +350,8 @@ export const transactionRequestMachine = createMachine( showError: false, maxAttempts: 1, async fetch() { - return await TxService.estimateGasLimitAndDefaultTips(); + const estimated = await TxService.estimateGasLimitAndDefaultTips(); + return estimated; }, }), simulateTransaction: FetchMachine.create< From d1e1a79bf5f0a43fd0ec72e348f936b721959cd9 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Mon, 27 Jan 2025 19:45:34 -0300 Subject: [PATCH 22/30] revert: useprovider changes --- packages/app/src/systems/Network/hooks/useProvider.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/app/src/systems/Network/hooks/useProvider.tsx b/packages/app/src/systems/Network/hooks/useProvider.tsx index f693bf42e1..8334941e34 100644 --- a/packages/app/src/systems/Network/hooks/useProvider.tsx +++ b/packages/app/src/systems/Network/hooks/useProvider.tsx @@ -5,7 +5,8 @@ import { useNetworks } from './useNetworks'; export function useProvider() { const { network } = useNetworks(); - const [provider, setProvider] = useState(undefined); + // When we pass a function to the useState, we guarantee that the function will be called only once. + const [provider, setProvider] = useState(); useEffect(() => { if (network?.url) { From b4e49911c4144285f4ad58f2c79361bb8e192fb7 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Mon, 27 Jan 2025 19:49:20 -0300 Subject: [PATCH 23/30] chore: fetch account data when not available --- .../machines/transactionRequestMachine.tsx | 59 +++++++++++++------ packages/app/src/systems/DApp/methods.ts | 21 +------ .../Transaction/services/transaction.tsx | 16 +++-- 3 files changed, 52 insertions(+), 44 deletions(-) diff --git a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx index 4a715b2c5e..0dec1c04b4 100644 --- a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx +++ b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx @@ -2,7 +2,9 @@ import type { Account, AccountWithBalance } from '@fuel-wallet/types'; import type { BN, TransactionRequest, TransactionSummary } from 'fuels'; import type { InterpreterFrom, StateFrom } from 'xstate'; import { assign, createMachine } from 'xstate'; +import { AccountService } from '~/systems/Account'; import { FetchMachine, assignErrorMessage, delay } from '~/systems/Core'; +import { NetworkService } from '~/systems/Network'; import type { GroupedErrors, VMApiError } from '~/systems/Transaction'; import type { TxInputs } from '~/systems/Transaction/services'; import { TxService } from '~/systems/Transaction/services'; @@ -25,6 +27,7 @@ type MachineContext = { isOriginRequired?: boolean; providerUrl?: string; transactionRequest?: TransactionRequest; + address?: string; account?: AccountWithBalance; tip?: BN; gasLimit?: BN; @@ -47,7 +50,7 @@ type MachineContext = { }; }; -type EstimateGasLimitAndDefaultTipsReturn = { +type PrepareInputForSimulateTransactionReturn = { regularTip: BN; fastTip: BN; maxGasLimit: BN; @@ -64,8 +67,8 @@ type MachineServices = { send: { data: TransactionSummary; }; - estimatingGasLimitAndDefaultTips: { - data: EstimateGasLimitAndDefaultTipsReturn; + prepareInputForSimulateTransaction: { + data: PrepareInputForSimulateTransactionReturn; }; simulateTransaction: { data: SimulateTransactionReturn; @@ -111,15 +114,21 @@ export const transactionRequestMachine = createMachine( }, { actions: ['assignTxRequestData'], - target: 'estimatingGasLimitAndDefaultTips', + target: 'prepareInputForSimulateTransaction', }, ], }, }, - estimatingGasLimitAndDefaultTips: { + prepareInputForSimulateTransaction: { tags: ['loading'], invoke: { - src: 'estimatingGasLimitAndDefaultTips', + src: 'prepareInputForSimulateTransaction', + data: { + input: (ctx: MachineContext) => ({ + address: ctx.input.address, + account: ctx.input.account, + }), + }, onDone: [ { cond: FetchMachine.hasError, @@ -252,17 +261,15 @@ export const transactionRequestMachine = createMachine( favIconUrl, skipCustomFee, account, + address, fees, } = ev.input || {}; if (!providerUrl) { throw new Error('providerUrl is required'); } - if (!account) { - throw new Error('account is required'); - } - if (!account.address) { - throw new Error('address is required'); + if (!account?.address && !address) { + throw new Error('account or address is required'); } if (!transactionRequest) { throw new Error('transaction is required'); @@ -275,6 +282,7 @@ export const transactionRequestMachine = createMachine( transactionRequest, origin, account, + address, providerUrl, title, favIconUrl, @@ -343,15 +351,30 @@ export const transactionRequestMachine = createMachine( }), }, services: { - estimatingGasLimitAndDefaultTips: FetchMachine.create< - never, - EstimateGasLimitAndDefaultTipsReturn + prepareInputForSimulateTransaction: FetchMachine.create< + { address?: string; account?: AccountWithBalance }, + { + estimated: PrepareInputForSimulateTransactionReturn; + account: AccountWithBalance; + } >({ showError: false, maxAttempts: 1, - async fetch() { - const estimated = await TxService.estimateGasLimitAndDefaultTips(); - return estimated; + async fetch({ input }) { + const [estimated, acc] = await Promise.all([ + TxService.estimateGasLimitAndDefaultTips(), + input?.account || + AccountService.fetchAccount({ + address: input?.address as string, + }).then(async (_account) => { + const network = await NetworkService.getSelectedNetwork(); + return await AccountService.fetchBalance({ + account: _account, + providerUrl: network?.url as string, + }); + }), + ]); + return { estimated, account: acc }; }, }), simulateTransaction: FetchMachine.create< @@ -377,7 +400,7 @@ export const transactionRequestMachine = createMachine( async fetch(params) { const { input } = params; if ( - !input?.account || + (!input?.account && !input?.address) || !input?.transactionRequest || !input?.providerUrl ) { diff --git a/packages/app/src/systems/DApp/methods.ts b/packages/app/src/systems/DApp/methods.ts index 51dd98926f..3cab2aa0c0 100644 --- a/packages/app/src/systems/DApp/methods.ts +++ b/packages/app/src/systems/DApp/methods.ts @@ -52,31 +52,12 @@ export class RequestMethods extends ExtensionPageConnection { const { origin, address, provider, transaction, title, favIconUrl } = input; const providerUrl = provider.url; const transactionRequest = transactionRequestify(JSON.parse(transaction)); - let currentAccountWithBalance = store.getStateFrom(Services.accounts) - .context.account; - if (!currentAccountWithBalance && address) { - const account = await AccountService.fetchAccount({ - address: input.address, - }); - currentAccountWithBalance = await AccountService.fetchBalance({ - account, - providerUrl, - }); - } - if ( - currentAccountWithBalance?.address !== address || - !currentAccountWithBalance - ) { - throw new Error( - `Origin: ${address} does not match current account: ${currentAccountWithBalance?.address}` - ); - } + const state = await store .requestTransaction({ origin, transactionRequest, address, - account: currentAccountWithBalance, providerUrl, title, favIconUrl, diff --git a/packages/app/src/systems/Transaction/services/transaction.tsx b/packages/app/src/systems/Transaction/services/transaction.tsx index 51fedc3b94..8bfd3b19ed 100644 --- a/packages/app/src/systems/Transaction/services/transaction.tsx +++ b/packages/app/src/systems/Transaction/services/transaction.tsx @@ -45,11 +45,11 @@ export type TxInputs = { request: { providerUrl: string; transactionRequest: TransactionRequest; - address: string | undefined; - origin?: string | undefined; + address?: string; + origin?: string; title?: string; favIconUrl?: string; - account: AccountWithBalance | undefined; + account?: AccountWithBalance; skipCustomFee?: boolean; fees?: { baseFee?: BN; @@ -59,6 +59,7 @@ export type TxInputs = { }; }; send: { + address?: string; account?: Account; transactionRequest: TransactionRequest; providerUrl?: string; @@ -154,12 +155,15 @@ export class TxService { static async send({ account, - // address: _address, + address, transactionRequest, providerUrl = '', }: TxInputs['send']) { const provider = await createProvider(providerUrl); - const wallet = new WalletLockedCustom(address, provider); + const wallet = new WalletLockedCustom( + (account?.address?.toString() || address) as string, + provider + ); const txSent = await wallet.sendTransaction(transactionRequest); return txSent; @@ -380,7 +384,7 @@ export class TxService { const currentNetwork = await NetworkService.getSelectedNetwork(); const provider = await createProvider(currentNetwork?.url || ''); const [{ regularTip, fastTip }, { consensusParameters }] = - await Promise.all([getCurrentTips(provider), provider.getChain()]); + await Promise.all([await getCurrentTips(provider), provider.getChain()]); return { regularTip: bn(regularTip), fastTip: bn(fastTip), From ce2710f3df8e6524648ee22f846443ae52501e28 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Mon, 27 Jan 2025 19:51:28 -0300 Subject: [PATCH 24/30] fix: changesets --- .changeset/lemon-maps-rest.md | 6 +++--- .changeset/lovely-kings-explode.md | 6 ------ .changeset/pretty-llamas-perform.md | 6 ------ .changeset/slow-bulldogs-call.md | 6 ------ .changeset/wise-items-float.md | 6 ------ .changeset/young-laws-flash.md | 6 ------ 6 files changed, 3 insertions(+), 33 deletions(-) delete mode 100644 .changeset/lovely-kings-explode.md delete mode 100644 .changeset/pretty-llamas-perform.md delete mode 100644 .changeset/slow-bulldogs-call.md delete mode 100644 .changeset/wise-items-float.md delete mode 100644 .changeset/young-laws-flash.md diff --git a/.changeset/lemon-maps-rest.md b/.changeset/lemon-maps-rest.md index 158b72676b..ae7e7aa865 100644 --- a/.changeset/lemon-maps-rest.md +++ b/.changeset/lemon-maps-rest.md @@ -1,6 +1,6 @@ --- -"@fuel-wallet/connections": patch -"fuels-wallet": patch +"@fuels/playwright-utils": minor +"fuels-wallet": minor --- -Sped up gas calculation in SendMachine and TxRequestMachine by merging calculations of default tip and gas limit into a single parallelized promise. +feat: performance improvement from rework on send transaction machine flows diff --git a/.changeset/lovely-kings-explode.md b/.changeset/lovely-kings-explode.md deleted file mode 100644 index 7769c760bb..0000000000 --- a/.changeset/lovely-kings-explode.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@fuel-wallet/connections": patch -"fuels-wallet": patch ---- - -Decrease unnecessarily long delay in tx and send machines while waiting for a possible new user input diff --git a/.changeset/pretty-llamas-perform.md b/.changeset/pretty-llamas-perform.md deleted file mode 100644 index f0ac23c8c3..0000000000 --- a/.changeset/pretty-llamas-perform.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@fuel-wallet/connections": patch -"fuels-wallet": patch ---- - -Sped up account balance calculation by making requests in parallel diff --git a/.changeset/slow-bulldogs-call.md b/.changeset/slow-bulldogs-call.md deleted file mode 100644 index 24f4d0d196..0000000000 --- a/.changeset/slow-bulldogs-call.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@fuel-wallet/connections": minor -"fuels-wallet": minor ---- - -Centralized provider logic, avoid creating provider for the same network url diff --git a/.changeset/wise-items-float.md b/.changeset/wise-items-float.md deleted file mode 100644 index 511da50f2b..0000000000 --- a/.changeset/wise-items-float.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@fuel-wallet/connections": patch -"fuels-wallet": patch ---- - -Sped up gas calculation in SendMachine and TxRequestMachine by using already present information on account/balance from AccountMachine instead of re-fetching diff --git a/.changeset/young-laws-flash.md b/.changeset/young-laws-flash.md deleted file mode 100644 index 1b534a45c0..0000000000 --- a/.changeset/young-laws-flash.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@fuel-wallet/connections": minor -"fuels-wallet": minor ---- - -Improve wallet transaction performance while calculating gas From 3cc18f733356736b26b2cbbb9dbb92f313e2cb6e Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Mon, 27 Jan 2025 20:21:46 -0300 Subject: [PATCH 25/30] ix: not saving account data in machine context --- .../machines/transactionRequestMachine.tsx | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx index 0dec1c04b4..01fcabf10e 100644 --- a/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx +++ b/packages/app/src/systems/DApp/machines/transactionRequestMachine.tsx @@ -51,9 +51,12 @@ type MachineContext = { }; type PrepareInputForSimulateTransactionReturn = { - regularTip: BN; - fastTip: BN; - maxGasLimit: BN; + estimated: { + regularTip: BN; + fastTip: BN; + maxGasLimit: BN; + }; + account: AccountWithBalance; }; type SimulateTransactionReturn = { @@ -135,7 +138,7 @@ export const transactionRequestMachine = createMachine( target: 'failed', }, { - actions: ['assignGasLimitAndDefaultTips'], + actions: ['assignPreflightData'], target: 'simulatingTransaction', }, ], @@ -243,12 +246,13 @@ export const transactionRequestMachine = createMachine( { actions: { reset: assign(() => ({})), - assignGasLimitAndDefaultTips: assign((ctx, ev) => ({ + assignPreflightData: assign((ctx, ev) => ({ + account: ev.data.account, fees: { ...ctx.fees, - regularTip: ev.data.regularTip, - fastTip: ev.data.fastTip, - maxGasLimit: ev.data.maxGasLimit, + regularTip: ev.data.estimated.regularTip, + fastTip: ev.data.estimated.fastTip, + maxGasLimit: ev.data.estimated.maxGasLimit, }, })), assignTxRequestData: assign({ @@ -354,7 +358,7 @@ export const transactionRequestMachine = createMachine( prepareInputForSimulateTransaction: FetchMachine.create< { address?: string; account?: AccountWithBalance }, { - estimated: PrepareInputForSimulateTransactionReturn; + estimated: PrepareInputForSimulateTransactionReturn['estimated']; account: AccountWithBalance; } >({ From 29c40b4a5e1dce2eaa59a3cb543110856c5686c7 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Mon, 27 Jan 2025 20:22:42 -0300 Subject: [PATCH 26/30] fix: getting old max ammount data --- packages/app/playwright/e2e/SendTransaction.test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/app/playwright/e2e/SendTransaction.test.ts b/packages/app/playwright/e2e/SendTransaction.test.ts index 6351411651..556b3bb0a8 100644 --- a/packages/app/playwright/e2e/SendTransaction.test.ts +++ b/packages/app/playwright/e2e/SendTransaction.test.ts @@ -346,13 +346,12 @@ test.describe('SendTransaction', () => { // Fee values change await new Promise((resolve) => setTimeout(resolve, 3000)); - const maxAmountAfterFee = await getInputByName(page, 'amount').inputValue(); - // Submit transaction const btnLocator = getButtonByText(page, 'Review'); await expectButtonToBeEnabled(btnLocator); + const maxAmountAfterFee = await getInputByName(page, 'amount').inputValue(); await btnLocator.click(); // Approve transaction From 40ac6700a0a1c6cc9ca7517761773a3ca1e47e23 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Mon, 27 Jan 2025 20:49:03 -0300 Subject: [PATCH 27/30] fix: strict audit --- examples/cra-dapp/package.json | 2 +- package.json | 3 +- packages/app/package.json | 2 +- pnpm-lock.yaml | 337 +++++++++++++++++++++++++++++---- 4 files changed, 302 insertions(+), 42 deletions(-) diff --git a/examples/cra-dapp/package.json b/examples/cra-dapp/package.json index adfaecf44b..6550e16cd4 100644 --- a/examples/cra-dapp/package.json +++ b/examples/cra-dapp/package.json @@ -20,6 +20,6 @@ "@types/react-dom": "18.3.0", "@vitejs/plugin-react": "4.2.1", "typescript": "5.2.2", - "vite": "6.0.3" + "vite": "6.0.8" } } diff --git a/package.json b/package.json index 8837d61a5c..64f89444c5 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,8 @@ "secp256k1@=5.0.0": ">=5.0.1", "elliptic@<6.6.0": ">=6.6.0", "cross-spawn@<7.0.5": ">=7.0.5", - "nanoid@<3.3.8": "3.3.8" + "nanoid@<3.3.8": "3.3.8", + "store2@<2.14.4": ">=2.14.4" } } } diff --git a/packages/app/package.json b/packages/app/package.json index b8e9e7af3f..fe43b516e8 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -102,7 +102,7 @@ "ts-jest-mock-import-meta": "1.1.0", "tsconfig-paths-webpack-plugin": "4.1.0", "typescript": "5.2.2", - "vite": "6.0.3", + "vite": "6.0.8", "vite-plugin-clean": "1.0.0", "vite-plugin-static-copy": "2.2.0", "vite-tsconfig-paths": "5.1.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8d6ef73dc5..568332b2a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,6 +35,7 @@ overrides: elliptic@<6.6.0: '>=6.6.0' cross-spawn@<7.0.5: '>=7.0.5' nanoid@<3.3.8: 3.3.8 + store2@<2.14.4: '>=2.14.4' importers: @@ -161,13 +162,13 @@ importers: version: 18.3.0 '@vitejs/plugin-react': specifier: 4.2.1 - version: 4.2.1(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) + version: 4.2.1(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) typescript: specifier: 5.2.2 version: 5.2.2 vite: - specifier: 6.0.3 - version: 6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) + specifier: 6.0.8 + version: 6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) packages/app: dependencies: @@ -281,7 +282,7 @@ importers: version: 1.0.0 vite-plugin-markdown: specifier: 2.2.0 - version: 2.2.0(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) + version: 2.2.0(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) xstate: specifier: 4.38.2 version: 4.38.2 @@ -342,7 +343,7 @@ importers: version: 7.4.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.2.2) '@storybook/react-vite': specifier: 7.4.6 - version: 7.4.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.2.2)(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) + version: 7.4.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.2.2)(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) '@storybook/react-webpack5': specifier: 7.4.6 version: 7.4.6(@babel/core@7.24.0)(@swc/core@1.3.92(@swc/helpers@0.5.11))(@swc/helpers@0.5.11)(@types/react-dom@18.3.0)(@types/react@18.3.3)(esbuild@0.18.20)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(type-fest@2.19.0)(typescript@5.2.2)(webpack-hot-middleware@2.25.4) @@ -378,7 +379,7 @@ importers: version: 6.1.7 '@vitejs/plugin-react': specifier: 4.1.0 - version: 4.1.0(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) + version: 4.1.0(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) '@xstate/inspect': specifier: 0.8.0 version: 0.8.0(@types/ws@8.5.12)(ws@8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(xstate@4.38.2) @@ -410,17 +411,17 @@ importers: specifier: 5.2.2 version: 5.2.2 vite: - specifier: 6.0.3 - version: 6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) + specifier: 6.0.8 + version: 6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) vite-plugin-clean: specifier: 1.0.0 version: 1.0.0 vite-plugin-static-copy: specifier: 2.2.0 - version: 2.2.0(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) + version: 2.2.0(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) vite-tsconfig-paths: specifier: 5.1.4 - version: 5.1.4(typescript@5.2.2)(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) + version: 5.1.4(typescript@5.2.2)(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) whatwg-fetch: specifier: 3.6.20 version: 3.6.20 @@ -2165,6 +2166,12 @@ packages: cpu: [ppc64] os: [aix] + '@esbuild/aix-ppc64@0.24.2': + resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + '@esbuild/android-arm64@0.18.20': resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} @@ -2177,6 +2184,12 @@ packages: cpu: [arm64] os: [android] + '@esbuild/android-arm64@0.24.2': + resolution: {integrity: sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm@0.18.20': resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} engines: {node: '>=12'} @@ -2189,6 +2202,12 @@ packages: cpu: [arm] os: [android] + '@esbuild/android-arm@0.24.2': + resolution: {integrity: sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + '@esbuild/android-x64@0.18.20': resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} engines: {node: '>=12'} @@ -2201,6 +2220,12 @@ packages: cpu: [x64] os: [android] + '@esbuild/android-x64@0.24.2': + resolution: {integrity: sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + '@esbuild/darwin-arm64@0.18.20': resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} engines: {node: '>=12'} @@ -2213,6 +2238,12 @@ packages: cpu: [arm64] os: [darwin] + '@esbuild/darwin-arm64@0.24.2': + resolution: {integrity: sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-x64@0.18.20': resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} engines: {node: '>=12'} @@ -2225,6 +2256,12 @@ packages: cpu: [x64] os: [darwin] + '@esbuild/darwin-x64@0.24.2': + resolution: {integrity: sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + '@esbuild/freebsd-arm64@0.18.20': resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} engines: {node: '>=12'} @@ -2237,6 +2274,12 @@ packages: cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-arm64@0.24.2': + resolution: {integrity: sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-x64@0.18.20': resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} engines: {node: '>=12'} @@ -2249,6 +2292,12 @@ packages: cpu: [x64] os: [freebsd] + '@esbuild/freebsd-x64@0.24.2': + resolution: {integrity: sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + '@esbuild/linux-arm64@0.18.20': resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} engines: {node: '>=12'} @@ -2261,6 +2310,12 @@ packages: cpu: [arm64] os: [linux] + '@esbuild/linux-arm64@0.24.2': + resolution: {integrity: sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm@0.18.20': resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} engines: {node: '>=12'} @@ -2273,6 +2328,12 @@ packages: cpu: [arm] os: [linux] + '@esbuild/linux-arm@0.24.2': + resolution: {integrity: sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + '@esbuild/linux-ia32@0.18.20': resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} engines: {node: '>=12'} @@ -2285,6 +2346,12 @@ packages: cpu: [ia32] os: [linux] + '@esbuild/linux-ia32@0.24.2': + resolution: {integrity: sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-loong64@0.14.54': resolution: {integrity: sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw==} engines: {node: '>=12'} @@ -2303,6 +2370,12 @@ packages: cpu: [loong64] os: [linux] + '@esbuild/linux-loong64@0.24.2': + resolution: {integrity: sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-mips64el@0.18.20': resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} engines: {node: '>=12'} @@ -2315,6 +2388,12 @@ packages: cpu: [mips64el] os: [linux] + '@esbuild/linux-mips64el@0.24.2': + resolution: {integrity: sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-ppc64@0.18.20': resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} engines: {node: '>=12'} @@ -2327,6 +2406,12 @@ packages: cpu: [ppc64] os: [linux] + '@esbuild/linux-ppc64@0.24.2': + resolution: {integrity: sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-riscv64@0.18.20': resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} engines: {node: '>=12'} @@ -2339,6 +2424,12 @@ packages: cpu: [riscv64] os: [linux] + '@esbuild/linux-riscv64@0.24.2': + resolution: {integrity: sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-s390x@0.18.20': resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} engines: {node: '>=12'} @@ -2351,6 +2442,12 @@ packages: cpu: [s390x] os: [linux] + '@esbuild/linux-s390x@0.24.2': + resolution: {integrity: sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-x64@0.18.20': resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} engines: {node: '>=12'} @@ -2363,6 +2460,18 @@ packages: cpu: [x64] os: [linux] + '@esbuild/linux-x64@0.24.2': + resolution: {integrity: sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.24.2': + resolution: {integrity: sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + '@esbuild/netbsd-x64@0.18.20': resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} engines: {node: '>=12'} @@ -2375,12 +2484,24 @@ packages: cpu: [x64] os: [netbsd] + '@esbuild/netbsd-x64@0.24.2': + resolution: {integrity: sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + '@esbuild/openbsd-arm64@0.24.0': resolution: {integrity: sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] + '@esbuild/openbsd-arm64@0.24.2': + resolution: {integrity: sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + '@esbuild/openbsd-x64@0.18.20': resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} engines: {node: '>=12'} @@ -2393,6 +2514,12 @@ packages: cpu: [x64] os: [openbsd] + '@esbuild/openbsd-x64@0.24.2': + resolution: {integrity: sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + '@esbuild/sunos-x64@0.18.20': resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} engines: {node: '>=12'} @@ -2405,6 +2532,12 @@ packages: cpu: [x64] os: [sunos] + '@esbuild/sunos-x64@0.24.2': + resolution: {integrity: sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + '@esbuild/win32-arm64@0.18.20': resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} engines: {node: '>=12'} @@ -2417,6 +2550,12 @@ packages: cpu: [arm64] os: [win32] + '@esbuild/win32-arm64@0.24.2': + resolution: {integrity: sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-ia32@0.18.20': resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} engines: {node: '>=12'} @@ -2429,6 +2568,12 @@ packages: cpu: [ia32] os: [win32] + '@esbuild/win32-ia32@0.24.2': + resolution: {integrity: sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-x64@0.18.20': resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} engines: {node: '>=12'} @@ -2441,6 +2586,12 @@ packages: cpu: [x64] os: [win32] + '@esbuild/win32-x64@0.24.2': + resolution: {integrity: sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@eslint-community/eslint-utils@4.4.0': resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -8118,6 +8269,11 @@ packages: engines: {node: '>=18'} hasBin: true + esbuild@0.24.2: + resolution: {integrity: sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==} + engines: {node: '>=18'} + hasBin: true + escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} @@ -12078,8 +12234,8 @@ packages: resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} engines: {node: '>= 0.4'} - store2@2.14.2: - resolution: {integrity: sha512-siT1RiqlfQnGqgT/YzXVUNsom9S0H1OX+dpdGN1xkyYATo4I6sep5NmsRD/40s3IIOvlCq6akxkqG82urIZW1w==} + store2@2.14.4: + resolution: {integrity: sha512-srTItn1GOvyvOycgxjAnPA63FZNwy0PTyUBFMHRM+hVFltAeoh0LmNBz9SZqUS9mMqGk8rfyWyXn3GH5ReJ8Zw==} storybook-addon-react-router-v6@2.0.7: resolution: {integrity: sha512-vky9WXG84fQjwx55KKFQdhyUC5AnfsGJSoYx/yaJi2q/oTDcCTkcwpxlcrSKpTpNtVjsFNnaS3cuWXX+Sfc8Vw==} @@ -13205,8 +13361,8 @@ packages: terser: optional: true - vite@6.0.3: - resolution: {integrity: sha512-Cmuo5P0ENTN6HxLSo6IHsjCLn/81Vgrp81oaiFFMRa8gGDj5xEjIcEpf2ZymZtZR8oU0P2JX5WuUp/rlXcHkAw==} + vite@6.0.8: + resolution: {integrity: sha512-rJmB+6m3Qmo5nssFmm6hbSvaCS+5tH/iuTJYeHEOHMwqu/DPrjjBs1rlecCo4D0qy5xq506hMpkKx6pKaudUxA==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: @@ -17246,66 +17402,99 @@ snapshots: '@esbuild/aix-ppc64@0.24.0': optional: true + '@esbuild/aix-ppc64@0.24.2': + optional: true + '@esbuild/android-arm64@0.18.20': optional: true '@esbuild/android-arm64@0.24.0': optional: true + '@esbuild/android-arm64@0.24.2': + optional: true + '@esbuild/android-arm@0.18.20': optional: true '@esbuild/android-arm@0.24.0': optional: true + '@esbuild/android-arm@0.24.2': + optional: true + '@esbuild/android-x64@0.18.20': optional: true '@esbuild/android-x64@0.24.0': optional: true + '@esbuild/android-x64@0.24.2': + optional: true + '@esbuild/darwin-arm64@0.18.20': optional: true '@esbuild/darwin-arm64@0.24.0': optional: true + '@esbuild/darwin-arm64@0.24.2': + optional: true + '@esbuild/darwin-x64@0.18.20': optional: true '@esbuild/darwin-x64@0.24.0': optional: true + '@esbuild/darwin-x64@0.24.2': + optional: true + '@esbuild/freebsd-arm64@0.18.20': optional: true '@esbuild/freebsd-arm64@0.24.0': optional: true + '@esbuild/freebsd-arm64@0.24.2': + optional: true + '@esbuild/freebsd-x64@0.18.20': optional: true '@esbuild/freebsd-x64@0.24.0': optional: true + '@esbuild/freebsd-x64@0.24.2': + optional: true + '@esbuild/linux-arm64@0.18.20': optional: true '@esbuild/linux-arm64@0.24.0': optional: true + '@esbuild/linux-arm64@0.24.2': + optional: true + '@esbuild/linux-arm@0.18.20': optional: true '@esbuild/linux-arm@0.24.0': optional: true + '@esbuild/linux-arm@0.24.2': + optional: true + '@esbuild/linux-ia32@0.18.20': optional: true '@esbuild/linux-ia32@0.24.0': optional: true + '@esbuild/linux-ia32@0.24.2': + optional: true + '@esbuild/linux-loong64@0.14.54': optional: true @@ -17315,75 +17504,117 @@ snapshots: '@esbuild/linux-loong64@0.24.0': optional: true + '@esbuild/linux-loong64@0.24.2': + optional: true + '@esbuild/linux-mips64el@0.18.20': optional: true '@esbuild/linux-mips64el@0.24.0': optional: true + '@esbuild/linux-mips64el@0.24.2': + optional: true + '@esbuild/linux-ppc64@0.18.20': optional: true '@esbuild/linux-ppc64@0.24.0': optional: true + '@esbuild/linux-ppc64@0.24.2': + optional: true + '@esbuild/linux-riscv64@0.18.20': optional: true '@esbuild/linux-riscv64@0.24.0': optional: true + '@esbuild/linux-riscv64@0.24.2': + optional: true + '@esbuild/linux-s390x@0.18.20': optional: true '@esbuild/linux-s390x@0.24.0': optional: true + '@esbuild/linux-s390x@0.24.2': + optional: true + '@esbuild/linux-x64@0.18.20': optional: true '@esbuild/linux-x64@0.24.0': optional: true + '@esbuild/linux-x64@0.24.2': + optional: true + + '@esbuild/netbsd-arm64@0.24.2': + optional: true + '@esbuild/netbsd-x64@0.18.20': optional: true '@esbuild/netbsd-x64@0.24.0': optional: true + '@esbuild/netbsd-x64@0.24.2': + optional: true + '@esbuild/openbsd-arm64@0.24.0': optional: true + '@esbuild/openbsd-arm64@0.24.2': + optional: true + '@esbuild/openbsd-x64@0.18.20': optional: true '@esbuild/openbsd-x64@0.24.0': optional: true + '@esbuild/openbsd-x64@0.24.2': + optional: true + '@esbuild/sunos-x64@0.18.20': optional: true '@esbuild/sunos-x64@0.24.0': optional: true + '@esbuild/sunos-x64@0.24.2': + optional: true + '@esbuild/win32-arm64@0.18.20': optional: true '@esbuild/win32-arm64@0.24.0': optional: true + '@esbuild/win32-arm64@0.24.2': + optional: true + '@esbuild/win32-ia32@0.18.20': optional: true '@esbuild/win32-ia32@0.24.0': optional: true + '@esbuild/win32-ia32@0.24.2': + optional: true + '@esbuild/win32-x64@0.18.20': optional: true '@esbuild/win32-x64@0.24.0': optional: true + '@esbuild/win32-x64@0.24.2': + optional: true + '@eslint-community/eslint-utils@4.4.0(eslint@8.51.0)': dependencies: eslint: 8.51.0 @@ -18338,13 +18569,13 @@ snapshots: - ioredis - utf-8-validate - '@joshwooding/vite-plugin-react-docgen-typescript@0.2.1(typescript@5.2.2)(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1))': + '@joshwooding/vite-plugin-react-docgen-typescript@0.2.1(typescript@5.2.2)(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1))': dependencies: glob: 7.2.3 glob-promise: 4.2.2(glob@7.2.3) magic-string: 0.27.0 react-docgen-typescript: 2.2.2(typescript@5.2.2) - vite: 6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) + vite: 6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) optionalDependencies: typescript: 5.2.2 @@ -21814,7 +22045,7 @@ snapshots: - encoding - supports-color - '@storybook/builder-vite@7.4.6(typescript@5.2.2)(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1))': + '@storybook/builder-vite@7.4.6(typescript@5.2.2)(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1))': dependencies: '@storybook/channels': 7.4.6 '@storybook/client-logger': 7.4.6 @@ -21835,7 +22066,7 @@ snapshots: remark-external-links: 8.0.0 remark-slug: 6.1.0 rollup: 3.29.5 - vite: 6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) + vite: 6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) optionalDependencies: typescript: 5.2.2 transitivePeerDependencies: @@ -22184,7 +22415,7 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) semver: 7.5.4 - store2: 2.14.2 + store2: 2.14.4 telejson: 7.2.0 ts-dedent: 2.2.0 @@ -22271,19 +22502,19 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - '@storybook/react-vite@7.4.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.2.2)(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1))': + '@storybook/react-vite@7.4.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.2.2)(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1))': dependencies: - '@joshwooding/vite-plugin-react-docgen-typescript': 0.2.1(typescript@5.2.2)(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) + '@joshwooding/vite-plugin-react-docgen-typescript': 0.2.1(typescript@5.2.2)(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) '@rollup/pluginutils': 5.0.2 - '@storybook/builder-vite': 7.4.6(typescript@5.2.2)(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) + '@storybook/builder-vite': 7.4.6(typescript@5.2.2)(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) '@storybook/react': 7.4.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.2.2) - '@vitejs/plugin-react': 3.1.0(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) + '@vitejs/plugin-react': 3.1.0(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)) ast-types: 0.14.2 magic-string: 0.30.2 react: 18.3.1 react-docgen: 6.0.0-alpha.3 react-dom: 18.3.1(react@18.3.1) - vite: 6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) + vite: 6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) transitivePeerDependencies: - '@preact/preset-vite' - encoding @@ -23099,14 +23330,14 @@ snapshots: '@typescript-eslint/types': 6.7.5 eslint-visitor-keys: 3.4.3 - '@vitejs/plugin-react@3.1.0(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1))': + '@vitejs/plugin-react@3.1.0(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1))': dependencies: '@babel/core': 7.24.0 '@babel/plugin-transform-react-jsx-self': 7.23.3(@babel/core@7.24.0) '@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.24.0) magic-string: 0.27.0 react-refresh: 0.14.0 - vite: 6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) + vite: 6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) transitivePeerDependencies: - supports-color @@ -23121,25 +23352,25 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitejs/plugin-react@4.1.0(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1))': + '@vitejs/plugin-react@4.1.0(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1))': dependencies: '@babel/core': 7.24.0 '@babel/plugin-transform-react-jsx-self': 7.23.3(@babel/core@7.24.0) '@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.24.0) '@types/babel__core': 7.20.5 react-refresh: 0.14.0 - vite: 6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) + vite: 6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) transitivePeerDependencies: - supports-color - '@vitejs/plugin-react@4.2.1(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1))': + '@vitejs/plugin-react@4.2.1(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1))': dependencies: '@babel/core': 7.24.0 '@babel/plugin-transform-react-jsx-self': 7.23.3(@babel/core@7.24.0) '@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.24.0) '@types/babel__core': 7.20.5 react-refresh: 0.14.0 - vite: 6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) + vite: 6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) transitivePeerDependencies: - supports-color @@ -26813,6 +27044,34 @@ snapshots: '@esbuild/win32-ia32': 0.24.0 '@esbuild/win32-x64': 0.24.0 + esbuild@0.24.2: + optionalDependencies: + '@esbuild/aix-ppc64': 0.24.2 + '@esbuild/android-arm': 0.24.2 + '@esbuild/android-arm64': 0.24.2 + '@esbuild/android-x64': 0.24.2 + '@esbuild/darwin-arm64': 0.24.2 + '@esbuild/darwin-x64': 0.24.2 + '@esbuild/freebsd-arm64': 0.24.2 + '@esbuild/freebsd-x64': 0.24.2 + '@esbuild/linux-arm': 0.24.2 + '@esbuild/linux-arm64': 0.24.2 + '@esbuild/linux-ia32': 0.24.2 + '@esbuild/linux-loong64': 0.24.2 + '@esbuild/linux-mips64el': 0.24.2 + '@esbuild/linux-ppc64': 0.24.2 + '@esbuild/linux-riscv64': 0.24.2 + '@esbuild/linux-s390x': 0.24.2 + '@esbuild/linux-x64': 0.24.2 + '@esbuild/netbsd-arm64': 0.24.2 + '@esbuild/netbsd-x64': 0.24.2 + '@esbuild/openbsd-arm64': 0.24.2 + '@esbuild/openbsd-x64': 0.24.2 + '@esbuild/sunos-x64': 0.24.2 + '@esbuild/win32-arm64': 0.24.2 + '@esbuild/win32-ia32': 0.24.2 + '@esbuild/win32-x64': 0.24.2 + escalade@3.1.1: {} escalade@3.2.0: {} @@ -32272,7 +32531,7 @@ snapshots: dependencies: internal-slot: 1.0.5 - store2@2.14.2: {} + store2@2.14.4: {} storybook-addon-react-router-v6@2.0.7(@storybook/blocks@7.4.6(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@storybook/channels@7.4.6)(@storybook/components@7.4.6(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@storybook/core-events@7.4.6)(@storybook/manager-api@7.4.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@storybook/preview-api@7.4.6)(@storybook/theming@7.4.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react-router-dom@6.26.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1): dependencies: @@ -33365,29 +33624,29 @@ snapshots: - sass - stylus - vite-plugin-markdown@2.2.0(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)): + vite-plugin-markdown@2.2.0(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)): dependencies: domhandler: 4.3.1 front-matter: 4.0.2 htmlparser2: 6.1.0 markdown-it: 12.3.2 - vite: 6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) + vite: 6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) - vite-plugin-static-copy@2.2.0(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)): + vite-plugin-static-copy@2.2.0(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)): dependencies: chokidar: 3.6.0 fast-glob: 3.3.2 fs-extra: 11.1.1 picocolors: 1.1.1 - vite: 6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) + vite: 6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) - vite-tsconfig-paths@5.1.4(typescript@5.2.2)(vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)): + vite-tsconfig-paths@5.1.4(typescript@5.2.2)(vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1)): dependencies: debug: 4.4.0 globrex: 0.1.2 tsconfck: 3.1.4(typescript@5.2.2) optionalDependencies: - vite: 6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) + vite: 6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1) transitivePeerDependencies: - supports-color - typescript @@ -33411,9 +33670,9 @@ snapshots: fsevents: 2.3.3 terser: 5.37.0 - vite@6.0.3(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1): + vite@6.0.8(@types/node@22.10.1)(jiti@2.3.3)(terser@5.37.0)(yaml@2.6.1): dependencies: - esbuild: 0.24.0 + esbuild: 0.24.2 postcss: 8.4.49 rollup: 4.28.1 optionalDependencies: From 65085a80d034c92ce2293e5f08985828eb464858 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Mon, 27 Jan 2025 20:53:46 -0300 Subject: [PATCH 28/30] chore: e2e --- packages/app/playwright/crx/crx.test.ts | 5 +++-- .../src/playwright-utils/fuelWalletTestHelper.ts | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/app/playwright/crx/crx.test.ts b/packages/app/playwright/crx/crx.test.ts index e6a1735ccb..79a46042cb 100644 --- a/packages/app/playwright/crx/crx.test.ts +++ b/packages/app/playwright/crx/crx.test.ts @@ -90,10 +90,11 @@ test.describe('FuelWallet Extension', () => { extensionId, }) => { const popupPage = await context.newPage(); - await popupPage.goto(`chrome-extension://${extensionId}/popup.html`); - const page = await context.waitForEvent('page', { + const pagePromise = context.waitForEvent('page', { predicate: (page) => page.url().includes('sign-up'), }); + await popupPage.goto(`chrome-extension://${extensionId}/popup.html`); + const page = await pagePromise; expect(page.url()).toContain('sign-up'); }); diff --git a/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts b/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts index 2708c74901..ad7dd9d9af 100644 --- a/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts +++ b/packages/playwright-utils/src/playwright-utils/fuelWalletTestHelper.ts @@ -46,12 +46,13 @@ export class FuelWalletTestHelper { }) { const { url, chainId } = fuelProvider; const popupNotSignedUpPage = await context.newPage(); + const signupPagePromise = context.waitForEvent('page', { + predicate: (page) => page.url().includes('sign-up'), + }); await popupNotSignedUpPage.goto( `chrome-extension://${fuelExtensionId}/popup.html` ); - const signupPage = await context.waitForEvent('page', { - predicate: (page) => page.url().includes('sign-up'), - }); + const signupPage = await signupPagePromise; expect(signupPage.url()).toContain('sign-up'); await popupNotSignedUpPage.close(); From e2f1d2c933db7650d276f2be69c8124c087d42d8 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Mon, 27 Jan 2025 21:00:23 -0300 Subject: [PATCH 29/30] fix: ignore vite vulnerability --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 64f89444c5..146081a67f 100644 --- a/package.json +++ b/package.json @@ -98,6 +98,9 @@ "allowAny": ["react", "react-dom"], "ignoreMissing": ["react", "react-dom"] }, + "auditConfig": { + "ignoreGhsas": ["GHSA-vg6x-rcgg-rjx6"] + }, "overrides": { "follow-redirects": ">=1.15.6", "glob-parent@<5.1.2": ">=5.1.2", From f2b01589baae4c21a98f3de0ad2423fa3b89be13 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Sat, 1 Feb 2025 21:30:43 -0300 Subject: [PATCH 30/30] fix: outdated artifact action --- .github/workflows/pr-tests-e2e-assets.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-tests-e2e-assets.yml b/.github/workflows/pr-tests-e2e-assets.yml index 2d7b75ca27..1494154812 100644 --- a/.github/workflows/pr-tests-e2e-assets.yml +++ b/.github/workflows/pr-tests-e2e-assets.yml @@ -32,7 +32,7 @@ jobs: - name: Upload Test Report if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: e2e-test-report path: packages/e2e-assets/playwright-html \ No newline at end of file