local

package
v0.0.0-...-00adcb5 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application interface {
	// Info/Query Connection
	Info(*t.RequestInfo) *t.ResponseInfo    // Return application info
	Query(*t.RequestQuery) *t.ResponseQuery // Query for state

	// Mempool Connection
	CheckTx(*RequestNativeCheckTx) *ResponseNativeCheckTx // Validate a tx for the mempool

	// Consensus Connection
	InitLedger(*RequestNativeInitLedger) *ResponseNativeInitLedger // Initialize distributed ledger w/ validators/other info from the consensus engine
	BeginBlock(*RequestNativeBeginBlock) *t.ResponseBeginBlock     // Signals the beginning of a block
	DeliverTx(*RequestNativeDeliverTx) *t.ResponseDeliverTx        // Deliver a tx for full processing
	EndBlock(*t.RequestEndBlock) *ResponseNativeEndBlock           // Signals the end of a block, returns changes to the validator set
	Commit() *t.ResponseCommit                                     // Commit the state and return the application Merkle root hash

	// State Sync Connection
	ListSnapshots(*t.RequestListSnapshots) *t.ResponseListSnapshots                // List available snapshots
	OfferSnapshot(*t.RequestOfferSnapshot) *t.ResponseOfferSnapshot                // Offer a snapshot to the application
	LoadSnapshotChunk(*t.RequestLoadSnapshotChunk) *t.ResponseLoadSnapshotChunk    // Load a snapshot chunk
	ApplySnapshotChunk(*t.RequestApplySnapshotChunk) *t.ResponseApplySnapshotChunk // Apply a shapshot chunk
}

Application interface is a process-local version of the types.Application interface whose methods take a pointer argument and return a pointer to avoid copying, some methods also take a RequestNativeXxx argument and/or return a ResponseNativeXxx argument, which directly use Go-native types form go-doubl instead of corresponding Protocol Buffers types.

type BaseApplication

type BaseApplication struct {
}

func NewBaseApplication

func NewBaseApplication() *BaseApplication

func (BaseApplication) ApplySnapshotChunk

func (BaseApplication) BeginBlock

func (BaseApplication) CheckTx

func (BaseApplication) Commit

func (BaseApplication) Commit() *t.ResponseCommit

func (BaseApplication) DeliverTx

func (BaseApplication) EndBlock

func (BaseApplication) Info

func (BaseApplication) InitLedger

func (BaseApplication) ListSnapshots

func (BaseApplication) LoadSnapshotChunk

func (BaseApplication) OfferSnapshot

func (BaseApplication) Query

type RequestNativeBeginBlock

type RequestNativeBeginBlock struct {
	Header *model.BlockHeaderExt
	Extra  model.ExtraPtr
}

func (*RequestNativeBeginBlock) GetExtra

func (m *RequestNativeBeginBlock) GetExtra() model.ExtraPtr

func (*RequestNativeBeginBlock) GetHash

func (*RequestNativeBeginBlock) GetHeader

func (*RequestNativeBeginBlock) Reset

func (m *RequestNativeBeginBlock) Reset()

type RequestNativeCheckTx

type RequestNativeCheckTx struct {
	Tx   *model.TransactionExt
	Type types.CheckTxType
}

func (*RequestNativeCheckTx) GetTx

func (*RequestNativeCheckTx) GetType

func (m *RequestNativeCheckTx) GetType() types.CheckTxType

func (*RequestNativeCheckTx) Reset

func (m *RequestNativeCheckTx) Reset()

type RequestNativeDeliverTx

type RequestNativeDeliverTx struct {
	Tx *model.TransactionExt
}

func (*RequestNativeDeliverTx) GetTx

func (*RequestNativeDeliverTx) Reset

func (m *RequestNativeDeliverTx) Reset()

type RequestNativeInitLedger

type RequestNativeInitLedger struct {
	Time          time.Time
	LedgerId      model.LedgerID
	AppStateBytes []byte
	InitialHeight uint64
	Extra         model.ExtraPtr
}

func (*RequestNativeInitLedger) GetAppStateBytes

func (m *RequestNativeInitLedger) GetAppStateBytes() []byte

func (*RequestNativeInitLedger) GetExtra

func (m *RequestNativeInitLedger) GetExtra() model.ExtraPtr

func (*RequestNativeInitLedger) GetInitialHeight

func (m *RequestNativeInitLedger) GetInitialHeight() uint64

func (*RequestNativeInitLedger) GetLedgerId

func (m *RequestNativeInitLedger) GetLedgerId() model.LedgerID

func (*RequestNativeInitLedger) GetTime

func (m *RequestNativeInitLedger) GetTime() time.Time

func (*RequestNativeInitLedger) Reset

func (m *RequestNativeInitLedger) Reset()

type ResponseNativeCheckTx

type ResponseNativeCheckTx struct {
	Code      uint32
	Data      []byte
	Log       string
	Info      string
	GasWanted int64
	GasUsed   int64
	Events    []types.Event
	Codespace string
	Sender    model.Address
	Priority  int64
	// mempool_error is set by the SMRE.
	// ACEI applications creating a ResponseCheckTX should not set mempool_error.
	MempoolError error
}

func (*ResponseNativeCheckTx) GetCode

func (m *ResponseNativeCheckTx) GetCode() uint32

func (*ResponseNativeCheckTx) GetCodespace

func (m *ResponseNativeCheckTx) GetCodespace() string

func (*ResponseNativeCheckTx) GetData

func (m *ResponseNativeCheckTx) GetData() []byte

func (*ResponseNativeCheckTx) GetEvents

func (m *ResponseNativeCheckTx) GetEvents() []types.Event

func (*ResponseNativeCheckTx) GetGasUsed

func (m *ResponseNativeCheckTx) GetGasUsed() int64

func (*ResponseNativeCheckTx) GetGasWanted

func (m *ResponseNativeCheckTx) GetGasWanted() int64

func (*ResponseNativeCheckTx) GetInfo

func (m *ResponseNativeCheckTx) GetInfo() string

func (*ResponseNativeCheckTx) GetLog

func (m *ResponseNativeCheckTx) GetLog() string

func (*ResponseNativeCheckTx) GetMempoolError

func (m *ResponseNativeCheckTx) GetMempoolError() error

func (*ResponseNativeCheckTx) GetPriority

func (m *ResponseNativeCheckTx) GetPriority() int64

func (*ResponseNativeCheckTx) GetSender

func (m *ResponseNativeCheckTx) GetSender() model.Address

func (*ResponseNativeCheckTx) Reset

func (m *ResponseNativeCheckTx) Reset()

type ResponseNativeEndBlock

type ResponseNativeEndBlock struct {
	Events []types.Event
	Extra  model.ExtraPtr
}

func (*ResponseNativeEndBlock) GetEvents

func (m *ResponseNativeEndBlock) GetEvents() []types.Event

func (*ResponseNativeEndBlock) GetExtra

func (m *ResponseNativeEndBlock) GetExtra() model.ExtraPtr

func (*ResponseNativeEndBlock) Reset

func (m *ResponseNativeEndBlock) Reset()

type ResponseNativeInitLedger

type ResponseNativeInitLedger struct {
	AppHash []byte
	Extra   model.ExtraPtr
}

func (*ResponseNativeInitLedger) GetAppHash

func (m *ResponseNativeInitLedger) GetAppHash() []byte

func (*ResponseNativeInitLedger) GetExtra

func (m *ResponseNativeInitLedger) GetExtra() model.ExtraPtr

func (*ResponseNativeInitLedger) Reset

func (m *ResponseNativeInitLedger) Reset()

Jump to

Keyboard shortcuts

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