You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 fntransfer_private_failure_more_than_balance(){// Setup without account contracts. We are not using authwits here, so dummy accounts are enoughlet(env, token_contract_address, _, recipient, mint_amount) = utils::setup_and_mint(/* with_account_contracts */false);// Transfer tokenslet 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.
Replaces AztecProtocol/aztec-packages#7271ClosesAztecProtocol/aztec-packages#7142ClosesAztecProtocol/aztec-packages#7362
This is quite similar to the implementation in #7271: `transfer`
consumes two notes, and if their amount is insufficient for the desired
transfer it calls a second internal function which recursively consumes
8 notes per iteration until either the amount is reached, or no more
notes are found. If the total amount consumed exceeds the transfer
amount, a change note is created.
This results in a much smaller transfer function for the scenario in
which two notes suffice, since we're using a `limit` value of 2 and
therefore only doing two iterations of note constraining (the expensive
part). Two notes is a good amount as it provides a way for change notes
to be consumed in follow-up calls.
The recursive call has a much lower gate count, since it doesn't need to
fetch keys, create notes, emit events, etc., and so we can afford to
read more notes here while still resulting in a relatively small
circuit.
I created a new e2e test in which the number of notes and their amounts
are quite controlled in order to properly test this. The tests are
unfortunately currently interdependent, but given the relative
simplicity of the test suite it should be hopefully simple to maintain
and expand, and maybe eventually fix.
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.
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.
The text was updated successfully, but these errors were encountered: