iotex-core: Index | Files | Directories

package subchain

import ""


Package Files

datamodel.go protocol.go


const ProtocolID = "multi-chain_sub-chain"

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

type DepositIndex Uses

type DepositIndex byte

DepositIndex represents the deposit index

func (*DepositIndex) Deserialize Uses

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

Deserialize deserializes bytes into deposit index

func (DepositIndex) Serialize Uses

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

Serialize serializes deposit index into bytes

type Protocol Uses

type Protocol struct {
    // contains filtered or unexported fields

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

func NewProtocol Uses

func NewProtocol(chain blockchain.Blockchain) *Protocol

NewProtocol constructs a sub-chain protocol on sub-chain

func (*Protocol) Handle Uses

func (p *Protocol) Handle(ctx context.Context, act action.Action, sm protocol.StateManager) (*action.Receipt, error)

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

func (*Protocol) ReadState Uses

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

ReadState read the state on blockchain via protocol

func (*Protocol) Validate Uses

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

Validate validates the multi-chain action on sub-chain



Package subchain imports 13 packages (graph). Updated 2019-08-02. Refresh now. Tools for package owners.