ethereum / sharding

Sharding manager contract, and related software and tests
480 stars 105 forks source link

Validator manager contract utils #3

Closed mhchia closed 7 years ago

mhchia commented 7 years ago

A simple version of the contract utils of basic sharding v1 with a simple tester test(), without unit-tests.

Main functions

call_deposit(state, validator_manager_addr, sender_privkey, value, validation_code_addr, return_addr) returns validator_index, transaction

call_withdraw(state, validator_manager_addr, sender_privkey, validator_index, signature) returns success, transaction

call_sample(state, validator_manager_addr, block_number, shard_id, sig_index) returns validation_code_addr

call_validation_code(state, validation_code_addr, msg_hash, signature) returns success

TODO

hwwhww commented 7 years ago

I advise moving the tests to sharding/tests/test_contract_utils.py, so we can test the entire project by pytest sharding/tests command.

mhchia commented 7 years ago

This PR is contained by the PR #6