planetmint-go/app/ante/expected_keepers.go
Lorenz Herzberger 94830df5fc
184 implement staged claim (#190)
* adjust issuePoPRewards to mint stagedCRDDL
* add GetChallengeRange
* add resolveStagedClaims on ReissueRDDLResult msg
* move claim resolve to distribution result
* add StagedDenom and ClaimDenom to config
* added the prepare4linting.sh script
* renamed PoPEpochs to PopEpochs
* renamed DistributionAddressPoP to DistributionAddressPop
* added config value ReIssuanceEpochs
* detached the re-issuance from the distribution process and schedule them independently
* changed logging messages
* added an explicit util/kv_serialize.go file to have all KV serialization done
* switched to Bigendian serialization of int64 to have the ordered list on the kvstore
* added ComputeReIssuanceValue to enable re-issuances once a day or defined by ReIssuanceEpoch
* integrated a ReIssuanceValue computation test case
* adjusted the challenges test cases to be epoch-dependent
* added ReIssuances per ReIssuanceEpoch
* extended the Reissue message
* checking ReIssuanceProposal in the ante handler
* added precision setter for the UINT to RDDL token converter (and test cases)
* add e2e test case for pop rewards


Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Co-authored-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-12-05 10:51:06 +01:00

42 lines
1.7 KiB
Go

package ante
import (
"github.com/planetmint/planetmint-go/x/machine/types"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
daotypes "github.com/planetmint/planetmint-go/x/dao/types"
)
type MachineKeeper interface {
GetMachineIndexByPubKey(ctx sdk.Context, pubKey string) (val types.MachineIndex, found bool)
GetMachineIndexByAddress(ctx sdk.Context, address string) (val types.MachineIndex, found bool)
GetTrustAnchor(ctx sdk.Context, pubKey string) (val types.TrustAnchor, activated bool, found bool)
}
// AccountKeeper defines the contract needed for AccountKeeper related APIs.
// Interface provides support to use non-sdk AccountKeeper for AnteHandler's decorators.
type AccountKeeper interface {
GetParams(ctx sdk.Context) (params authtypes.Params)
GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
SetAccount(ctx sdk.Context, acc authtypes.AccountI)
GetModuleAddress(moduleName string) sdk.AccAddress
}
// FeegrantKeeper defines the expected feegrant keeper.
type FeegrantKeeper interface {
UseGrantedFees(ctx sdk.Context, granter, grantee sdk.AccAddress, fee sdk.Coins, msgs []sdk.Msg) error
}
type BankKeeper interface {
IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error
SendCoins(ctx sdk.Context, from, to sdk.AccAddress, amt sdk.Coins) error
SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
}
type DaoKeeper interface {
GetMintRequestByHash(ctx sdk.Context, hash string) (val daotypes.MintRequest, found bool)
GetMintAddress(ctx sdk.Context) (mintAddress string)
IsValidReIssuanceProposal(ctx sdk.Context, msg *daotypes.MsgReissueRDDLProposal) (isValid bool)
}