mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-14 12:05:18 +00:00
43be3815cc
* feat: disable inflation upgrade logic * improve disable inflation comments * add upgrade tests * update changelog * split disable inflation upgrade and the upgrade check * remove pay rewards logic * clean up incentives test * add abci test * refactor upgradeTime and blockTime check * fix abci test * fix wrong pr in changelog * refactor disable inflation tests, behavior, and implementation - Unit tests are now shared between keeper and abci begin blocker since behavior is 100% the same - ABCI is unaware of keeper initial keeper logic branch (keeper methods required to be called in certain order by begin blocker) - Behavior of zero time is changed -- this now doesn't run for the zero time. This is more ideal for new chains (genesis should set all correct state instead of relying on inflation disable logic), and allows for a simpler implementation. - Begin blocker now panics if parameters are not in state * remove previous tests and implementation * remove previous block time keeper state -- not needed for inflation disalbing * move inflation disabling to private method and add more comments * remove unused key * use correct spelling for idempotence --------- Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
20 lines
468 B
Go
20 lines
468 B
Go
package community_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
"github.com/stretchr/testify/suite"
|
|
|
|
"github.com/kava-labs/kava/x/community"
|
|
"github.com/kava-labs/kava/x/community/keeper"
|
|
"github.com/kava-labs/kava/x/community/testutil"
|
|
)
|
|
|
|
func TestABCIDisableInflation(t *testing.T) {
|
|
testFunc := func(ctx sdk.Context, k keeper.Keeper) {
|
|
community.BeginBlocker(ctx, k)
|
|
}
|
|
suite.Run(t, testutil.NewDisableInflationTestSuite(testFunc))
|
|
}
|