Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAccountWrapper ¶
func NewAccountWrapper(lk Keeper) types.AccountWrapper
NewAccountWrapper returns an AccountWrapper which wraps any account to be a LienAccount associated with the given Keeper, then unwraps any layers that the Wrap added.
Types ¶
type Keeper ¶
type Keeper interface { GetAccountWrapper() types.AccountWrapper GetLien(ctx sdk.Context, addr sdk.AccAddress) types.Lien SetLien(ctx sdk.Context, addr sdk.AccAddress, lien types.Lien) IterateLiens(ctx sdk.Context, cb func(addr sdk.AccAddress, lien types.Lien) bool) ChangeLien(ctx sdk.Context, addr sdk.AccAddress, denom string, delta sdk.Int) (sdk.Int, error) GetAccountState(ctx sdk.Context, addr sdk.AccAddress) types.AccountState BondDenom(ctx sdk.Context) string GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins GetDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) []stakingTypes.Delegation GetValidator(ctx sdk.Context, valAddr sdk.ValAddress) (stakingTypes.Validator, bool) }
func NewKeeper ¶
func NewKeeper(cdc codec.Codec, key storetypes.StoreKey, ak *types.WrappedAccountKeeper, bk types.BankKeeper, sk types.StakingKeeper, pushAction vm.ActionPusher) Keeper
NewKeeper returns a new Keeper. The ak must be the same accout keeper that the bk and sk use.
type LienAccount ¶
type LienAccount struct {
// contains filtered or unexported fields
}
LienAccount wraps an omniClawbackAccount to implement lien encumbrance. The LockedCoins() method is the maximum of the coins locked for liens, and the coins locked in the underlying VestingAccount. It inherits the marshaling behavior of the wrapped account. In particular, the Lien account must be passed by pointer because of expectations from the proto library.
func (*LienAccount) LienedLockedCoins ¶
func (la *LienAccount) LienedLockedCoins(ctx sdk.Context) sdk.Coins
LienedLockedCoins returns the coins which are locked on the lien/vesting dimension, which is the raw unvested amount, plus the raw liened amount, less the net amount delegated.
func (*LienAccount) LockedCoins ¶
func (la *LienAccount) LockedCoins(ctx sdk.Context) sdk.Coins
LockedCoins implements the method from the VestingAccount interface. It takes the maximum of the coins locked for liens and the coins locked in the wrapped VestingAccount, but limited to the current account balance.
func (*LienAccount) XXX_MessageName ¶
func (la *LienAccount) XXX_MessageName() string
XXX_MessageName provides the message name for JSON serialization. See proto.MessageName().