subchain

package
v0.5.0-rc4-hotfix2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ProtocolID = "multi-chain_sub-chain"

ProtocolID is the protocol ID TODO: it works only for one instance per protocol definition now

Variables

This section is empty.

Functions

This section is empty.

Types

type DepositIndex

type DepositIndex byte

DepositIndex represents the deposit index

func (*DepositIndex) Deserialize

func (di *DepositIndex) Deserialize(data []byte) error

Deserialize deserializes bytes into deposit index

func (DepositIndex) Serialize

func (di DepositIndex) Serialize() ([]byte, error)

Serialize serializes deposit index into bytes

type Protocol

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

Protocol defines the protocol to handle multi-chain actions on sub-chain

func NewProtocol

func NewProtocol(chain blockchain.Blockchain, mainChainAPI explorer.Explorer) *Protocol

NewProtocol constructs a sub-chain protocol on sub-chain

func (*Protocol) Handle

Handle handles how to mutate the state db given the multi-chain action on sub-chain

func (*Protocol) ReadState added in v0.5.0

func (p *Protocol) ReadState(context.Context, protocol.StateManager, []byte, ...[]byte) ([]byte, error)

ReadState read the state on blockchain via protocol

func (*Protocol) Validate

func (p *Protocol) Validate(_ context.Context, act action.Action) error

Validate validates the multi-chain action on sub-chain

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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