Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper, sk stakingkeeper.Keeper) types.MsgServer
- type KVStore
- func (k KVStore) ActiveContract(goCtx context.Context, req *types.QueryActiveContractRequest) (*types.QueryActiveContractResponse, error)
- func (k KVStore) AddCoins(ctx cosmos.Context, addr cosmos.AccAddress, coins cosmos.Coins) error
- func (k KVStore) AllocateTokensToValidator(ctx context.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins) error
- func (k KVStore) BurnCoins(ctx context.Context, moduleName string, coins sdk.Coins) error
- func (k KVStore) BurnFromModule(ctx cosmos.Context, module string, coin cosmos.Coin) error
- func (k KVStore) Cdc() codec.BinaryCodec
- func (k KVStore) ContractAll(c context.Context, req *types.QueryAllContractRequest) (*types.QueryAllContractResponse, error)
- func (k KVStore) ContractExists(ctx cosmos.Context, id uint64) bool
- func (k KVStore) FetchContract(c context.Context, req *types.QueryFetchContractRequest) (*types.QueryFetchContractResponse, error)
- func (k KVStore) FetchProvider(c context.Context, req *types.QueryFetchProviderRequest) (*types.QueryFetchProviderResponse, error)
- func (k KVStore) GetAccount(ctx cosmos.Context, addr cosmos.AccAddress) cosmos.Account
- func (k KVStore) GetActiveContractForUser(ctx cosmos.Context, user, provider common.PubKey, service common.Service) (types.Contract, error)
- func (k KVStore) GetActiveValidators(ctx cosmos.Context) ([]stakingtypes.Validator, error)
- func (kvStore KVStore) GetAndIncrementNextContractId(ctx cosmos.Context) uint64
- func (k KVStore) GetAuthority() string
- func (k KVStore) GetBalance(ctx cosmos.Context, addr cosmos.AccAddress) cosmos.Coins
- func (k KVStore) GetBalanceOfModule(ctx cosmos.Context, moduleName, denom string) cosmos.Int
- func (k KVStore) GetCommunityPool(ctx context.Context) (disttypes.FeePool, error)
- func (k KVStore) GetComputedVersion(ctx cosmos.Context) int64
- func (k KVStore) GetContract(ctx cosmos.Context, id uint64) (types.Contract, error)
- func (k KVStore) GetContractExpirationSet(ctx cosmos.Context, height int64) (types.ContractExpirationSet, error)
- func (k KVStore) GetContractExpirationSetIterator(ctx cosmos.Context) cosmos.Iterator
- func (k KVStore) GetContractIterator(ctx cosmos.Context) cosmos.Iterator
- func (k KVStore) GetContractKey(ctx cosmos.Context, id uint64) string
- func (k KVStore) GetKey(ctx cosmos.Context, prefix dbPrefix, key string) string
- func (k KVStore) GetModuleAccAddress(module string) cosmos.AccAddress
- func (k KVStore) GetModuleAddress(module string) (cosmos.AccAddress, error)
- func (kvStore KVStore) GetNextContractId(ctx cosmos.Context) uint64
- func (k KVStore) GetParams(ctx sdk.Context) types.Params
- func (k KVStore) GetProvider(ctx cosmos.Context, pubkey common.PubKey, service common.Service) (types.Provider, error)
- func (k KVStore) GetProviderIterator(ctx cosmos.Context) cosmos.Iterator
- func (k KVStore) GetSupply(ctx cosmos.Context, denom string) cosmos.Coin
- func (k KVStore) GetUserContractSet(ctx cosmos.Context, user common.PubKey) (types.UserContractSet, error)
- func (k KVStore) GetUserContractSetIterator(ctx cosmos.Context) cosmos.Iterator
- func (k KVStore) GetValidatorRewards(ctx context.Context, val sdk.ValAddress) (disttypes.ValidatorOutstandingRewards, error)
- func (k KVStore) GetVersion(ctx cosmos.Context) int64
- func (k KVStore) GetVersionForAddress(ctx cosmos.Context, addr cosmos.ValAddress) int64
- func (k KVStore) HasCoins(ctx cosmos.Context, addr cosmos.AccAddress, coins cosmos.Coins) bool
- func (k KVStore) Logger() log.Logger
- func (k KVStore) MintAndSendToAccount(ctx cosmos.Context, to cosmos.AccAddress, coin cosmos.Coin) error
- func (k KVStore) MintToModule(ctx cosmos.Context, module string, coin cosmos.Coin) error
- func (k KVStore) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k KVStore) ProviderAll(c context.Context, req *types.QueryAllProviderRequest) (*types.QueryAllProviderResponse, error)
- func (k KVStore) ProviderExists(ctx cosmos.Context, pubkey common.PubKey, service common.Service) bool
- func (k KVStore) RemoveContract(ctx cosmos.Context, id uint64)
- func (k KVStore) RemoveContractExpirationSet(ctx cosmos.Context, height int64)
- func (k KVStore) RemoveFromUserContractSet(ctx cosmos.Context, user common.PubKey, contractId uint64) error
- func (k KVStore) RemoveProvider(ctx cosmos.Context, pubkey common.PubKey, service common.Service)
- func (k KVStore) SendCoins(ctx cosmos.Context, from, to cosmos.AccAddress, coins cosmos.Coins) error
- func (k KVStore) SendFromAccountToModule(ctx cosmos.Context, from cosmos.AccAddress, to string, coins cosmos.Coins) error
- func (k KVStore) SendFromModuleToAccount(ctx cosmos.Context, from string, to cosmos.AccAddress, coins cosmos.Coins) error
- func (k KVStore) SendFromModuleToModule(ctx cosmos.Context, from, to string, coins cosmos.Coins) error
- func (k KVStore) SendToCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error
- func (k KVStore) SetContract(ctx cosmos.Context, contract types.Contract) error
- func (k KVStore) SetContractExpirationSet(ctx cosmos.Context, record types.ContractExpirationSet) error
- func (k KVStore) SetNextContractId(ctx cosmos.Context, contractId uint64)
- func (k KVStore) SetParams(ctx sdk.Context, params types.Params)
- func (k KVStore) SetProvider(ctx cosmos.Context, provider types.Provider) error
- func (k KVStore) SetUserContractSet(ctx cosmos.Context, contractSet types.UserContractSet) error
- func (k KVStore) SetVersion(ctx cosmos.Context, value int64)
- func (k KVStore) SetVersionForAddress(ctx cosmos.Context, addr cosmos.ValAddress, value int64)
- func (k KVStore) StakingSetParams(ctx cosmos.Context, params stakingtypes.Params) error
- type KVStoreDummy
- func (k KVStoreDummy) AccountKeeper() authkeeper.AccountKeeper
- func (k KVStoreDummy) AddCoins(ctx cosmos.Context, _ cosmos.AccAddress, coins cosmos.Coins) error
- func (k KVStoreDummy) BurnFromModule(ctx cosmos.Context, module string, coin cosmos.Coin) error
- func (k KVStoreDummy) Cdc() codec.BinaryCodec
- func (k KVStoreDummy) CoinKeeper() bankkeeper.Keeper
- func (k KVStoreDummy) ContractAll(c context.Context, req *types.QueryAllContractRequest) (*types.QueryAllContractResponse, error)
- func (k KVStoreDummy) ContractExists(_ cosmos.Context, _ common.PubKey, _ common.Service, _ common.PubKey) bool
- func (k KVStoreDummy) FetchContract(c context.Context, req *types.QueryFetchContractRequest) (*types.QueryFetchContractResponse, error)
- func (k KVStoreDummy) FetchProvider(c context.Context, req *types.QueryFetchProviderRequest) (*types.QueryFetchProviderResponse, error)
- func (k KVStoreDummy) GetAccount(ctx cosmos.Context, addr cosmos.AccAddress) cosmos.Account
- func (k KVStoreDummy) GetActiveValidators(ctx cosmos.Context) []stakingtypes.Validator
- func (k KVStoreDummy) GetBalance(ctx cosmos.Context, addr cosmos.AccAddress) cosmos.Coins
- func (k KVStoreDummy) GetBalanceOfModule(ctx cosmos.Context, moduleName, denom string) cosmos.Int
- func (k KVStoreDummy) GetContract(_ cosmos.Context, _ common.PubKey, _ common.Service, _ common.PubKey) (types.Contract, error)
- func (k KVStoreDummy) GetContractExpirationSet(_ cosmos.Context, _ int64) (types.ContractExpirationSet, error)
- func (k KVStoreDummy) GetContractExpirationSetIterator(_ cosmos.Context) cosmos.Iterator
- func (k KVStoreDummy) GetContractIterator(_ cosmos.Context) cosmos.Iterator
- func (k KVStoreDummy) GetKey(_ cosmos.Context, prefix dbPrefix, key string) string
- func (k KVStoreDummy) GetModuleAccAddress(module string) cosmos.AccAddress
- func (k KVStoreDummy) GetModuleAddress(module string) cosmos.AccAddress
- func (k KVStoreDummy) GetParams(ctx sdk.Context) types.Params
- func (k KVStoreDummy) GetProvider(_ cosmos.Context, _ common.PubKey, _ common.Service) (types.Provider, error)
- func (k KVStoreDummy) GetProviderIterator(_ cosmos.Context) cosmos.Iterator
- func (k KVStoreDummy) GetRuneBalanceOfModule(ctx cosmos.Context, moduleName string) cosmos.Int
- func (k KVStoreDummy) GetVersion(ctx cosmos.Context) int64
- func (k KVStoreDummy) HasCoins(ctx cosmos.Context, addr cosmos.AccAddress, coins cosmos.Coins) bool
- func (k KVStoreDummy) Logger(ctx cosmos.Context) log.Logger
- func (k KVStoreDummy) MintAndSendToAccount(ctx cosmos.Context, to cosmos.AccAddress, coin cosmos.Coin) error
- func (k KVStoreDummy) MintToModule(ctx cosmos.Context, module string, coin cosmos.Coin) error
- func (k KVStoreDummy) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k KVStoreDummy) ProviderAll(c context.Context, req *types.QueryAllProviderRequest) (*types.QueryAllProviderResponse, error)
- func (k KVStoreDummy) ProviderExists(_ cosmos.Context, _ common.PubKey, _ common.Service) bool
- func (k KVStoreDummy) RemoveContract(_ cosmos.Context, _ common.PubKey, _ common.Service, _ common.PubKey)
- func (k KVStoreDummy) RemoveContractExpirationSet(_ cosmos.Context, _ int64)
- func (k KVStoreDummy) RemoveProvider(_ cosmos.Context, _ common.PubKey, _ common.Service)
- func (k KVStoreDummy) SendCoins(ctx cosmos.Context, from, to cosmos.AccAddress, coins cosmos.Coins) error
- func (k KVStoreDummy) SendFromAccountToModule(ctx cosmos.Context, from cosmos.AccAddress, to string, coins cosmos.Coins) error
- func (k KVStoreDummy) SendFromModuleToAccount(ctx cosmos.Context, from string, to cosmos.AccAddress, coins cosmos.Coins) error
- func (k KVStoreDummy) SendFromModuleToModule(ctx cosmos.Context, from, to string, coins cosmos.Coins) error
- func (k KVStoreDummy) SetContract(_ cosmos.Context, _ types.Contract) error
- func (k KVStoreDummy) SetContractExpirationSet(_ cosmos.Context, _ types.ContractExpirationSet) error
- func (k KVStoreDummy) SetParams(ctx sdk.Context, params types.Params)
- func (k KVStoreDummy) SetProvider(_ cosmos.Context, _ types.Provider) error
- func (k KVStoreDummy) SetVersion(ctx cosmos.Context, ver int64)
- func (k KVStoreDummy) StakingSetParams(ctx cosmos.Context, params stakingtypes.Params)
- type Keeper
- type KeeperContract
- type KeeperProvider
- type Manager
- func (mgr *Manager) BeginBlock(ctx cosmos.Context) error
- func (mgr Manager) Configs(ctx cosmos.Context) configs.ConfigValues
- func (mgr Manager) ContractEndBlock(ctx cosmos.Context) error
- func (mgr Manager) EmitContractSettlementEvent(ctx cosmos.Context, debt, valIncome cosmos.Int, contract *types.Contract) error
- func (mgr Manager) EmitValidatorPayoutEvent(ctx cosmos.Context, acc cosmos.AccAddress, rwd cosmos.Int) error
- func (mgr Manager) EndBlock(ctx cosmos.Context) error
- func (mgr Manager) FetchConfig(ctx cosmos.Context, name configs.ConfigName) int64
- func (mgr Manager) SettleContract(ctx cosmos.Context, contract types.Contract, nonce int64, isFinal bool) (types.Contract, error)
- func (mgr Manager) ValidatorPayout(ctx cosmos.Context, votes []abci.VoteInfo, blockReward sdk.DecCoin) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
func NewMsgServerImpl(keeper Keeper, sk stakingkeeper.Keeper) types.MsgServer
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type KVStore ¶
type KVStore struct {
// contains filtered or unexported fields
}
func NewKVStore ¶
func NewKVStore( cdc codec.BinaryCodec, storeKey, memKey storetypes.StoreKey, ps paramtypes.Subspace, coinKeeper bankkeeper.Keeper, accountKeeper authkeeper.AccountKeeper, stakingKeeper stakingkeeper.Keeper, authority string, logger log.Logger, mintKeeper minttypes.Keeper, distributionKeeper distkeeper.Keeper, ) *KVStore
func (KVStore) ActiveContract ¶
func (k KVStore) ActiveContract(goCtx context.Context, req *types.QueryActiveContractRequest) (*types.QueryActiveContractResponse, error)
func (KVStore) AllocateTokensToValidator ¶
func (k KVStore) AllocateTokensToValidator(ctx context.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins) error
func (KVStore) BurnFromModule ¶
func (KVStore) ContractAll ¶
func (k KVStore) ContractAll(c context.Context, req *types.QueryAllContractRequest) (*types.QueryAllContractResponse, error)
func (KVStore) ContractExists ¶
ContractExists check whether the given contract exist in the data store
func (KVStore) FetchContract ¶
func (k KVStore) FetchContract(c context.Context, req *types.QueryFetchContractRequest) (*types.QueryFetchContractResponse, error)
func (KVStore) FetchProvider ¶
func (k KVStore) FetchProvider(c context.Context, req *types.QueryFetchProviderRequest) (*types.QueryFetchProviderResponse, error)
func (KVStore) GetAccount ¶
func (KVStore) GetActiveContractForUser ¶
func (KVStore) GetActiveValidators ¶
func (KVStore) GetAndIncrementNextContractId ¶
func (KVStore) GetAuthority ¶
func (KVStore) GetBalance ¶
func (KVStore) GetBalanceOfModule ¶
func (KVStore) GetCommunityPool ¶
func (KVStore) GetComputedVersion ¶
TODO: Check Thi Again
func (KVStore) GetContract ¶
GetContract get the entire Contract metadata struct based on given asset
func (KVStore) GetContractExpirationSet ¶
func (k KVStore) GetContractExpirationSet(ctx cosmos.Context, height int64) (types.ContractExpirationSet, error)
GetContractExpirationSet get a series of contract expirations
func (KVStore) GetContractExpirationSetIterator ¶
GetContractExpirationSetIterator iterate contract expiration sets
func (KVStore) GetContractIterator ¶
GetContractIterator iterate contract
func (KVStore) GetContractKey ¶
func (KVStore) GetModuleAccAddress ¶
func (k KVStore) GetModuleAccAddress(module string) cosmos.AccAddress
func (KVStore) GetModuleAddress ¶
func (k KVStore) GetModuleAddress(module string) (cosmos.AccAddress, error)
func (KVStore) GetNextContractId ¶
func (KVStore) GetProvider ¶
func (k KVStore) GetProvider(ctx cosmos.Context, pubkey common.PubKey, service common.Service) (types.Provider, error)
GetProvider get the entire Provider metadata struct based on given asset
func (KVStore) GetProviderIterator ¶
GetProviderIterator iterate providers
func (KVStore) GetUserContractSet ¶
func (KVStore) GetUserContractSetIterator ¶
func (KVStore) GetValidatorRewards ¶
func (k KVStore) GetValidatorRewards(ctx context.Context, val sdk.ValAddress) (disttypes.ValidatorOutstandingRewards, error)
for testing purpose
func (KVStore) GetVersion ¶
GetVersion get the current key value store version
func (KVStore) GetVersionForAddress ¶
GetVersionForAddress get the current key value store version
func (KVStore) MintAndSendToAccount ¶
func (KVStore) MintToModule ¶
func (KVStore) Params ¶
func (k KVStore) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (KVStore) ProviderAll ¶
func (k KVStore) ProviderAll(c context.Context, req *types.QueryAllProviderRequest) (*types.QueryAllProviderResponse, error)
func (KVStore) ProviderExists ¶
func (k KVStore) ProviderExists(ctx cosmos.Context, pubkey common.PubKey, service common.Service) bool
ProviderExists check whether the given provider exist in the data store
func (KVStore) RemoveContractExpirationSet ¶
func (KVStore) RemoveFromUserContractSet ¶
func (k KVStore) RemoveFromUserContractSet(ctx cosmos.Context, user common.PubKey, contractId uint64) error
RemoveFromUserContractSet remove a contract from a user's contract set and saves the updated set to the store
func (KVStore) RemoveProvider ¶
func (KVStore) SendFromAccountToModule ¶
func (k KVStore) SendFromAccountToModule(ctx cosmos.Context, from cosmos.AccAddress, to string, coins cosmos.Coins) error
SendFromAccountToModule transfer fund from one account to a module
func (KVStore) SendFromModuleToAccount ¶
func (k KVStore) SendFromModuleToAccount(ctx cosmos.Context, from string, to cosmos.AccAddress, coins cosmos.Coins) error
SendFromModuleToAccount transfer fund from module to an account
func (KVStore) SendFromModuleToModule ¶
func (k KVStore) SendFromModuleToModule(ctx cosmos.Context, from, to string, coins cosmos.Coins) error
SendFromModuleToModule transfer asset from one module to another
func (KVStore) SendToCommunityPool ¶
func (KVStore) SetContract ¶
SetContract save the entire Contract metadata struct to key value store
func (KVStore) SetContractExpirationSet ¶
func (k KVStore) SetContractExpirationSet(ctx cosmos.Context, record types.ContractExpirationSet) error
SetContractExpirationSet save the series of Contract Expirations
func (KVStore) SetNextContractId ¶
func (KVStore) SetProvider ¶
SetProvider save the entire Provider metadata struct to key value store
func (KVStore) SetUserContractSet ¶
func (KVStore) SetVersion ¶
SetVersion save the store version
func (KVStore) SetVersionForAddress ¶
SetVersionForAddress save the store version
func (KVStore) StakingSetParams ¶
type KVStoreDummy ¶
type KVStoreDummy struct{}
func (KVStoreDummy) AccountKeeper ¶
func (k KVStoreDummy) AccountKeeper() authkeeper.AccountKeeper
func (KVStoreDummy) AddCoins ¶
func (k KVStoreDummy) AddCoins(ctx cosmos.Context, _ cosmos.AccAddress, coins cosmos.Coins) error
func (KVStoreDummy) BurnFromModule ¶
func (KVStoreDummy) Cdc ¶
func (k KVStoreDummy) Cdc() codec.BinaryCodec
func (KVStoreDummy) CoinKeeper ¶
func (k KVStoreDummy) CoinKeeper() bankkeeper.Keeper
func (KVStoreDummy) ContractAll ¶
func (k KVStoreDummy) ContractAll(c context.Context, req *types.QueryAllContractRequest) (*types.QueryAllContractResponse, error)
func (KVStoreDummy) ContractExists ¶
func (KVStoreDummy) FetchContract ¶
func (k KVStoreDummy) FetchContract(c context.Context, req *types.QueryFetchContractRequest) (*types.QueryFetchContractResponse, error)
func (KVStoreDummy) FetchProvider ¶
func (k KVStoreDummy) FetchProvider(c context.Context, req *types.QueryFetchProviderRequest) (*types.QueryFetchProviderResponse, error)
func (KVStoreDummy) GetAccount ¶
func (k KVStoreDummy) GetAccount(ctx cosmos.Context, addr cosmos.AccAddress) cosmos.Account
func (KVStoreDummy) GetActiveValidators ¶
func (k KVStoreDummy) GetActiveValidators(ctx cosmos.Context) []stakingtypes.Validator
func (KVStoreDummy) GetBalance ¶
func (k KVStoreDummy) GetBalance(ctx cosmos.Context, addr cosmos.AccAddress) cosmos.Coins
func (KVStoreDummy) GetBalanceOfModule ¶
func (KVStoreDummy) GetContract ¶
func (KVStoreDummy) GetContractExpirationSet ¶
func (k KVStoreDummy) GetContractExpirationSet(_ cosmos.Context, _ int64) (types.ContractExpirationSet, error)
func (KVStoreDummy) GetContractExpirationSetIterator ¶
func (k KVStoreDummy) GetContractExpirationSetIterator(_ cosmos.Context) cosmos.Iterator
func (KVStoreDummy) GetContractIterator ¶
func (k KVStoreDummy) GetContractIterator(_ cosmos.Context) cosmos.Iterator
func (KVStoreDummy) GetKey ¶
func (k KVStoreDummy) GetKey(_ cosmos.Context, prefix dbPrefix, key string) string
func (KVStoreDummy) GetModuleAccAddress ¶
func (k KVStoreDummy) GetModuleAccAddress(module string) cosmos.AccAddress
func (KVStoreDummy) GetModuleAddress ¶
func (k KVStoreDummy) GetModuleAddress(module string) cosmos.AccAddress
func (KVStoreDummy) GetProvider ¶
func (KVStoreDummy) GetProviderIterator ¶
func (k KVStoreDummy) GetProviderIterator(_ cosmos.Context) cosmos.Iterator
func (KVStoreDummy) GetRuneBalanceOfModule ¶
func (KVStoreDummy) GetVersion ¶
func (k KVStoreDummy) GetVersion(ctx cosmos.Context) int64
func (KVStoreDummy) HasCoins ¶
func (k KVStoreDummy) HasCoins(ctx cosmos.Context, addr cosmos.AccAddress, coins cosmos.Coins) bool
func (KVStoreDummy) MintAndSendToAccount ¶
func (k KVStoreDummy) MintAndSendToAccount(ctx cosmos.Context, to cosmos.AccAddress, coin cosmos.Coin) error
func (KVStoreDummy) MintToModule ¶
func (KVStoreDummy) Params ¶
func (k KVStoreDummy) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (KVStoreDummy) ProviderAll ¶
func (k KVStoreDummy) ProviderAll(c context.Context, req *types.QueryAllProviderRequest) (*types.QueryAllProviderResponse, error)
func (KVStoreDummy) ProviderExists ¶
func (KVStoreDummy) RemoveContract ¶
func (KVStoreDummy) RemoveContractExpirationSet ¶
func (k KVStoreDummy) RemoveContractExpirationSet(_ cosmos.Context, _ int64)
func (KVStoreDummy) RemoveProvider ¶
func (KVStoreDummy) SendCoins ¶
func (k KVStoreDummy) SendCoins(ctx cosmos.Context, from, to cosmos.AccAddress, coins cosmos.Coins) error
func (KVStoreDummy) SendFromAccountToModule ¶
func (k KVStoreDummy) SendFromAccountToModule(ctx cosmos.Context, from cosmos.AccAddress, to string, coins cosmos.Coins) error
func (KVStoreDummy) SendFromModuleToAccount ¶
func (k KVStoreDummy) SendFromModuleToAccount(ctx cosmos.Context, from string, to cosmos.AccAddress, coins cosmos.Coins) error
func (KVStoreDummy) SendFromModuleToModule ¶
func (KVStoreDummy) SetContract ¶
func (KVStoreDummy) SetContractExpirationSet ¶
func (k KVStoreDummy) SetContractExpirationSet(_ cosmos.Context, _ types.ContractExpirationSet) error
func (KVStoreDummy) SetParams ¶
func (k KVStoreDummy) SetParams(ctx sdk.Context, params types.Params)
func (KVStoreDummy) SetProvider ¶
func (KVStoreDummy) SetVersion ¶
func (k KVStoreDummy) SetVersion(ctx cosmos.Context, ver int64)
func (KVStoreDummy) StakingSetParams ¶
func (k KVStoreDummy) StakingSetParams(ctx cosmos.Context, params stakingtypes.Params)
type Keeper ¶
type Keeper interface { Logger() log.Logger GetParams(ctx sdk.Context) types.Params SetParams(ctx sdk.Context, params types.Params) Cdc() codec.BinaryCodec GetComputedVersion(ctx cosmos.Context) int64 GetVersion(ctx cosmos.Context) int64 SetVersion(ctx cosmos.Context, ver int64) GetKey(ctx cosmos.Context, prefix dbPrefix, key string) string GetVersionForAddress(ctx cosmos.Context, _ cosmos.ValAddress) int64 SetVersionForAddress(ctx cosmos.Context, _ cosmos.ValAddress, ver int64) GetSupply(ctx cosmos.Context, denom string) cosmos.Coin GetBalanceOfModule(ctx cosmos.Context, moduleName, denom string) cosmos.Int SendFromModuleToModule(ctx cosmos.Context, from, to string, coin cosmos.Coins) error SendFromAccountToModule(ctx cosmos.Context, from cosmos.AccAddress, to string, _ cosmos.Coins) error SendFromModuleToAccount(ctx cosmos.Context, from string, to cosmos.AccAddress, _ cosmos.Coins) error MintToModule(ctx cosmos.Context, module string, coin cosmos.Coin) error BurnFromModule(ctx cosmos.Context, module string, coin cosmos.Coin) error MintAndSendToAccount(ctx cosmos.Context, to cosmos.AccAddress, coin cosmos.Coin) error GetModuleAccAddress(module string) cosmos.AccAddress GetBalance(ctx cosmos.Context, addr cosmos.AccAddress) cosmos.Coins HasCoins(ctx cosmos.Context, addr cosmos.AccAddress, coins cosmos.Coins) bool // passthrough funcs SendCoins(ctx cosmos.Context, from, to cosmos.AccAddress, coins cosmos.Coins) error AddCoins(ctx cosmos.Context, addr cosmos.AccAddress, coins cosmos.Coins) error GetActiveValidators(ctx cosmos.Context) ([]stakingtypes.Validator, error) GetAccount(ctx cosmos.Context, addr cosmos.AccAddress) cosmos.Account StakingSetParams(ctx cosmos.Context, params stakingtypes.Params) error AllocateTokensToValidator(ctx context.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins) error SendToCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error GetValidatorRewards(ctx context.Context, val sdk.ValAddress) (disttypes.ValidatorOutstandingRewards, error) GetCommunityPool(ctx context.Context) (disttypes.FeePool, error) // Query Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) FetchProvider(c context.Context, req *types.QueryFetchProviderRequest) (*types.QueryFetchProviderResponse, error) ProviderAll(c context.Context, req *types.QueryAllProviderRequest) (*types.QueryAllProviderResponse, error) FetchContract(c context.Context, req *types.QueryFetchContractRequest) (*types.QueryFetchContractResponse, error) ContractAll(c context.Context, req *types.QueryAllContractRequest) (*types.QueryAllContractResponse, error) ActiveContract(goCtx context.Context, req *types.QueryActiveContractRequest) (*types.QueryActiveContractResponse, error) // Keeper Interfaces KeeperProvider KeeperContract }
type KeeperContract ¶
type KeeperContract interface { GetContractIterator(_ cosmos.Context) cosmos.Iterator GetContract(_ cosmos.Context, _ uint64) (types.Contract, error) SetContract(_ cosmos.Context, _ types.Contract) error ContractExists(_ cosmos.Context, _ uint64) bool RemoveContract(_ cosmos.Context, _ uint64) GetContractExpirationSetIterator(_ cosmos.Context) cosmos.Iterator GetUserContractSetIterator(_ cosmos.Context) cosmos.Iterator GetContractExpirationSet(_ cosmos.Context, _ int64) (types.ContractExpirationSet, error) SetContractExpirationSet(_ cosmos.Context, _ types.ContractExpirationSet) error RemoveContractExpirationSet(_ cosmos.Context, _ int64) RemoveFromUserContractSet(ctx cosmos.Context, user common.PubKey, contractId uint64) error GetNextContractId(_ cosmos.Context) uint64 SetNextContractId(ctx cosmos.Context, contractId uint64) GetAndIncrementNextContractId(ctx cosmos.Context) uint64 SetUserContractSet(ctx cosmos.Context, contractSet types.UserContractSet) error GetUserContractSet(ctx cosmos.Context, pubkey common.PubKey) (types.UserContractSet, error) GetActiveContractForUser(ctx cosmos.Context, user, provider common.PubKey, service common.Service) (types.Contract, error) }
type KeeperProvider ¶
type KeeperProvider interface { GetProviderIterator(_ cosmos.Context) cosmos.Iterator GetProvider(_ cosmos.Context, _ common.PubKey, _ common.Service) (types.Provider, error) SetProvider(_ cosmos.Context, _ types.Provider) error ProviderExists(_ cosmos.Context, _ common.PubKey, _ common.Service) bool RemoveProvider(_ cosmos.Context, _ common.PubKey, _ common.Service) }
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(k Keeper, sk stakingkeeper.Keeper) Manager
func (Manager) EmitContractSettlementEvent ¶
func (Manager) EmitValidatorPayoutEvent ¶
func (Manager) FetchConfig ¶
func (Manager) SettleContract ¶
func (mgr Manager) SettleContract(ctx cosmos.Context, contract types.Contract, nonce int64, isFinal bool) (types.Contract, error)
any owed debt is paid to data provider
func (Manager) ValidatorPayout ¶
func (mgr Manager) ValidatorPayout(ctx cosmos.Context, votes []abci.VoteInfo, blockReward sdk.DecCoin) error
This function pays out rewards to validators. TODO: the method of accomplishing this is admittedly quite inefficient. The better approach would be to track live allocation via assigning "units" to validators when they bond and unbond. The math for this is as follows U = total bond units T = tokens bonded t = new tokens being bonded units = U / (T / t) Since the development goal at the moment is to get this chain up and running, we can save this optimization for another day.
Source Files ¶
- contracts.go
- events.go
- grpc_query.go
- grpc_query_contract.go
- grpc_query_params.go
- grpc_query_provider.go
- keeper.go
- keeper_dummy.go
- manager.go
- msg_server.go
- msg_server_bond_provider.go
- msg_server_claim_contract_income.go
- msg_server_close_contract.go
- msg_server_mod_provider.go
- msg_server_open_contract.go
- msg_server_set_version.go
- params.go
- providers.go