dummy

package
v0.0.0-...-437c9e2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DummySocketClient

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

DummySocketClient is a socket implementation of the dummy app. Babble and the app run in separate processes and communicate through TCP sockets using a SocketBabbleProxy and a SocketAppProxy.

func NewDummySocketClient

func NewDummySocketClient(clientAddr string, nodeAddr string, logger *logrus.Logger) (*DummySocketClient, error)

NewDummySocketClient instantiates a DummySocketClient and starts the SocketBabbleProxy

func (*DummySocketClient) SubmitTx

func (c *DummySocketClient) SubmitTx(tx []byte) error

SubmitTx sends a transaction to Babble via the SocketProxy

type InmemDummyClient

type InmemDummyClient struct {
	*inmem.InmemProxy
	// contains filtered or unexported fields
}

InmemDummyClient is an in-memory implementation of the dummy app. It actually imlplements the AppProxy interface, and can be passed in the Babble constructor directly

func NewInmemDummyClient

func NewInmemDummyClient(logger *logrus.Logger) *InmemDummyClient

NewInmemDummyClient instantiates an InemDummyClient

func (*InmemDummyClient) GetCommittedTransactions

func (c *InmemDummyClient) GetCommittedTransactions() [][]byte

GetCommittedTransactions returns the state's list of transactions

func (*InmemDummyClient) SubmitTx

func (c *InmemDummyClient) SubmitTx(tx []byte)

SubmitTx sends a transaction to the Babble node via the InmemProxy

type State

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

func NewState

func NewState(logger *logrus.Logger) *State

func (*State) CommitHandler

func (a *State) CommitHandler(block hashgraph.Block) (proxy.CommitResponse, error)

func (*State) GetCommittedTransactions

func (a *State) GetCommittedTransactions() [][]byte

func (*State) RestoreHandler

func (a *State) RestoreHandler(snapshot []byte) ([]byte, error)

func (*State) SnapshotHandler

func (a *State) SnapshotHandler(blockIndex int) ([]byte, error)

Jump to

Keyboard shortcuts

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