keeper

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamTable for service module

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, sk types.SupplyKeeper, gk types.GuardianKeeper, paramSpace params.Subspace) Keeper

func (Keeper) ActiveAllRequestQueueIterator

func (k Keeper) ActiveAllRequestQueueIterator(ctx sdk.Context) sdk.Iterator

ActiveAllRequestQueueIterator returns an iterator for all the requests in the active queue

func (Keeper) ActiveBindRequestsIterator

func (k Keeper) ActiveBindRequestsIterator(ctx sdk.Context, defChainID, defName, bindChainID string, provider sdk.AccAddress) sdk.Iterator

Returns an iterator for all the request in the Active Queue of specified service binding

func (Keeper) ActiveRequestQueueIterator

func (k Keeper) ActiveRequestQueueIterator(ctx sdk.Context, height int64) sdk.Iterator

Returns an iterator for all the request in the Active Queue that expire by block height

func (Keeper) AddActiveRequest

func (k Keeper) AddActiveRequest(ctx sdk.Context, req types.SvcRequest)

func (Keeper) AddIncomingFee

func (k Keeper) AddIncomingFee(ctx sdk.Context, address sdk.AccAddress, coins sdk.Coins) error

Add incoming fee for a particular provider, if it is not existed will create a new

func (Keeper) AddMethods

func (k Keeper) AddMethods(ctx sdk.Context, svcDef types.SvcDef) error

TODO

func (Keeper) AddRequest

func (k Keeper) AddRequest(
	ctx sdk.Context,
	defChainID,
	defName,
	bindChainID,
	reqChainID string,
	consumer,
	provider sdk.AccAddress,
	methodID int16,
	input []byte,
	serviceFee sdk.Coins,
	profiling bool,
) (req types.SvcRequest, err error)

func (Keeper) AddRequestExpiration

func (k Keeper) AddRequestExpiration(ctx sdk.Context, req types.SvcRequest)

func (Keeper) AddResponse

func (k Keeper) AddResponse(
	ctx sdk.Context,
	reqChainID string,
	requestID string,
	provider sdk.AccAddress,
	output,
	errorMsg []byte,
) (resp types.SvcResponse, err error)

func (Keeper) AddReturnFee

func (k Keeper) AddReturnFee(ctx sdk.Context, address sdk.AccAddress, coins sdk.Coins)

Add return fee for a particular consumer, if it is not existed will create a new

func (Keeper) AddServiceBinding

func (k Keeper) AddServiceBinding(
	ctx sdk.Context,
	defChainID,
	defName,
	bindChainID string,
	provider sdk.AccAddress,
	bindingType types.BindingType,
	deposit sdk.Coins,
	prices []sdk.Coin,
	level types.Level,
) error

func (Keeper) AddServiceDefinition

func (k Keeper) AddServiceDefinition(
	ctx sdk.Context,
	name,
	chainId,
	description string,
	tags []string,
	author sdk.AccAddress,
	authorDescription,
	idlContent string,
) error

func (Keeper) AllIncomingFeesIterator

func (k Keeper) AllIncomingFeesIterator(ctx sdk.Context) sdk.Iterator

AllIncomingFeesIterator returns an iterator for all the incoming fees

func (Keeper) AllReturnedFeesIterator

func (k Keeper) AllReturnedFeesIterator(ctx sdk.Context) sdk.Iterator

AllReturnedFeesIterator returns an iterator for all the returned fees

func (Keeper) AllServiceBindingsIterator

func (k Keeper) AllServiceBindingsIterator(ctx sdk.Context) sdk.Iterator

AllServiceBindingsIterator returns an iterator for all the binding services

func (Keeper) ArbitrationTimeLimit

func (k Keeper) ArbitrationTimeLimit(ctx sdk.Context) (res time.Duration)

ArbitrationTimeLimit returns the arbitration time limit

func (Keeper) ComplaintRetrospect

func (k Keeper) ComplaintRetrospect(ctx sdk.Context) (res time.Duration)

ComplaintRetrospect returns the complaint retrospect duration

func (Keeper) DeleteActiveRequest

func (k Keeper) DeleteActiveRequest(ctx sdk.Context, req types.SvcRequest)

func (Keeper) DeleteIncomingFee

func (k Keeper) DeleteIncomingFee(ctx sdk.Context, address sdk.AccAddress)

func (Keeper) DeleteRequestExpiration

func (k Keeper) DeleteRequestExpiration(ctx sdk.Context, req types.SvcRequest)

func (Keeper) DeleteReturnFee

func (k Keeper) DeleteReturnFee(ctx sdk.Context, address sdk.AccAddress)

func (Keeper) Disable

func (k Keeper) Disable(ctx sdk.Context, defChainID, defName, bindChainID string, provider sdk.AccAddress) error

func (Keeper) Enable

func (k Keeper) Enable(ctx sdk.Context, defChainID, defName, bindChainID string, provider sdk.AccAddress, deposit sdk.Coins) error

func (Keeper) GetActiveRequest

func (k Keeper) GetActiveRequest(ctx sdk.Context, expHeight, reqHeight int64, counter int16) (req types.SvcRequest, found bool)

func (Keeper) GetCdc

func (k Keeper) GetCdc() *codec.Codec

GetCdc returns the cdc

func (Keeper) GetIncomingFee

func (k Keeper) GetIncomingFee(ctx sdk.Context, address sdk.AccAddress) (fee types.IncomingFee, found bool)

func (Keeper) GetIntraTxCounter

func (k Keeper) GetIntraTxCounter(ctx sdk.Context) int16

get the current in-block request operation counter

func (Keeper) GetMethod

func (k Keeper) GetMethod(ctx sdk.Context, chainId, svcName string, id int16) (method types.MethodProperty, found bool)

Gets the method in a specific service and methodID

func (Keeper) GetMethods

func (k Keeper) GetMethods(ctx sdk.Context, chainId, svcName string) sdk.Iterator

Gets all the methods in a specific service

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

GetParams gets all parameteras as types.Params

func (Keeper) GetResponse

func (k Keeper) GetResponse(ctx sdk.Context, reqChainID string, eHeight, rHeight int64, counter int16) (resp types.SvcResponse, found bool)

func (Keeper) GetReturnFee

func (k Keeper) GetReturnFee(ctx sdk.Context, address sdk.AccAddress) (fee types.ReturnedFee, found bool)

func (Keeper) GetServiceBinding

func (k Keeper) GetServiceBinding(ctx sdk.Context, defChainID, defName, bindChainID string, provider sdk.AccAddress) (svcBinding types.SvcBinding, found bool)

func (Keeper) GetServiceDefinition

func (k Keeper) GetServiceDefinition(ctx sdk.Context, chainId, name string) (svcDef types.SvcDef, found bool)

func (Keeper) GetServiceDepositAccount

func (k Keeper) GetServiceDepositAccount(ctx sdk.Context) exported.ModuleAccountI

GetServiceDepositAccount returns the service depost ModuleAccount

func (Keeper) GetServiceRequestAccount

func (k Keeper) GetServiceRequestAccount(ctx sdk.Context) exported.ModuleAccountI

GetServiceRequestAccount returns the service request ModuleAccount

func (Keeper) GetServiceTaxAccount

func (k Keeper) GetServiceTaxAccount(ctx sdk.Context) exported.ModuleAccountI

GetServiceTaxAccount returns the service tax ModuleAccount

func (Keeper) InitMetrics

func (k Keeper) InitMetrics(ctx sdk.Context)

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) MaxRequestTimeout

func (k Keeper) MaxRequestTimeout(ctx sdk.Context) (res int64)

MaxRequestTimeout returns the maximal request timeout

func (Keeper) MinDepositMultiple

func (k Keeper) MinDepositMultiple(ctx sdk.Context) (res int64)

MinDepositMultiple returns the minimal deposit multiple

func (Keeper) RefundDeposit

func (k Keeper) RefundDeposit(ctx sdk.Context, defChainID, defName, bindChainID string, provider sdk.AccAddress) error

func (Keeper) RefundDeposits

func (k Keeper) RefundDeposits(ctx sdk.Context) error

RefundDeposits refunds the deposits of all the binding services

func (Keeper) RefundFee

func (k Keeper) RefundFee(ctx sdk.Context, address sdk.AccAddress) error

refund fees from a particular consumer, and delete it

func (Keeper) RefundIncomingFees

func (k Keeper) RefundIncomingFees(ctx sdk.Context) error

RefundIncomingFees refunds all the incoming fees

func (Keeper) RefundReturnedFees

func (k Keeper) RefundReturnedFees(ctx sdk.Context) error

RefundReturnedFees refunds all the returned fees

func (Keeper) RefundServiceFees

func (k Keeper) RefundServiceFees(ctx sdk.Context) error

RefundServiceFees refunds the service fees of all the active requests

func (Keeper) ServiceBindingsIterator

func (k Keeper) ServiceBindingsIterator(ctx sdk.Context, defChainID, defName string) sdk.Iterator

func (Keeper) ServiceFeeTax

func (k Keeper) ServiceFeeTax(ctx sdk.Context) (res sdk.Dec)

ServiceFeeTax returns the service fee tax

func (Keeper) SetIncomingFee

func (k Keeper) SetIncomingFee(ctx sdk.Context, address sdk.AccAddress, coins sdk.Coins)

func (Keeper) SetIntraTxCounter

func (k Keeper) SetIntraTxCounter(ctx sdk.Context, counter int16)

set the current in-block request counter

func (Keeper) SetMethod

func (k Keeper) SetMethod(ctx sdk.Context, chainId, svcName string, method types.MethodProperty)

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the params to the store

func (Keeper) SetRequest

func (k Keeper) SetRequest(ctx sdk.Context, req types.SvcRequest)

func (Keeper) SetResponse

func (k Keeper) SetResponse(ctx sdk.Context, resp types.SvcResponse)

func (Keeper) SetReturnFee

func (k Keeper) SetReturnFee(ctx sdk.Context, address sdk.AccAddress, coins sdk.Coins)

func (Keeper) SetServiceBinding

func (k Keeper) SetServiceBinding(ctx sdk.Context, svcBinding types.SvcBinding)

func (Keeper) SetServiceDefinition

func (k Keeper) SetServiceDefinition(ctx sdk.Context, svcDef types.SvcDef)

func (Keeper) Slash

func (k Keeper) Slash(ctx sdk.Context, binding types.SvcBinding, slashCoins sdk.Coins) error

func (Keeper) SlashFraction

func (k Keeper) SlashFraction(ctx sdk.Context) (res sdk.Dec)

SlashFraction returns the slashing fraction

func (Keeper) TxSizeLimit

func (k Keeper) TxSizeLimit(ctx sdk.Context) (res uint64)

TxSizeLimit returns the tx size limit

func (Keeper) UpdateServiceBinding

func (k Keeper) UpdateServiceBinding(
	ctx sdk.Context,
	defChainID,
	defName,
	bindChainID string,
	provider sdk.AccAddress,
	bindingType types.BindingType,
	deposit sdk.Coins,
	prices []sdk.Coin,
	level types.Level,
) (svcBinding types.SvcBinding, err error)

func (Keeper) WithdrawFee

func (k Keeper) WithdrawFee(ctx sdk.Context, address sdk.AccAddress) error

withdraw fees from a particular provider, and delete it

func (Keeper) WithdrawTax

func (k Keeper) WithdrawTax(ctx sdk.Context, trustee sdk.AccAddress, destAddress sdk.AccAddress, amt sdk.Coins) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL