keeper

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

NewQuerier creates a new service Querier instance

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamKeyTable for service module

Types

type Keeper

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

Keeper defines the service keeper

func NewKeeper

func NewKeeper(
	cdc codec.Marshaler,
	key sdk.StoreKey,
	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
	tokenKeeper types.TokenKeeper,
	paramstore params.Subspace,
	feeCollectorName string,
) Keeper

NewKeeper creates a new service Keeper instance

func (Keeper) ActiveRequestsIterator

func (k Keeper) ActiveRequestsIterator(ctx sdk.Context, serviceName string, provider sdk.AccAddress) sdk.Iterator

ActiveRequestsIterator returns an iterator for all the active requests of the specified service binding

func (Keeper) ActiveRequestsIteratorByReqCtx

func (k Keeper) ActiveRequestsIteratorByReqCtx(ctx sdk.Context, requestContextID tmbytes.HexBytes, batchCounter uint64) sdk.Iterator

ActiveRequestsIteratorByReqCtx returns an iterator for all the active requests of the specified service binding

func (Keeper) AddActiveRequest

func (k Keeper) AddActiveRequest(
	ctx sdk.Context,
	serviceName string,
	provider sdk.AccAddress,
	expirationHeight int64,
	requestID tmbytes.HexBytes,
)

AddActiveRequest adds the specified active request

func (Keeper) AddActiveRequestByBinding

func (k Keeper) AddActiveRequestByBinding(
	ctx sdk.Context,
	serviceName string,
	provider sdk.AccAddress,
	expirationHeight int64,
	requestID tmbytes.HexBytes,
)

AddActiveRequestByBinding adds the specified active request by the binding

func (Keeper) AddActiveRequestByID

func (k Keeper) AddActiveRequestByID(
	ctx sdk.Context,
	requestID tmbytes.HexBytes,
)

AddActiveRequestByID adds the specified active request by request ID

func (Keeper) AddEarnedFee

func (k Keeper) AddEarnedFee(ctx sdk.Context, provider sdk.AccAddress, fee sdk.Coins) error

AddEarnedFee adds the earned fee for the given provider

func (Keeper) AddNewRequestBatch

func (k Keeper) AddNewRequestBatch(ctx sdk.Context, requestContextID tmbytes.HexBytes, requestBatchHeight int64)

AddNewRequestBatch adds a request batch to the new request batch queue

func (Keeper) AddRequestBatchExpiration

func (k Keeper) AddRequestBatchExpiration(ctx sdk.Context, requestContextID tmbytes.HexBytes, expirationHeight int64)

AddRequestBatchExpiration adds a request batch to the expiration queue

func (Keeper) AddResponse

func (k Keeper) AddResponse(
	ctx sdk.Context,
	requestID tmbytes.HexBytes,
	provider sdk.AccAddress,
	result,
	output string,
) (request types.Request, response types.Response, err error)

AddResponse adds the response for the specified request ID

func (Keeper) AddServiceBinding

func (k Keeper) AddServiceBinding(
	ctx sdk.Context,
	serviceName string,
	provider sdk.AccAddress,
	deposit sdk.Coins,
	pricing string,
	qos uint64,
	owner sdk.AccAddress,
) error

AddServiceBinding creates a new service binding

func (Keeper) AddServiceDefinition

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

AddServiceDefinition creates a new service definition

func (Keeper) AllActiveRequestsIterator

func (k Keeper) AllActiveRequestsIterator(store sdk.KVStore) sdk.Iterator

AllActiveRequestsIterator returns an iterator for all the active requests

func (Keeper) AllEarnedFeesIterator

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

AllEarnedFeesIterator returns an iterator for all the earned fees

func (Keeper) AllServiceBindingsIterator

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

AllServiceBindingsIterator returns an iterator for all bindings

func (Keeper) ArbitrationTimeLimit

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

ArbitrationTimeLimit returns the arbitration time limit

func (Keeper) BaseDenom

func (k Keeper) BaseDenom(ctx sdk.Context) (res string)

BaseDenom returns the base denom of service module

func (Keeper) Callback

func (k Keeper) Callback(ctx sdk.Context, requestContextID tmbytes.HexBytes)

Callback callbacks the corresponding response callback handler

func (Keeper) CheckAuthority

func (k Keeper) CheckAuthority(
	ctx sdk.Context,
	consumer sdk.AccAddress,
	requestContextID tmbytes.HexBytes,
	checkModule bool,
) error

CheckAuthority checks if the operation on the specified request context is authorized

func (Keeper) CleanBatch

func (k Keeper) CleanBatch(ctx sdk.Context, requestContext types.RequestContext, requestContextID tmbytes.HexBytes)

CleanBatch cleans up all requests and responses related to the batch

func (Keeper) ComplaintRetrospect

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

ComplaintRetrospect returns the complaint retrospect duration

func (Keeper) CompleteBatch

func (k Keeper) CompleteBatch(ctx sdk.Context, requestContext types.RequestContext, requestContextID tmbytes.HexBytes,
) types.RequestContext

CompleteBatch completes a running batch

func (Keeper) CompleteServiceContext

func (k Keeper) CompleteServiceContext(ctx sdk.Context, context types.RequestContext, requestContextID tmbytes.HexBytes)

CompleteServiceContext completes a running or paused context

func (Keeper) CreateRequestContext

func (k Keeper) CreateRequestContext(
	ctx sdk.Context,
	serviceName string,
	providers []sdk.AccAddress,
	consumer sdk.AccAddress,
	input string,
	serviceFeeCap sdk.Coins,
	timeout int64,
	superMode bool,
	repeated bool,
	repeatedFrequency uint64,
	repeatedTotal int64,
	state types.RequestContextState,
	responseThreshold uint32,
	moduleName string,
) (tmbytes.HexBytes, error)

CreateRequestContext creates a request context with the specified params

func (Keeper) DeductServiceFees

func (k Keeper) DeductServiceFees(ctx sdk.Context, consumer sdk.AccAddress, serviceFees sdk.Coins) error

DeductServiceFees deducts the given service fees from the specified consumer

func (Keeper) DeleteActiveRequest

func (k Keeper) DeleteActiveRequest(
	ctx sdk.Context,
	serviceName string,
	provider sdk.AccAddress,
	expirationHeight int64,
	requestID tmbytes.HexBytes,
)

DeleteActiveRequest deletes the specified active request

func (Keeper) DeleteActiveRequestByBinding

func (k Keeper) DeleteActiveRequestByBinding(
	ctx sdk.Context,
	serviceName string,
	provider sdk.AccAddress,
	expirationHeight int64,
	requestID tmbytes.HexBytes,
)

DeleteActiveRequestByBinding deletes the specified active request by the binding

func (Keeper) DeleteActiveRequestByID

func (k Keeper) DeleteActiveRequestByID(
	ctx sdk.Context,
	requestID tmbytes.HexBytes,
)

DeleteActiveRequestByID deletes the specified active request by request ID

func (Keeper) DeleteCompactRequest

func (k Keeper) DeleteCompactRequest(ctx sdk.Context, requestID tmbytes.HexBytes)

DeleteCompactRequest deletes the specified compact request

func (Keeper) DeleteEarnedFees

func (k Keeper) DeleteEarnedFees(ctx sdk.Context, provider sdk.AccAddress)

DeleteEarnedFees removes the earned fees of the specified provider

func (Keeper) DeleteNewRequestBatch

func (k Keeper) DeleteNewRequestBatch(ctx sdk.Context, requestContextID tmbytes.HexBytes, requestBatchHeight int64)

DeleteNewRequestBatch deletes the request batch in the given height from the new request batch queue

func (Keeper) DeleteNewRequestBatchHeight

func (k Keeper) DeleteNewRequestBatchHeight(ctx sdk.Context, requestContextID tmbytes.HexBytes)

DeleteNewRequestBatchHeight deletes the new request batch height for the specified request context

func (Keeper) DeleteOwnerEarnedFees

func (k Keeper) DeleteOwnerEarnedFees(ctx sdk.Context, owner sdk.AccAddress)

DeleteOwnerEarnedFees removes the earned fees of the specified owner

func (Keeper) DeleteRequestBatchExpiration

func (k Keeper) DeleteRequestBatchExpiration(ctx sdk.Context, requestContextID tmbytes.HexBytes, expirationHeight int64)

DeleteRequestBatchExpiration deletes the request batch from the expiration queue

func (Keeper) DeleteRequestBatchExpirationHeight

func (k Keeper) DeleteRequestBatchExpirationHeight(ctx sdk.Context, requestContextID tmbytes.HexBytes)

DeleteRequestBatchExpirationHeight deletes the request batch expiration height for the specified request context

func (Keeper) DeleteRequestContext

func (k Keeper) DeleteRequestContext(ctx sdk.Context, requestContextID tmbytes.HexBytes)

DeleteRequestContext deletes the specified request context

func (Keeper) DeleteResponse

func (k Keeper) DeleteResponse(ctx sdk.Context, requestID tmbytes.HexBytes)

DeleteResponse deletes a response with the speicified request ID

func (Keeper) DisableServiceBinding

func (k Keeper) DisableServiceBinding(
	ctx sdk.Context,
	serviceName string,
	provider,
	owner sdk.AccAddress,
) error

DisableServiceBinding disables the specified service binding

func (Keeper) EnableServiceBinding

func (k Keeper) EnableServiceBinding(
	ctx sdk.Context,
	serviceName string,
	provider sdk.AccAddress,
	deposit sdk.Coins,
	owner sdk.AccAddress,
) error

EnableServiceBinding enables the specified service binding

func (Keeper) FilterServiceProviders

func (k Keeper) FilterServiceProviders(
	ctx sdk.Context,
	serviceName string,
	providers []sdk.AccAddress,
	timeout int64,
	serviceFeeCap sdk.Coins,
	consumer sdk.AccAddress,
) ([]sdk.AccAddress, sdk.Coins)

FilterServiceProviders gets the providers which satisfy the specified requirement

func (Keeper) GetCompactRequest

func (k Keeper) GetCompactRequest(ctx sdk.Context, requestID tmbytes.HexBytes) (request types.CompactRequest, found bool)

GetCompactRequest retrieves the specified compact request

func (Keeper) GetEarnedFees

func (k Keeper) GetEarnedFees(ctx sdk.Context, provider sdk.AccAddress) (fees sdk.Coins, found bool)

GetEarnedFees retrieves the earned fees of the specified provider

func (Keeper) GetOwner

func (k Keeper) GetOwner(ctx sdk.Context, provider sdk.AccAddress) (sdk.AccAddress, bool)

GetOwner gets the owner for the specified provider

func (Keeper) GetOwnerEarnedFees

func (k Keeper) GetOwnerEarnedFees(ctx sdk.Context, owner sdk.AccAddress) (fees sdk.Coins, found bool)

GetOwnerEarnedFees retrieves the earned fees of the specified owner

func (Keeper) GetOwnerServiceBindings

func (k Keeper) GetOwnerServiceBindings(ctx sdk.Context, owner sdk.AccAddress, serviceName string) []types.ServiceBinding

GetOwnerServiceBindings retrieves the service bindings with the specified service name and owner

func (Keeper) GetParams

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

GetParams gets all parameteras as types.Params

func (Keeper) GetPrice

func (k Keeper) GetPrice(
	ctx sdk.Context,
	consumer sdk.AccAddress,
	binding types.ServiceBinding,
) sdk.Coins

GetPrice gets the current price for the specified consumer and binding Note: ensure that the binding is valid

func (Keeper) GetPricing

func (k Keeper) GetPricing(ctx sdk.Context, serviceName string, provider sdk.AccAddress) (pricing types.Pricing)

GetPricing retrieves the pricing of the specified service binding

func (Keeper) GetRequest

func (k Keeper) GetRequest(ctx sdk.Context, requestID tmbytes.HexBytes) (request types.Request, found bool)

GetRequest returns the specified request

func (Keeper) GetRequestContext

func (k Keeper) GetRequestContext(ctx sdk.Context, requestContextID tmbytes.HexBytes) (requestContext types.RequestContext, found bool)

GetRequestContext retrieves the specified request context

func (Keeper) GetRequestVolume

func (k Keeper) GetRequestVolume(
	ctx sdk.Context,
	consumer sdk.AccAddress,
	serviceName string,
	provider sdk.AccAddress,
) uint64

GetRequestVolume gets the current request volume for the specified consumer and binding

func (Keeper) GetResponse

func (k Keeper) GetResponse(ctx sdk.Context, requestID tmbytes.HexBytes) (response types.Response, found bool)

GetResponse returns a response with the speicified request ID

func (Keeper) GetResponseCallback

func (k Keeper) GetResponseCallback(moduleName string) (types.ResponseCallback, error)

GetResponseCallback gets the registered module callback for response handling

func (Keeper) GetResponseOutputs

func (k Keeper) GetResponseOutputs(ctx sdk.Context, requestContextID tmbytes.HexBytes, batchCounter uint64) []string

GetResponseOutputs retrieves all response outputs of the specified request context and batch counter

func (Keeper) GetServiceBinding

func (k Keeper) GetServiceBinding(ctx sdk.Context, serviceName string, provider sdk.AccAddress) (svcBinding types.ServiceBinding, found bool)

GetServiceBinding retrieves the specified service binding

func (Keeper) GetServiceDefinition

func (k Keeper) GetServiceDefinition(ctx sdk.Context, serviceName string) (svcDef types.ServiceDefinition, found bool)

GetServiceDefinition retrieves a service definition of the specified service name

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) GetStateCallback

func (k Keeper) GetStateCallback(moduleName string) (types.StateCallback, error)

GetStateCallback gets the registered module callback for state handling

func (Keeper) GetWithdrawAddress

func (k Keeper) GetWithdrawAddress(ctx sdk.Context, owner sdk.AccAddress) sdk.AccAddress

GetWithdrawAddress gets the withdrawal address of the specified owner

func (Keeper) HasNewRequestBatch

func (k Keeper) HasNewRequestBatch(ctx sdk.Context, requestContextID tmbytes.HexBytes) bool

HasNewRequestBatch checks if the new request batch of the specified request context exists

func (Keeper) HasRequestBatchExpiration

func (k Keeper) HasRequestBatchExpiration(ctx sdk.Context, requestContextID tmbytes.HexBytes) bool

HasRequestBatchExpiration checks if the request batch expiration of the specified request context exists

func (Keeper) IncreaseRequestVolume

func (k Keeper) IncreaseRequestVolume(
	ctx sdk.Context,
	consumer sdk.AccAddress,
	serviceName string,
	provider sdk.AccAddress,
)

IncreaseRequestVolume increases the request volume by 1

func (Keeper) InitiateRequests

func (k Keeper) InitiateRequests(
	ctx sdk.Context,
	requestContextID tmbytes.HexBytes,
	providers []sdk.AccAddress,
	providerRequests map[string][]string,
)

InitiateRequests creates requests for the given providers from the specified request context Note: make sure that request context is valid and running, and providers are valid

func (Keeper) IsRequestActive

func (k Keeper) IsRequestActive(
	ctx sdk.Context,
	requestID tmbytes.HexBytes,
) bool

IsRequestActive checks if the specified request is active

func (Keeper) IterateActiveRequests

func (k Keeper) IterateActiveRequests(
	ctx sdk.Context,
	requestContextID tmbytes.HexBytes,
	batchCounter uint64,
	op func(requestID tmbytes.HexBytes, request types.Request),
)

IterateActiveRequests iterates through the active requests for the specified request context ID and batch counter

func (Keeper) IterateExpiredRequestBatch

func (k Keeper) IterateExpiredRequestBatch(
	ctx sdk.Context,
	expirationHeight int64,
	op func(requestContextID tmbytes.HexBytes, requestContext types.RequestContext),
)

IterateExpiredRequestBatch iterates through the expired request batch queue in the specified height

func (Keeper) IterateNewRequestBatch

func (k Keeper) IterateNewRequestBatch(
	ctx sdk.Context,
	requestBatchHeight int64,
	op func(requestContextID tmbytes.HexBytes, requestContext types.RequestContext),
)

IterateNewRequestBatch iterates through the new request batch queue in the specified height

func (Keeper) IterateRequestContexts

func (k Keeper) IterateRequestContexts(
	ctx sdk.Context,
	op func(requestContextID tmbytes.HexBytes, requestContext types.RequestContext) (stop bool),
)

IterateRequestContexts iterates through all request contexts

func (Keeper) IterateRequests

func (k Keeper) IterateRequests(
	ctx sdk.Context,
	op func(requestID tmbytes.HexBytes, request types.CompactRequest) (stop bool),
)

IterateRequests iterates through all compact requests

func (Keeper) IterateResponses

func (k Keeper) IterateResponses(
	ctx sdk.Context,
	op func(requestID tmbytes.HexBytes, response types.Response) (stop bool),
)

IterateResponses iterates through all responses

func (Keeper) IterateServiceBindings

func (k Keeper) IterateServiceBindings(
	ctx sdk.Context,
	op func(binding types.ServiceBinding) (stop bool),
)

func (Keeper) IterateServiceDefinitions

func (k Keeper) IterateServiceDefinitions(
	ctx sdk.Context,
	op func(definition types.ServiceDefinition) (stop bool),
)

IterateServiceDefinitions iterates through all service definitions

func (Keeper) IterateWithdrawAddresses

func (k Keeper) IterateWithdrawAddresses(
	ctx sdk.Context,
	op func(owner sdk.AccAddress, withdrawAddress sdk.AccAddress) (stop bool),
)

IterateWithdrawAddresses iterates through all withdrawal addresses

func (Keeper) KillRequestContext

func (k Keeper) KillRequestContext(
	ctx sdk.Context,
	requestContextID tmbytes.HexBytes,
	consumer sdk.AccAddress,
) error

KillRequestContext terminates the specified request 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 maximum request timeout

func (Keeper) MinDeposit

func (k Keeper) MinDeposit(ctx sdk.Context) (res sdk.Coins)

MinDeposit returns the minimum deposit

func (Keeper) MinDepositMultiple

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

MinDepositMultiple returns the minimum deposit multiple

func (Keeper) OnRequestContextPaused

func (k Keeper) OnRequestContextPaused(
	ctx sdk.Context,
	requestContext types.RequestContext,
	requestContextID tmbytes.HexBytes,
	cause string,
)

OnRequestContextPaused handles the event where the specified request context is paused due to certain cause

func (Keeper) OwnerProvidersIterator

func (k Keeper) OwnerProvidersIterator(ctx sdk.Context, owner sdk.AccAddress) sdk.Iterator

OwnerProvidersIterator returns an iterator for all providers of the specified owner

func (Keeper) ParsePricing

func (k Keeper) ParsePricing(ctx sdk.Context, pricing string) (p types.Pricing, err error)

ParsePricing parses the given string to Pricing

func (Keeper) PauseRequestContext

func (k Keeper) PauseRequestContext(
	ctx sdk.Context,
	requestContextID tmbytes.HexBytes,
	consumer sdk.AccAddress,
) error

PauseRequestContext suspends the specified request context

func (Keeper) RefundDeposit

func (k Keeper) RefundDeposit(ctx sdk.Context, serviceName string, provider, owner sdk.AccAddress) error

RefundDeposit refunds the deposit from the specified service binding

func (Keeper) RefundDeposits

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

RefundDeposits refunds the deposits of all the service bindings

func (Keeper) RefundEarnedFees

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

RefundEarnedFees refunds all the earned fees

func (Keeper) RefundServiceFee

func (k Keeper) RefundServiceFee(ctx sdk.Context, consumer sdk.AccAddress, serviceFee sdk.Coins) error

RefundServiceFee refunds the service fee to the specified consumer

func (Keeper) RefundServiceFees

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

RefundServiceFees refunds the service fees of all the active requests

func (Keeper) RegisterResponseCallback

func (k Keeper) RegisterResponseCallback(moduleName string, respCallback types.ResponseCallback) error

RegisterResponseCallback registers a module callback for response handling

func (Keeper) RegisterStateCallback

func (k Keeper) RegisterStateCallback(moduleName string, stateCallback types.StateCallback) error

RegisterStateCallback registers a module callback for state handling

func (Keeper) RequestsIteratorByReqCtx

func (k Keeper) RequestsIteratorByReqCtx(ctx sdk.Context, requestContextID tmbytes.HexBytes, batchCounter uint64) sdk.Iterator

RequestsIteratorByReqCtx returns an iterator for all requests of the specified request context ID and batch counter

func (Keeper) ResetRequestContextsStateAndBatch

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

ResetRequestContextsStateAndBatch reset request contexts state and batch

func (Keeper) ResponsesIteratorByReqCtx

func (k Keeper) ResponsesIteratorByReqCtx(ctx sdk.Context, requestContextID tmbytes.HexBytes, batchCounter uint64) sdk.Iterator

ResponsesIteratorByReqCtx returns an iterator for all responses of the specified request context and batch counter

func (Keeper) ServiceBindingsIterator

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

ServiceBindingsIterator returns an iterator for all bindings of the specified service definition

func (Keeper) ServiceFeeTax

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

ServiceFeeTax returns the service fee tax

func (Keeper) SetCompactRequest

func (k Keeper) SetCompactRequest(ctx sdk.Context, requestID tmbytes.HexBytes, request types.CompactRequest)

SetCompactRequest sets the specified compact request

func (Keeper) SetEarnedFees

func (k Keeper) SetEarnedFees(ctx sdk.Context, provider sdk.AccAddress, fees sdk.Coins)

SetEarnedFees sets the earned fees for the specified provider

func (Keeper) SetNewRequestBatchHeight

func (k Keeper) SetNewRequestBatchHeight(ctx sdk.Context, requestContextID tmbytes.HexBytes, requestBatchHeight int64)

SetNewRequestBatchHeight sets the new request batch height for the specified request context

func (Keeper) SetOwner

func (k Keeper) SetOwner(ctx sdk.Context, provider, owner sdk.AccAddress)

SetOwner sets an owner for the specified provider

func (Keeper) SetOwnerEarnedFees

func (k Keeper) SetOwnerEarnedFees(ctx sdk.Context, owner sdk.AccAddress, fees sdk.Coins)

SetOwnerEarnedFees sets the earned fees for the specified owner

func (Keeper) SetOwnerProvider

func (k Keeper) SetOwnerProvider(ctx sdk.Context, owner, provider sdk.AccAddress)

SetOwnerProvider sets the provider with the owner

func (Keeper) SetOwnerServiceBinding

func (k Keeper) SetOwnerServiceBinding(ctx sdk.Context, svcBinding types.ServiceBinding)

SetOwnerServiceBinding sets the owner service binding

func (Keeper) SetParams

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

SetParams sets the params to the store

func (Keeper) SetPricing

func (k Keeper) SetPricing(
	ctx sdk.Context,
	serviceName string,
	provider sdk.AccAddress,
	pricing types.Pricing,
)

SetPricing sets the pricing for the specified service binding

func (Keeper) SetRequestBatchExpirationHeight

func (k Keeper) SetRequestBatchExpirationHeight(ctx sdk.Context, requestContextID tmbytes.HexBytes, expirationHeight int64)

SetRequestBatchExpirationHeight sets the request batch expiration height for the specified request context

func (Keeper) SetRequestContext

func (k Keeper) SetRequestContext(ctx sdk.Context, requestContextID tmbytes.HexBytes, requestContext types.RequestContext)

SetRequestContext sets the specified request context

func (Keeper) SetRequestVolume

func (k Keeper) SetRequestVolume(
	ctx sdk.Context,
	consumer sdk.AccAddress,
	serviceName string,
	provider sdk.AccAddress,
	volume uint64,
)

SetRequestVolume sets the request volume for the specified consumer and binding

func (Keeper) SetResponse

func (k Keeper) SetResponse(ctx sdk.Context, requestID tmbytes.HexBytes, response types.Response)

SetResponse sets the specified response

func (Keeper) SetServiceBinding

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

SetServiceBinding sets the service binding

func (Keeper) SetServiceDefinition

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

SetServiceDefinition sets the service definition

func (Keeper) SetWithdrawAddress

func (k Keeper) SetWithdrawAddress(ctx sdk.Context, owner, withdrawAddr sdk.AccAddress)

SetWithdrawAddress sets the withdrawal address for the specified owner

func (Keeper) SkipCurrentRequestBatch

func (k Keeper) SkipCurrentRequestBatch(ctx sdk.Context, requestContextID tmbytes.HexBytes, requestContext types.RequestContext)

SkipCurrentRequestBatch skips the current request batch

func (Keeper) Slash

func (k Keeper) Slash(ctx sdk.Context, requestID tmbytes.HexBytes) (err error)

Slash slashes the provider from the specified request Note: ensure that the request is valid

func (Keeper) SlashFraction

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

SlashFraction returns the slashing fraction

func (Keeper) StartRequestContext

func (k Keeper) StartRequestContext(
	ctx sdk.Context,
	requestContextID tmbytes.HexBytes,
	consumer sdk.AccAddress,
) error

StartRequestContext starts the specified request context

func (Keeper) TxSizeLimit

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

TxSizeLimit returns the tx size limit

func (Keeper) UpdateRequestContext

func (k Keeper) UpdateRequestContext(
	ctx sdk.Context,
	requestContextID tmbytes.HexBytes,
	providers []sdk.AccAddress,
	respThreshold uint32,
	serviceFeeCap sdk.Coins,
	timeout int64,
	repeatedFreq uint64,
	repeatedTotal int64,
	consumer sdk.AccAddress,
) error

UpdateRequestContext updates the specified request context

func (Keeper) UpdateServiceBinding

func (k Keeper) UpdateServiceBinding(
	ctx sdk.Context,
	serviceName string,
	provider sdk.AccAddress,
	deposit sdk.Coins,
	pricing string,
	qos uint64,
	owner sdk.AccAddress,
) error

UpdateServiceBinding updates the specified service binding

func (Keeper) WithdrawEarnedFees

func (k Keeper) WithdrawEarnedFees(ctx sdk.Context, owner, provider sdk.AccAddress) error

WithdrawEarnedFees withdraws the earned fees of the specified provider or owner

type MockTokenKeeper

type MockTokenKeeper struct{}

MockTokenKeeper defines a mock implementation for types.TokenKeeper

func (MockTokenKeeper) GetToken

func (k MockTokenKeeper) GetToken(ctx sdk.Context, denom string) (types.TokenI, error)

GetToken gets the specified token

Jump to

Keyboard shortcuts

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