test

package
v0.0.0-...-496c6ee Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	ID        uint64
	Delivered chan *AppRecord
	Consensus *consensus.Consensus
	Setup     func()
	Node      *Node
	// contains filtered or unexported fields
}

func (*App) AssembleProposal

func (a *App) AssembleProposal(metadata []byte, requests [][]byte) (nextProp types.Proposal, remainder [][]byte)

func (*App) Connect

func (a *App) Connect()

func (*App) ConnectTo

func (a *App) ConnectTo(target uint64)

func (*App) Deliver

func (a *App) Deliver(proposal types.Proposal, _ []types.Signature)

func (*App) Disconnect

func (a *App) Disconnect()

func (*App) DisconnectFrom

func (a *App) DisconnectFrom(target uint64)

func (*App) Mute

func (a *App) Mute()

func (*App) RequestID

func (a *App) RequestID(req []byte) types.RequestInfo

func (*App) Restart

func (a *App) Restart()

func (*App) Sign

func (a *App) Sign([]byte) []byte

func (*App) SignProposal

func (a *App) SignProposal(types.Proposal) *types.Signature

func (*App) Submit

func (a *App) Submit(req Request)

func (*App) Sync

func (a *App) Sync() (smartbftprotos.ViewMetadata, uint64)

func (*App) UnMute

func (a *App) UnMute()

func (*App) VerificationSequence

func (a *App) VerificationSequence() uint64

func (*App) VerifyConsenterSig

func (a *App) VerifyConsenterSig(signature types.Signature, prop types.Proposal) error

func (*App) VerifyProposal

func (a *App) VerifyProposal(proposal types.Proposal) ([]types.RequestInfo, error)

func (*App) VerifyRequest

func (a *App) VerifyRequest(val []byte) (types.RequestInfo, error)

func (*App) VerifySignature

func (a *App) VerifySignature(signature types.Signature) error

type AppRecord

type AppRecord struct {
	Batch    *Batch
	Metadata []byte
}

type Batch

type Batch struct {
	Requests [][]byte
}

func BatchFromBytes

func BatchFromBytes(rawBlock []byte) *Batch

func (Batch) ToBytes

func (b Batch) ToBytes() []byte

type FwdMessage

type FwdMessage struct {
	Sender               uint64   `protobuf:"varint,1,opt,name=sender,proto3" json:"sender,omitempty"`
	Payload              []byte   `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*FwdMessage) Descriptor

func (*FwdMessage) Descriptor() ([]byte, []int)

func (*FwdMessage) GetPayload

func (m *FwdMessage) GetPayload() []byte

func (*FwdMessage) GetSender

func (m *FwdMessage) GetSender() uint64

func (*FwdMessage) ProtoMessage

func (*FwdMessage) ProtoMessage()

func (*FwdMessage) Reset

func (m *FwdMessage) Reset()

func (*FwdMessage) String

func (m *FwdMessage) String() string

func (*FwdMessage) XXX_DiscardUnknown

func (m *FwdMessage) XXX_DiscardUnknown()

func (*FwdMessage) XXX_Marshal

func (m *FwdMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FwdMessage) XXX_Merge

func (m *FwdMessage) XXX_Merge(src proto.Message)

func (*FwdMessage) XXX_Size

func (m *FwdMessage) XXX_Size() int

func (*FwdMessage) XXX_Unmarshal

func (m *FwdMessage) XXX_Unmarshal(b []byte) error

type Network

type Network map[uint64]*Node

func (Network) AddOrUpdateNode

func (n Network) AddOrUpdateNode(id uint64, h handler)

func (Network) Shutdown

func (n Network) Shutdown()

type Node

type Node struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Node) Nodes

func (node *Node) Nodes() []uint64

func (*Node) SendConsensus

func (node *Node) SendConsensus(targetID uint64, m *smartbftprotos.Message)

func (*Node) SendTransaction

func (node *Node) SendTransaction(targetID uint64, request []byte)

type Request

type Request struct {
	ClientID string
	ID       string
}

func (Request) ToBytes

func (txn Request) ToBytes() []byte

Jump to

Keyboard shortcuts

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