Closed nadiia-balaian closed 5 months ago
82
Create instance of the script and try to call its methods.
We created a script in rust sdk. Then I try to use them
const scriptProxy = new Script( ScriptProxyAbiBytes, ScriptProxyAbi__factory.abi, options.wallet, ); const tx = await scriptProxy.functions .main( { WithdrawCollateral: withdrawCollateralInput }, { value: new Address(BETA_CONTRACT_ADDRESSES.proxy.fuel).toB256(), }, updateFee, priceFeedIds, updateData, ) .callParams({ forward }) .txParams({ gasPrice: 1 }) const { gasUsed: gasValue } = await tx.getTransactionCost(); const res = await tx.txParams({ gasLimit: gasValue }).call();
We tested script methods in rust sdk and there is no problems with that.
When I try to call script methods inside ts sdk I got an error
Transaction is successfully sent
Error "The transaction reverted with an unknown reason: 123"
@nadiia-balaian the revert reason 123 is defined within Sway here
123
And it seems it is only being used here
This error happens when a contract was called with a method unknown for that contract
We found the root cause of the issue – it was an outdated Pyth contract and ABI on our side. Thanks for your assistance with this
What version of fuels-ts are you using?
82
Steps to Reproduce
Create instance of the script and try to call its methods.
We created a script in rust sdk. Then I try to use them
We tested script methods in rust sdk and there is no problems with that.
When I try to call script methods inside ts sdk I got an error
Expected Behavior
Transaction is successfully sent
Actual Behavior
Error "The transaction reverted with an unknown reason: 123"