# EPF Week 10 + 11 Update (NC Navie Chan) ## Summary These two weeks I have learned about how to write unit test in Rust as well as some of the tools and libraries provided by Lighthouse to mock beacon chain and beacon state. Particularly `BeaconChainHarness` which is a one-stop object that creates and manages a mocked `BeaconChain` and `BeaconState` that are solely for testing. However I realized the harness currently doesn't support signing and adding sync committee contribution which are essential to my unit testing on sync committee reward endpoint. I added the aforementioned functionality to harness and the mocked chain successfully produced a block that I need (A block that has no attestation but only sync committee contribution). I have also finished the coding on uniting testing sync committee rewards. The strategey here is to compare the balance of each validator in sync committee before and after a block is applied. `pre_state_balance + sync_commitee_reward = post_state_balance` for every sync committee particpants. An exception to this is the validator who proposes a block that includes the sync committee's output. Since in the `post_state_balance` it receives the normal block proposing reward and the additional sync committee proposing reward, the aforementioned equation won't work and we will need some other strategy to test the correctness of it. I will need to touch base with Sproul on this. ## What I did - Learned how to write unit test in Rust - Learned about the unit test tools and libraries that are needed for sync committee rewards - Finish coding up the unit test for sync committee participation reward and attested the correctness of the current calculation of the reward. ## Goal Next Week - Perform testing by spinning up a local instance, make a reward request and cross-check result with the rewards posted on `beaconcha.in`. - Contact Sproul and ask for advice on how to deal with unit testing the sync committee proposing reward - May start looking at block reward endpoint if time permits