mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 18:15:19 +00:00
cf009647e6
* Add accumulators * Move accumulator back to keeper package * Add earn specific accumulators * Move store methods to sub-package * Move earn accumulator * Rename accumulator files * Add store doc comment * Add earn accumulator tests, panic if accumulator not used with earn claim type * Update earn accumulator tests to use new methods * Add staking test for earn accumulator * Add test for accumulator proportional rewards * Remove old copy of GetProportionalRewardsPerSecond * Add test for basic accumulator * Fix AddIncentiveMultiRewardPeriod replacement * Deduplicate base earn reward accumulator * Check errors in tests * Validate RewardPeriods in Params.Validate() * Use adapter to fetch earn total shares
21 lines
429 B
Go
21 lines
429 B
Go
package store
|
|
|
|
import (
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
)
|
|
|
|
// IncentiveStore provides methods for interacting with the incentive store.
|
|
type IncentiveStore struct {
|
|
cdc codec.Codec
|
|
key sdk.StoreKey
|
|
}
|
|
|
|
// NewIncentiveStore creates a new IncentiveStore
|
|
func NewIncentiveStore(cdc codec.Codec, key sdk.StoreKey) IncentiveStore {
|
|
return IncentiveStore{
|
|
cdc: cdc,
|
|
key: key,
|
|
}
|
|
}
|