// invariant in method in contract A
require(false, Error::ContrABlah2);
if I do the following:
// fn in contract B
contr_A.call_fn_that_fails_invariant();
the decoded logs in the TS SDK show that the decoded error is: ContrBBlah2 (even though this wasn’t the error message). Through tests, I have determined that if an error of index i in the enum definition as above in contract A is the failed message, the error of index i in the enum definition of contract B will be the one displayed.
FuelError: The transaction reverted because a "require" statement has thrown "CallerError6940".
at extractTxError (node_modules/@fuel-ts/account/src/providers/transaction-request/helpers.ts:43:5)
at _Provider.extractDryRunError (node_modules/@fuel-ts/account/src/providers/provider.ts:1725:11)
at _Provider.getTransactionCost (node_modules/@fuel-ts/account/src/providers/provider.ts:1136:7)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at FunctionInvocationScope.getTransactionCost (node_modules/@fuel-ts/program/src/functions/base-invocation-scope.ts:239:6)
at FunctionInvocationScope.fundWithRequiredCoins (node_modules/@fuel-ts/program/src/functions/base-invocation-scope.ts:261:7)
at FunctionInvocationScope.call (node_modules/@fuel-ts/program/src/functions/base-invocation-scope.ts:360:12)
TS SDK version: fuels v0.88.0
It appears that the functionInvocationScopes in BaseInvocationScopes doesn’t include the abis of contracts other than the calling contract
this line is where the main and otherContractsAbis abis are grabbed:
this.transactionRequest.abis = getAbisFromAllCalls(this.functionInvocationScopes);
// value of this.transactionRequest.abis.otherContractsAbis is {}