Skip to content

bug(TXE): Error messages in nested calls don't bubble up #7362

Description

@LHerskind

Currently if a failure happens in a nested call (foreign call) the error message will not be bubbling up.

For example, the following test will fail, but with an empty message instead of the expected.

#[test(should_fail_with="Balance too low")]
unconstrained fn transfer_private_failure_more_than_balance() {
    // Setup without account contracts. We are not using authwits here, so dummy accounts are enough
    let (env, token_contract_address, _, recipient, mint_amount) = utils::setup_and_mint(/* with_account_contracts */ false);
    // Transfer tokens
    let transfer_amount = mint_amount + 1;
    let transfer_private_call_interface = Token::at(token_contract_address).transfer(recipient, transfer_amount);
    env.call_private_void(transfer_private_call_interface);
}

Notably, if run just as a test #[test], you will get the following.

Failed calling external resolver. RPC error response: RpcError { code: -32000, message: "Assertion failed: Balance too low", data: None } 

So ideally it should be passing the first test.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions