## TLDR
I worked on improving the tests for the core functions of the light client package.
Meanwhile I encountered some bugs that I fixed.
## Recap of last week
In the last update, I mentioned that I was working on a big refactor. Multiple PRs were opened and merged for that purpose. We almost finalized the structure of the functions and packages that make things more clear.
## What happened this week
During the past two weeks I focused on improving the tests that we had (or did not have) for the core light client package. During the refactorings there were multiple parts of the code that we were not covering in the tests. That kind of stressed me out, and I tried to improve the test coverage.
Specifically I added tests for:
- `NewLightClientFinalityUpdateFromBeaconState` using a valid finalized block
- `NewLightClientFinalityUpdateFromBeaconState` using a nil finalized block
- `NewLightClientFinalityUpdateFromBeaconState` using a valid finalized block in the previous fork of the attested block
during the last part I encountered a bug where the finalized header was being created based on the attested block's version, not the finalized block itslef.
Check the PR [here](https://github.com/prysmaticlabs/prysm/pull/14457)
After that, I realized another bug in the `CreateNewLightClientUpdate` function in the `core/light-client` package, which was a bad one!
When we were creating the `AttestedHeader` in the update, the fields `Execution` and `ExecutionBranch` were being based on the current `Block`, not the `AttestedBlock`. So I tackled this. It turned out to be a bigger change than I expected.
Check out the PR [here](https://github.com/prysmaticlabs/prysm/pull/14468)
## What's next
For the next two weeks, unless something else comes up, I will focus on:
- `GetLightClientUpdatesByRange` RPC handler, to make it read from the DB,
- And saving the updates in the DB when recieving the blocks.
## Other notes