-
Notifications
You must be signed in to change notification settings - Fork 50
/
expected_keeper.go
43 lines (37 loc) · 1.93 KB
/
expected_keeper.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package types
import (
"time"
"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
certtypes "github.com/shentufoundation/shentu/v2/x/cert/types"
shieldtypes "github.com/shentufoundation/shentu/v2/x/shield/types"
)
type CertKeeper interface {
IsCertifier(ctx sdk.Context, addr sdk.AccAddress) bool
GetAllCertifiers(ctx sdk.Context) (certifiers certtypes.Certifiers)
GetCertifier(ctx sdk.Context, certifierAddress sdk.AccAddress) (certtypes.Certifier, error)
HasCertifierAlias(ctx sdk.Context, alias string) bool
IsCertified(ctx sdk.Context, content string, certType string) bool
GetCertifiedIdentities(ctx sdk.Context) []sdk.AccAddress
}
type ShieldKeeper interface {
GetPurchase(purchaseList shieldtypes.PurchaseList, purchaseID uint64) (shieldtypes.Purchase, bool)
GetPurchaseList(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress) (shieldtypes.PurchaseList, bool)
GetClaimProposalParams(ctx sdk.Context) shieldtypes.ClaimProposalParams
SecureCollaterals(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress, purchaseID uint64, loss sdk.Coins, lockPeriod time.Duration) error
RestoreShield(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress, id uint64, loss sdk.Coins) error
ClaimEnd(ctx sdk.Context, id, poolID uint64, loss sdk.Coins)
}
type ParamSubspace interface {
Get(ctx sdk.Context, key []byte, ptr interface{})
Set(ctx sdk.Context, key []byte, param interface{})
GetRaw(ctx sdk.Context, key []byte) []byte
}
type StakingKeeper interface {
IterateBondedValidatorsByPower(sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool))
TotalBondedTokens(sdk.Context) math.Int
IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, fn func(index int64, delegation stakingtypes.DelegationI) (stop bool))
BondDenom(sdk.Context) string
GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool)
}