ava-labs / hypersdk

Opinionated Framework for Building Hyper-Scalable Blockchains on Avalanche
Other
203 stars 112 forks source link

Add Test Suite for `BalanceHandler` #1612

Closed RodrigoVillar closed 1 week ago

RodrigoVillar commented 1 month ago

Currently, we do not have a framework for testing implementations of BalanceHandler. This is an issue as, if key permissions are incorrectly allocated or if the various setter methods of BalanceHandler don't behave as expected, then this can corrupt the fee-logic of a HyperVM.

Design Doc

Ideally, there are two things that any implementation of BalanceHandler should do:

With the above in mind (and taking inspiration from action tests), a test suite for BalanceHandler could come with the following:

RodrigoVillar commented 1 month ago

Related: #1589 (incorrect implementation of SponsorStateKeys() in CFMM-VM was responsible for the issue linked)