Documentation ¶
Index ¶
- Constants
- Variables
- func KeyTestPubAddr() (cryptotypes.PrivKey, cryptotypes.PubKey, sdk.AccAddress)
- func NewTestCoins() sdk.Coins
- func NewTestMsg(addrs ...sdk.AccAddress) *testdata.TestMsg
- func RegisterInterfaces(registry types.InterfaceRegistry)
- func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- type BankKeeper
- type BaseVestingAccount
- func (*BaseVestingAccount) Descriptor() ([]byte, []int)
- func (bva BaseVestingAccount) GetDelegatedFree() sdk.Coins
- func (bva BaseVestingAccount) GetDelegatedVesting() sdk.Coins
- func (bva BaseVestingAccount) GetEndTime() int64
- func (bva BaseVestingAccount) GetOriginalVesting() sdk.Coins
- func (bva BaseVestingAccount) LockedCoinsFromVesting(vestingCoins sdk.Coins) sdk.Coins
- func (m *BaseVestingAccount) Marshal() (dAtA []byte, err error)
- func (m *BaseVestingAccount) MarshalTo(dAtA []byte) (int, error)
- func (m *BaseVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (bva BaseVestingAccount) MarshalYAML() (interface{}, error)
- func (*BaseVestingAccount) ProtoMessage()
- func (m *BaseVestingAccount) Reset()
- func (m *BaseVestingAccount) Size() (n int)
- func (bva BaseVestingAccount) String() string
- func (bva *BaseVestingAccount) TrackDelegation(balance, vestingCoins, amount sdk.Coins)
- func (bva *BaseVestingAccount) TrackUndelegation(amount sdk.Coins)
- func (m *BaseVestingAccount) Unmarshal(dAtA []byte) error
- func (bva BaseVestingAccount) Validate() error
- func (m *BaseVestingAccount) XXX_DiscardUnknown()
- func (m *BaseVestingAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BaseVestingAccount) XXX_Merge(src proto.Message)
- func (m *BaseVestingAccount) XXX_Size() int
- func (m *BaseVestingAccount) XXX_Unmarshal(b []byte) error
- type MsgClient
- type MsgServer
- type Period
- func (*Period) Descriptor() ([]byte, []int)
- func (p Period) Duration() time.Duration
- func (m *Period) GetActionType() int32
- func (m *Period) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins
- func (m *Period) GetLength() int64
- func (m *Period) GetStartTime() int64
- func (m *Period) Marshal() (dAtA []byte, err error)
- func (m *Period) MarshalTo(dAtA []byte) (int, error)
- func (m *Period) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Period) ProtoMessage()
- func (m *Period) Reset()
- func (m *Period) Size() (n int)
- func (p Period) String() string
- func (m *Period) Unmarshal(dAtA []byte) error
- func (m *Period) XXX_DiscardUnknown()
- func (m *Period) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Period) XXX_Merge(src proto.Message)
- func (m *Period) XXX_Size() int
- func (m *Period) XXX_Unmarshal(b []byte) error
- type Periods
- type StridePeriodicVestingAccount
- func (pva *StridePeriodicVestingAccount) AddNewGrant(grantedPeriod Period)
- func (*StridePeriodicVestingAccount) Descriptor() ([]byte, []int)
- func (pva StridePeriodicVestingAccount) GetStartTime() int64
- func (pva StridePeriodicVestingAccount) GetVestedCoins(blockTime time.Time) sdk.Coins
- func (pva StridePeriodicVestingAccount) GetVestingCoins(blockTime time.Time) sdk.Coins
- func (pva StridePeriodicVestingAccount) GetVestingPeriods() Periods
- func (pva StridePeriodicVestingAccount) LockedCoins(blockTime time.Time) sdk.Coins
- func (m *StridePeriodicVestingAccount) Marshal() (dAtA []byte, err error)
- func (m *StridePeriodicVestingAccount) MarshalTo(dAtA []byte) (int, error)
- func (m *StridePeriodicVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (pva StridePeriodicVestingAccount) MarshalYAML() (interface{}, error)
- func (*StridePeriodicVestingAccount) ProtoMessage()
- func (m *StridePeriodicVestingAccount) Reset()
- func (m *StridePeriodicVestingAccount) Size() (n int)
- func (pva StridePeriodicVestingAccount) String() string
- func (pva *StridePeriodicVestingAccount) TrackDelegation(blockTime time.Time, balance, amount sdk.Coins)
- func (m *StridePeriodicVestingAccount) Unmarshal(dAtA []byte) error
- func (pva StridePeriodicVestingAccount) Validate() error
- func (m *StridePeriodicVestingAccount) XXX_DiscardUnknown()
- func (m *StridePeriodicVestingAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *StridePeriodicVestingAccount) XXX_Merge(src proto.Message)
- func (m *StridePeriodicVestingAccount) XXX_Size() int
- func (m *StridePeriodicVestingAccount) XXX_Unmarshal(b []byte) error
- type UnimplementedMsgServer
Constants ¶
const ( // ModuleName defines the module's name. ModuleName = "stridevesting" // AttributeValueCategory is an alias for the message event value. AttributeValueCategory = ModuleName // RouterKey defines the module's message routing key RouterKey = ModuleName )
Variables ¶
Functions ¶
func KeyTestPubAddr ¶
func KeyTestPubAddr() (cryptotypes.PrivKey, cryptotypes.PubKey, sdk.AccAddress)
KeyTestPubAddr generates a test key pair
func NewTestMsg ¶
func NewTestMsg(addrs ...sdk.AccAddress) *testdata.TestMsg
NewTestMsg generates a test message
func RegisterInterfaces ¶
func RegisterInterfaces(registry types.InterfaceRegistry)
RegisterInterface associates protoName with AccountI and VestingAccount Interfaces and creates a registry of it's concrete implementations
func RegisterLegacyAminoCodec ¶
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
RegisterLegacyAminoCodec registers the vesting interfaces and concrete types on the provided LegacyAmino codec. These types are used for Amino JSON serialization
func RegisterMsgServer ¶
Types ¶
type BankKeeper ¶
type BankKeeper interface { IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error BlockedAddr(addr sdk.AccAddress) bool }
BankKeeper defines the expected interface contract the vesting module requires for creating vesting accounts with funds.
type BaseVestingAccount ¶
type BaseVestingAccount struct { *types.BaseAccount `protobuf:"bytes,1,opt,name=base_account,json=baseAccount,proto3,embedded=base_account" json:"base_account,omitempty"` OriginalVesting github_com_cosmos_cosmos_sdk_types.Coins `` /* 174-byte string literal not displayed */ DelegatedFree github_com_cosmos_cosmos_sdk_types.Coins `` /* 166-byte string literal not displayed */ DelegatedVesting github_com_cosmos_cosmos_sdk_types.Coins `` /* 178-byte string literal not displayed */ EndTime int64 `protobuf:"varint,5,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty" yaml:"end_time"` }
BaseVestingAccount implements the VestingAccount interface. It contains all the necessary fields needed for any vesting account implementation.
func NewBaseVestingAccount ¶
func NewBaseVestingAccount(baseAccount *authtypes.BaseAccount, originalVesting sdk.Coins, endTime int64) *BaseVestingAccount
NewBaseVestingAccount creates a new BaseVestingAccount object. It is the callers responsibility to ensure the base account has sufficient funds with regards to the original vesting amount.
func (*BaseVestingAccount) Descriptor ¶
func (*BaseVestingAccount) Descriptor() ([]byte, []int)
func (BaseVestingAccount) GetDelegatedFree ¶
func (bva BaseVestingAccount) GetDelegatedFree() sdk.Coins
GetDelegatedFree returns a vesting account's delegation amount that is not vesting.
func (BaseVestingAccount) GetDelegatedVesting ¶
func (bva BaseVestingAccount) GetDelegatedVesting() sdk.Coins
GetDelegatedVesting returns a vesting account's delegation amount that is still vesting.
func (BaseVestingAccount) GetEndTime ¶
func (bva BaseVestingAccount) GetEndTime() int64
GetEndTime returns a vesting account's end time
func (BaseVestingAccount) GetOriginalVesting ¶
func (bva BaseVestingAccount) GetOriginalVesting() sdk.Coins
GetOriginalVesting returns a vesting account's original vesting amount
func (BaseVestingAccount) LockedCoinsFromVesting ¶
func (bva BaseVestingAccount) LockedCoinsFromVesting(vestingCoins sdk.Coins) sdk.Coins
LockedCoinsFromVesting returns all the coins that are not spendable (i.e. locked) for a vesting account given the current vesting coins. If no coins are locked, an empty slice of Coins is returned.
CONTRACT: Delegated vesting coins and vestingCoins must be sorted.
func (*BaseVestingAccount) Marshal ¶
func (m *BaseVestingAccount) Marshal() (dAtA []byte, err error)
func (*BaseVestingAccount) MarshalTo ¶
func (m *BaseVestingAccount) MarshalTo(dAtA []byte) (int, error)
func (*BaseVestingAccount) MarshalToSizedBuffer ¶
func (m *BaseVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (BaseVestingAccount) MarshalYAML ¶
func (bva BaseVestingAccount) MarshalYAML() (interface{}, error)
MarshalYAML returns the YAML representation of a BaseVestingAccount.
func (*BaseVestingAccount) ProtoMessage ¶
func (*BaseVestingAccount) ProtoMessage()
func (*BaseVestingAccount) Reset ¶
func (m *BaseVestingAccount) Reset()
func (*BaseVestingAccount) Size ¶
func (m *BaseVestingAccount) Size() (n int)
func (BaseVestingAccount) String ¶
func (bva BaseVestingAccount) String() string
func (*BaseVestingAccount) TrackDelegation ¶
func (bva *BaseVestingAccount) TrackDelegation(balance, vestingCoins, amount sdk.Coins)
TrackDelegation tracks a delegation amount for any given vesting account type given the amount of coins currently vesting and the current account balance of the delegation denominations.
CONTRACT: The account's coins, delegation coins, vesting coins, and delegated vesting coins must be sorted.
func (*BaseVestingAccount) TrackUndelegation ¶
func (bva *BaseVestingAccount) TrackUndelegation(amount sdk.Coins)
TrackUndelegation tracks an undelegation amount by setting the necessary values by which delegated vesting and delegated vesting need to decrease and by which amount the base coins need to increase.
NOTE: The undelegation (bond refund) amount may exceed the delegated vesting (bond) amount due to the way undelegation truncates the bond refund, which can increase the validator's sharesToTokens rate slightly if the undelegated tokens are non-integral.
CONTRACT: The account's coins and undelegation coins must be sorted.
func (*BaseVestingAccount) Unmarshal ¶
func (m *BaseVestingAccount) Unmarshal(dAtA []byte) error
func (BaseVestingAccount) Validate ¶
func (bva BaseVestingAccount) Validate() error
Validate checks for errors on the account fields
func (*BaseVestingAccount) XXX_DiscardUnknown ¶
func (m *BaseVestingAccount) XXX_DiscardUnknown()
func (*BaseVestingAccount) XXX_Marshal ¶
func (m *BaseVestingAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BaseVestingAccount) XXX_Merge ¶
func (m *BaseVestingAccount) XXX_Merge(src proto.Message)
func (*BaseVestingAccount) XXX_Size ¶
func (m *BaseVestingAccount) XXX_Size() int
func (*BaseVestingAccount) XXX_Unmarshal ¶
func (m *BaseVestingAccount) XXX_Unmarshal(b []byte) error
type MsgClient ¶
type MsgClient interface { }
MsgClient is the client API for Msg service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMsgClient ¶
func NewMsgClient(cc grpc1.ClientConn) MsgClient
type Period ¶
type Period struct { StartTime int64 `protobuf:"varint,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` Length int64 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` ActionType int32 `protobuf:"varint,4,opt,name=action_type,json=actionType,proto3" json:"action_type,omitempty"` }
Period defines a length of time and amount of coins that will vest.
func (*Period) Descriptor ¶
func (*Period) GetActionType ¶
func (*Period) GetAmount ¶
func (m *Period) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins
func (*Period) GetStartTime ¶
func (*Period) MarshalToSizedBuffer ¶
func (*Period) ProtoMessage ¶
func (*Period) ProtoMessage()
func (*Period) XXX_DiscardUnknown ¶
func (m *Period) XXX_DiscardUnknown()
func (*Period) XXX_Marshal ¶
func (*Period) XXX_Unmarshal ¶
type Periods ¶
type Periods []Period
Periods stores all vesting periods passed as part of a StridePeriodicVestingAccount
func (Periods) TotalAmount ¶
TotalDuration returns the sum of coins for the period
func (Periods) TotalDuration ¶
TotalDuration returns the total duration of the period
func (Periods) TotalLength ¶
TotalLength return the total length in seconds for a period
type StridePeriodicVestingAccount ¶
type StridePeriodicVestingAccount struct { *BaseVestingAccount `` /* 147-byte string literal not displayed */ VestingPeriods []Period `protobuf:"bytes,3,rep,name=vesting_periods,json=vestingPeriods,proto3" json:"vesting_periods" yaml:"vesting_periods"` }
StridePeriodicVestingAccount implements the VestingAccount interface. It periodically vests by unlocking coins during each specified period.
func NewStridePeriodicVestingAccount ¶
func NewStridePeriodicVestingAccount(baseAcc *authtypes.BaseAccount, originalVesting sdk.Coins, periods Periods) *StridePeriodicVestingAccount
NewStridePeriodicVestingAccount returns a new StridePeriodicVestingAccount
func NewStridePeriodicVestingAccountRaw ¶
func NewStridePeriodicVestingAccountRaw(bva *BaseVestingAccount, startTime int64, periods Periods) *StridePeriodicVestingAccount
NewStridePeriodicVestingAccountRaw creates a new StridePeriodicVestingAccount object from BaseVestingAccount
func (*StridePeriodicVestingAccount) AddNewGrant ¶
func (pva *StridePeriodicVestingAccount) AddNewGrant(grantedPeriod Period)
AddNewGrant adds a new grant
func (*StridePeriodicVestingAccount) Descriptor ¶
func (*StridePeriodicVestingAccount) Descriptor() ([]byte, []int)
func (StridePeriodicVestingAccount) GetStartTime ¶
func (pva StridePeriodicVestingAccount) GetStartTime() int64
GetStartTime returns the time when vesting starts for a periodic vesting account.
func (StridePeriodicVestingAccount) GetVestedCoins ¶
func (pva StridePeriodicVestingAccount) GetVestedCoins(blockTime time.Time) sdk.Coins
GetVestedCoins returns the total number of vested coins. If no coins are vested, nil is returned.
func (StridePeriodicVestingAccount) GetVestingCoins ¶
func (pva StridePeriodicVestingAccount) GetVestingCoins(blockTime time.Time) sdk.Coins
GetVestingCoins returns the total number of vesting coins. If no coins are vesting, nil is returned.
func (StridePeriodicVestingAccount) GetVestingPeriods ¶
func (pva StridePeriodicVestingAccount) GetVestingPeriods() Periods
GetVestingPeriods returns vesting periods associated with periodic vesting account.
func (StridePeriodicVestingAccount) LockedCoins ¶
func (pva StridePeriodicVestingAccount) LockedCoins(blockTime time.Time) sdk.Coins
LockedCoins returns the set of coins that are not spendable (i.e. locked), defined as the vesting coins that are not delegated.
func (*StridePeriodicVestingAccount) Marshal ¶
func (m *StridePeriodicVestingAccount) Marshal() (dAtA []byte, err error)
func (*StridePeriodicVestingAccount) MarshalTo ¶
func (m *StridePeriodicVestingAccount) MarshalTo(dAtA []byte) (int, error)
func (*StridePeriodicVestingAccount) MarshalToSizedBuffer ¶
func (m *StridePeriodicVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (StridePeriodicVestingAccount) MarshalYAML ¶
func (pva StridePeriodicVestingAccount) MarshalYAML() (interface{}, error)
MarshalYAML returns the YAML representation of a StridePeriodicVestingAccount.
func (*StridePeriodicVestingAccount) ProtoMessage ¶
func (*StridePeriodicVestingAccount) ProtoMessage()
func (*StridePeriodicVestingAccount) Reset ¶
func (m *StridePeriodicVestingAccount) Reset()
func (*StridePeriodicVestingAccount) Size ¶
func (m *StridePeriodicVestingAccount) Size() (n int)
func (StridePeriodicVestingAccount) String ¶
func (pva StridePeriodicVestingAccount) String() string
func (*StridePeriodicVestingAccount) TrackDelegation ¶
func (pva *StridePeriodicVestingAccount) TrackDelegation(blockTime time.Time, balance, amount sdk.Coins)
TrackDelegation tracks a desired delegation amount by setting the appropriate values for the amount of delegated vesting, delegated free, and reducing the overall amount of base coins.
func (*StridePeriodicVestingAccount) Unmarshal ¶
func (m *StridePeriodicVestingAccount) Unmarshal(dAtA []byte) error
func (StridePeriodicVestingAccount) Validate ¶
func (pva StridePeriodicVestingAccount) Validate() error
Validate checks for errors on the account fields
func (*StridePeriodicVestingAccount) XXX_DiscardUnknown ¶
func (m *StridePeriodicVestingAccount) XXX_DiscardUnknown()
func (*StridePeriodicVestingAccount) XXX_Marshal ¶
func (m *StridePeriodicVestingAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*StridePeriodicVestingAccount) XXX_Merge ¶
func (m *StridePeriodicVestingAccount) XXX_Merge(src proto.Message)
func (*StridePeriodicVestingAccount) XXX_Size ¶
func (m *StridePeriodicVestingAccount) XXX_Size() int
func (*StridePeriodicVestingAccount) XXX_Unmarshal ¶
func (m *StridePeriodicVestingAccount) XXX_Unmarshal(b []byte) error
type UnimplementedMsgServer ¶
type UnimplementedMsgServer struct { }
UnimplementedMsgServer can be embedded to have forward compatible implementations.