EVM: refactor xtz native withdrawals
What
This MR refactors the way native (xtz) withdrawals are handled in the EVM kernel.
Why
These changes are required for FA withdrawals to be added in further FA Bridge MRs.
How
- The
Withdrawalstruct used to store withdrawals in theExecutionOutcome,PrecompileOutcomeandTransactionLayerDatachanged to matchOutboxMessage<Expr: Michelson>, so it is possible to store both FA Withdrawals and Native withdrawals in the same data structures -
RouterInterfacetype added which reflects both Native and FA Ticketers Michelson entrypoint - The logic of the
withdrawal_precompileincludes all steps required to prepareOutboxMessagewhich was initially implemented in thepost_withdrawalsfn withinapply_transactionlogic - Removed the ticketer value, which propagated to
handle_transaction_result - Added test to the kernel which checks that native (xtz) withdrawal applied and expected
OutboxMessagecreated.
Manually testing the MR
Run make test
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Stepan Naumov