import "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
codec.go constants.go expected_keepers.go msgs.go period.go test_common.go tx.pb.go vesting.pb.go vesting_account.go
const ( // ModuleName defines the module's name. ModuleName = "vesting" // AttributeValueCategory is an alias for the message event value. AttributeValueCategory = ModuleName // RouterKey defines the module's message routing key RouterKey = ModuleName )
const TypeMsgCreateVestingAccount = "msg_create_vesting_account"
TypeMsgCreateVestingAccount defines the type value for a MsgCreateVestingAccount.
var ( ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthVesting = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowVesting = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupVesting = fmt.Errorf("proto: unexpected end of group") )
func KeyTestPubAddr() (cryptotypes.PrivKey, cryptotypes.PubKey, sdk.AccAddress)
KeyTestPubAddr generates a test key pair
NewTestCoins coins to more than cover the fee
func NewTestMsg(addrs ...sdk.AccAddress) *testdata.TestMsg
NewTestMsg generates a test message
func RegisterInterfaces(registry types.InterfaceRegistry)
RegisterInterface associates protoName with AccountI and VestingAccount Interfaces and creates a registry of it's concrete implementations
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
type BankKeeper interface { SendEnabledCoins(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 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 `protobuf:"bytes,2,rep,name=original_vesting,json=originalVesting,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"original_vesting" yaml:"original_vesting"` DelegatedFree github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=delegated_free,json=delegatedFree,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"delegated_free" yaml:"delegated_free"` DelegatedVesting github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=delegated_vesting,json=delegatedVesting,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"delegated_vesting" yaml:"delegated_vesting"` 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(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() ([]byte, []int)
func (bva BaseVestingAccount) GetDelegatedFree() sdk.Coins
GetDelegatedFree returns a vesting account's delegation amount that is not vesting.
func (bva BaseVestingAccount) GetDelegatedVesting() sdk.Coins
GetDelegatedVesting returns a vesting account's delegation amount that is still vesting.
func (bva BaseVestingAccount) GetEndTime() int64
GetEndTime returns a vesting account's end time
func (bva BaseVestingAccount) GetOriginalVesting() sdk.Coins
GetOriginalVesting returns a vesting account's original vesting amount
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 (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)
MarshalYAML returns the YAML representation of a BaseVestingAccount.
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)
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 (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 exchange rate (tokens/shares) slightly if the undelegated tokens are non-integral.
CONTRACT: The account's coins and undelegation coins must be sorted.
func (m *BaseVestingAccount) Unmarshal(dAtA []byte) error
func (bva BaseVestingAccount) Validate() error
Validate checks for errors on the account fields
func (m *BaseVestingAccount) XXX_DiscardUnknown()
func (m *BaseVestingAccount) XXX_Merge(src proto.Message)
func (m *BaseVestingAccount) XXX_Size() int
func (m *BaseVestingAccount) XXX_Unmarshal(b []byte) error
type ContinuousVestingAccount struct { *BaseVestingAccount `protobuf:"bytes,1,opt,name=base_vesting_account,json=baseVestingAccount,proto3,embedded=base_vesting_account" json:"base_vesting_account,omitempty"` StartTime int64 `protobuf:"varint,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty" yaml:"start_time"` }
ContinuousVestingAccount implements the VestingAccount interface. It continuously vests by unlocking coins linearly with respect to time.
func NewContinuousVestingAccount(baseAcc *authtypes.BaseAccount, originalVesting sdk.Coins, startTime, endTime int64) *ContinuousVestingAccount
NewContinuousVestingAccount returns a new ContinuousVestingAccount
func NewContinuousVestingAccountRaw(bva *BaseVestingAccount, startTime int64) *ContinuousVestingAccount
NewContinuousVestingAccountRaw creates a new ContinuousVestingAccount object from BaseVestingAccount
func (*ContinuousVestingAccount) Descriptor() ([]byte, []int)
func (cva ContinuousVestingAccount) GetStartTime() int64
GetStartTime returns the time when vesting starts for a continuous vesting account.
GetVestedCoins returns the total number of vested coins. If no coins are vested, nil is returned.
GetVestingCoins returns the total number of vesting coins. If no coins are vesting, nil is returned.
LockedCoins returns the set of coins that are not spendable (i.e. locked).
func (m *ContinuousVestingAccount) Marshal() (dAtA []byte, err error)
func (m *ContinuousVestingAccount) MarshalTo(dAtA []byte) (int, error)
func (m *ContinuousVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (cva ContinuousVestingAccount) MarshalYAML() (interface{}, error)
MarshalYAML returns the YAML representation of a ContinuousVestingAccount.
func (*ContinuousVestingAccount) ProtoMessage()
func (m *ContinuousVestingAccount) Reset()
func (m *ContinuousVestingAccount) Size() (n int)
func (cva ContinuousVestingAccount) String() string
func (cva *ContinuousVestingAccount) 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 (m *ContinuousVestingAccount) Unmarshal(dAtA []byte) error
func (cva ContinuousVestingAccount) Validate() error
Validate checks for errors on the account fields
func (m *ContinuousVestingAccount) XXX_DiscardUnknown()
func (m *ContinuousVestingAccount) XXX_Merge(src proto.Message)
func (m *ContinuousVestingAccount) XXX_Size() int
func (m *ContinuousVestingAccount) XXX_Unmarshal(b []byte) error
type DelayedVestingAccount struct { *BaseVestingAccount `protobuf:"bytes,1,opt,name=base_vesting_account,json=baseVestingAccount,proto3,embedded=base_vesting_account" json:"base_vesting_account,omitempty"` }
DelayedVestingAccount implements the VestingAccount interface. It vests all coins after a specific time, but non prior. In other words, it keeps them locked until a specified time.
func NewDelayedVestingAccount(baseAcc *authtypes.BaseAccount, originalVesting sdk.Coins, endTime int64) *DelayedVestingAccount
NewDelayedVestingAccount returns a DelayedVestingAccount
func NewDelayedVestingAccountRaw(bva *BaseVestingAccount) *DelayedVestingAccount
NewDelayedVestingAccountRaw creates a new DelayedVestingAccount object from BaseVestingAccount
func (*DelayedVestingAccount) Descriptor() ([]byte, []int)
func (dva DelayedVestingAccount) GetStartTime() int64
GetStartTime returns zero since a delayed vesting account has no start time.
GetVestedCoins returns the total amount of vested coins for a delayed vesting account. All coins are only vested once the schedule has elapsed.
GetVestingCoins returns the total number of vesting coins for a delayed vesting account.
LockedCoins returns the set of coins that are not spendable (i.e. locked).
func (m *DelayedVestingAccount) Marshal() (dAtA []byte, err error)
func (m *DelayedVestingAccount) MarshalTo(dAtA []byte) (int, error)
func (m *DelayedVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*DelayedVestingAccount) ProtoMessage()
func (m *DelayedVestingAccount) Reset()
func (m *DelayedVestingAccount) Size() (n int)
func (dva DelayedVestingAccount) String() string
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 (m *DelayedVestingAccount) Unmarshal(dAtA []byte) error
func (dva DelayedVestingAccount) Validate() error
Validate checks for errors on the account fields
func (m *DelayedVestingAccount) XXX_DiscardUnknown()
func (m *DelayedVestingAccount) XXX_Merge(src proto.Message)
func (m *DelayedVestingAccount) XXX_Size() int
func (m *DelayedVestingAccount) XXX_Unmarshal(b []byte) error
type MsgClient interface { // CreateVestingAccount defines a method that enables creating a vesting // account. CreateVestingAccount(ctx context.Context, in *MsgCreateVestingAccount, opts ...grpc.CallOption) (*MsgCreateVestingAccountResponse, error) }
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(cc grpc1.ClientConn) MsgClient
type MsgCreateVestingAccount struct { FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty" yaml:"from_address"` ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty" yaml:"to_address"` 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"` EndTime int64 `protobuf:"varint,4,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty" yaml:"end_time"` Delayed bool `protobuf:"varint,5,opt,name=delayed,proto3" json:"delayed,omitempty"` }
MsgCreateVestingAccount defines a message that enables creating a vesting account.
func NewMsgCreateVestingAccount(fromAddr, toAddr sdk.AccAddress, amount sdk.Coins, endTime int64, delayed bool) *MsgCreateVestingAccount
NewMsgCreateVestingAccount returns a reference to a new MsgCreateVestingAccount.
func (*MsgCreateVestingAccount) Descriptor() ([]byte, []int)
func (this *MsgCreateVestingAccount) Equal(that interface{}) bool
func (m *MsgCreateVestingAccount) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins
func (m *MsgCreateVestingAccount) GetDelayed() bool
func (m *MsgCreateVestingAccount) GetEndTime() int64
func (m *MsgCreateVestingAccount) GetFromAddress() string
func (msg MsgCreateVestingAccount) GetSignBytes() []byte
GetSignBytes returns the bytes all expected signers must sign over for a MsgCreateVestingAccount.
func (msg MsgCreateVestingAccount) GetSigners() []sdk.AccAddress
GetSigners returns the expected signers for a MsgCreateVestingAccount.
func (m *MsgCreateVestingAccount) GetToAddress() string
func (m *MsgCreateVestingAccount) Marshal() (dAtA []byte, err error)
func (m *MsgCreateVestingAccount) MarshalTo(dAtA []byte) (int, error)
func (m *MsgCreateVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgCreateVestingAccount) ProtoMessage()
func (m *MsgCreateVestingAccount) Reset()
func (msg MsgCreateVestingAccount) Route() string
Route returns the message route for a MsgCreateVestingAccount.
func (m *MsgCreateVestingAccount) Size() (n int)
func (m *MsgCreateVestingAccount) String() string
func (msg MsgCreateVestingAccount) Type() string
Type returns the message type for a MsgCreateVestingAccount.
func (m *MsgCreateVestingAccount) Unmarshal(dAtA []byte) error
func (msg MsgCreateVestingAccount) ValidateBasic() error
ValidateBasic Implements Msg.
func (m *MsgCreateVestingAccount) XXX_DiscardUnknown()
func (m *MsgCreateVestingAccount) XXX_Merge(src proto.Message)
func (m *MsgCreateVestingAccount) XXX_Size() int
func (m *MsgCreateVestingAccount) XXX_Unmarshal(b []byte) error
type MsgCreateVestingAccountResponse struct { }
MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type.
func (*MsgCreateVestingAccountResponse) Descriptor() ([]byte, []int)
func (m *MsgCreateVestingAccountResponse) Marshal() (dAtA []byte, err error)
func (m *MsgCreateVestingAccountResponse) MarshalTo(dAtA []byte) (int, error)
func (m *MsgCreateVestingAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgCreateVestingAccountResponse) ProtoMessage()
func (m *MsgCreateVestingAccountResponse) Reset()
func (m *MsgCreateVestingAccountResponse) Size() (n int)
func (m *MsgCreateVestingAccountResponse) String() string
func (m *MsgCreateVestingAccountResponse) Unmarshal(dAtA []byte) error
func (m *MsgCreateVestingAccountResponse) XXX_DiscardUnknown()
func (m *MsgCreateVestingAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *MsgCreateVestingAccountResponse) XXX_Merge(src proto.Message)
func (m *MsgCreateVestingAccountResponse) XXX_Size() int
func (m *MsgCreateVestingAccountResponse) XXX_Unmarshal(b []byte) error
type MsgServer interface { // CreateVestingAccount defines a method that enables creating a vesting // account. CreateVestingAccount(context.Context, *MsgCreateVestingAccount) (*MsgCreateVestingAccountResponse, error) }
MsgServer is the server API for Msg service.
type Period struct { Length int64 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"` Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` }
Period defines a length of time and amount of coins that will vest.
func (m *Period) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins
String Period implements stringer interface
type PeriodicVestingAccount struct { *BaseVestingAccount `protobuf:"bytes,1,opt,name=base_vesting_account,json=baseVestingAccount,proto3,embedded=base_vesting_account" json:"base_vesting_account,omitempty"` StartTime int64 `protobuf:"varint,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty" yaml:"start_time"` VestingPeriods []Period `protobuf:"bytes,3,rep,name=vesting_periods,json=vestingPeriods,proto3" json:"vesting_periods" yaml:"vesting_periods"` }
PeriodicVestingAccount implements the VestingAccount interface. It periodically vests by unlocking coins during each specified period.
func NewPeriodicVestingAccount(baseAcc *authtypes.BaseAccount, originalVesting sdk.Coins, startTime int64, periods Periods) *PeriodicVestingAccount
NewPeriodicVestingAccount returns a new PeriodicVestingAccount
func NewPeriodicVestingAccountRaw(bva *BaseVestingAccount, startTime int64, periods Periods) *PeriodicVestingAccount
NewPeriodicVestingAccountRaw creates a new PeriodicVestingAccount object from BaseVestingAccount
func (*PeriodicVestingAccount) Descriptor() ([]byte, []int)
func (pva PeriodicVestingAccount) GetStartTime() int64
GetStartTime returns the time when vesting starts for a periodic vesting account.
GetVestedCoins returns the total number of vested coins. If no coins are vested, nil is returned.
GetVestingCoins returns the total number of vesting coins. If no coins are vesting, nil is returned.
func (pva PeriodicVestingAccount) GetVestingPeriods() Periods
GetVestingPeriods returns vesting periods associated with periodic vesting account.
LockedCoins returns the set of coins that are not spendable (i.e. locked).
func (m *PeriodicVestingAccount) Marshal() (dAtA []byte, err error)
func (m *PeriodicVestingAccount) MarshalTo(dAtA []byte) (int, error)
func (m *PeriodicVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (pva PeriodicVestingAccount) MarshalYAML() (interface{}, error)
MarshalYAML returns the YAML representation of a PeriodicVestingAccount.
func (*PeriodicVestingAccount) ProtoMessage()
func (m *PeriodicVestingAccount) Reset()
func (m *PeriodicVestingAccount) Size() (n int)
func (pva PeriodicVestingAccount) String() string
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 (m *PeriodicVestingAccount) Unmarshal(dAtA []byte) error
func (pva PeriodicVestingAccount) Validate() error
Validate checks for errors on the account fields
func (m *PeriodicVestingAccount) XXX_DiscardUnknown()
func (m *PeriodicVestingAccount) XXX_Merge(src proto.Message)
func (m *PeriodicVestingAccount) XXX_Size() int
func (m *PeriodicVestingAccount) XXX_Unmarshal(b []byte) error
Periods stores all vesting periods passed as part of a PeriodicVestingAccount
String Periods implements stringer interface
type UnimplementedMsgServer struct { }
UnimplementedMsgServer can be embedded to have forward compatible implementations.
func (*UnimplementedMsgServer) CreateVestingAccount(ctx context.Context, req *MsgCreateVestingAccount) (*MsgCreateVestingAccountResponse, error)
Package types imports 25 packages (graph) and is imported by 18 packages. Updated 2021-01-27. Refresh now. Tools for package owners.