From 60da19905d454d9397bd9a8acd70ccd101d29e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Torres?= <30977845+Torres-ssf@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:32:53 -0300 Subject: [PATCH] fix: remove problematic validation on `estimateTxDependencies` (#1702) --- .changeset/yellow-pets-marry.md | 5 +++++ packages/providers/src/provider.ts | 13 ++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 .changeset/yellow-pets-marry.md diff --git a/.changeset/yellow-pets-marry.md b/.changeset/yellow-pets-marry.md new file mode 100644 index 00000000000..b5f19795268 --- /dev/null +++ b/.changeset/yellow-pets-marry.md @@ -0,0 +1,5 @@ +--- +"@fuel-ts/providers": minor +--- + +remove problematic validation on estimateTxDependencies diff --git a/packages/providers/src/provider.ts b/packages/providers/src/provider.ts index 91fef5afcac..f16b103ab18 100644 --- a/packages/providers/src/provider.ts +++ b/packages/providers/src/provider.ts @@ -36,8 +36,9 @@ import type { TransactionRequest, TransactionRequestInput, CoinTransactionRequestInput, + ScriptTransactionRequest, } from './transaction-request'; -import { transactionRequestify, ScriptTransactionRequest } from './transaction-request'; +import { transactionRequestify } from './transaction-request'; import type { TransactionResultReceipt } from './transaction-response'; import { TransactionResponse } from './transaction-response'; import { processGqlReceipt } from './transaction-summary/receipt'; @@ -729,13 +730,11 @@ export default class Provider { return; } - if (txRequest instanceof ScriptTransactionRequest) { - txRequest.addVariableOutputs(missingOutputVariableCount); + txRequest.addVariableOutputs(missingOutputVariableCount); - missingOutputContractIds.forEach(({ contractId }) => - txRequest.addContractInputAndOutput(Address.fromString(contractId)) - ); - } + missingOutputContractIds.forEach(({ contractId }) => + txRequest.addContractInputAndOutput(Address.fromString(contractId)) + ); tries += 1; } while (tries < MAX_RETRIES);