epochtimemock

package
v0.2012.4 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package epochtimemock implements the mock epochtime application.

Index

Constants

View Source
const (
	// AppID is the unique application identifier.
	AppID uint8 = 0x03

	// AppName is the ABCI application name.
	//
	// Note: It must be lexographically before any application that
	// uses time keeping.
	AppName string = "000_epochtime_mock"
)

Variables

View Source
var (
	// EventType is the ABCI event type for mock epochtime events.
	EventType = api.EventTypeForApp(AppName)

	// QueryApp is a query for filtering events processed by
	// the mock epochtime application.
	QueryApp = api.QueryForApp(AppName)

	// KeyEpoch is an ABCI event attribute for specifying the set epoch.
	KeyEpoch = []byte("epoch")

	// MethodSetEpoch is the method name for setting epochs.
	MethodSetEpoch = transaction.NewMethodName(AppName, "SetEpoch", epochtime.EpochTime(0))

	// Methods is a list of all methods supported by the epochtime mock application.
	Methods = []transaction.MethodName{
		MethodSetEpoch,
	}
)

Functions

func New

func New() api.Application

New constructs a new mock epochtime application instance.

Types

type Query

type Query interface {
	Epoch(context.Context) (epochtime.EpochTime, int64, error)
}

Query is the mock epochtime query interface.

type QueryFactory

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

QueryFactory is the mock epochtime query factory.

func NewQueryFactory

func NewQueryFactory(state abciAPI.ApplicationQueryState) *QueryFactory

NewQueryFactory returns a new QueryFactory backed by the given state instance.

func (*QueryFactory) QueryAt

func (sf *QueryFactory) QueryAt(ctx context.Context, height int64) (Query, error)

QueryAt returns the mock epochtime query interface for a specific height.

Jump to

Keyboard shortcuts

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