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 ¶
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
Click to show internal directories.
Click to hide internal directories.