Documentation for eth_defi.trace.assert_call_success_with_explanation function.
- assert_call_success_with_explanation(func, transaction=None)
Make a Web3.call and if it fails get the Solidity stack trace.
We do debug_traceCall first to see if the call fails
If it does not fail we do the actual eth_call
Because Anvil does not support trace_call yet, we just do this as sending the transaction. We assume the call does not change any state. See notes in
If not gas given, assume 1,000,000 gas units.
func (web3.contract.contract.ContractFunction) – Prepared
transaction (Optional[web3.types.TxParams]) – Transactional parameters for the call, like gas limit and sender.
TransactionAssertionError – Outputs a verbose AssertionError on what went wrong.
Same results as you would have with func.call(transaction)
- Return type