Add handlers for native actions in system contract
Can we have ATC for this?
@andriantolie
Verify that native action handlers in system contract are being called properly.
For now, the handlers don't do anything. The way I verified that they are being called properly is by including print statements.
@gleehokie actually, (assuming that I am correct that this is referring to the apply method in eosio.system.hpp) it is not complete, it is not processing the currency::create action. But shouldn't this task really be to come up with a way in code (either in the contract or with a test) to ensure that this remains to be the case? We can verify right now and someone can commit a new message and it be insufficient immediately.
@brianjohnson5972 @zorba80 I certainly like having automatic ways to handle the known case where the addition of new action/message will create untested conditions. I think this is what @brianjohnson5972 is suggesting.
@zorba80 and I talked, here's the ATC:
- Verify that all native actions are routed to the system contract. The current system contract has native action handlers in the system contract that are empty functions. The system contract chooses what native actions to handle, if no handler is present the action is ignored.
- A suggestion for how to do this is to modify eos/contracts/eosio.system/native.hpp and add a print statement to each of the handlers which are the on() functions, for example this line is one of them: https://github.com/EOSIO/eos/blob/2cb8030554d1e9145f44785b9a564cd6dd1e1cab/contracts/eosio.system/native.hpp#L98 This will verify that all of the native actions that have handlers in the system contract are being handled.
- At a later date we can write a more complex test case that generates code to handle and verify all of the native actions by pulling the list from the code.
ATC Passes.
I modified the handler inside native.hpp to print a statement. For postrecovery/ passrecovery/ vetorecovery/ onerror, I modified recovery_tests to be able to reach the desired action handler. For unlink_auth and delete_auth, auth_tests is modified. Running chain_test with --verbose, I can see the statement printed by native handler is called for every action.
This branch is used to test https://github.com/andriantolie/eos/tree/1938-QA