tas_middleware_test

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenBlocks

func GenBlocks() []*types.Block

func GenBlocksByBlock

func GenBlocksByBlock(bc *types.Block) []*types.Block

func GenDefaultMessageWithBytes

func GenDefaultMessageWithBytes(source int, data []byte) *notify.DefaultMessage

func GenErrorBlockHeaders

func GenErrorBlockHeaders() []*types.BlockHeader

func GenErrorDefaultMessage

func GenErrorDefaultMessage(source int) *notify.DefaultMessage

func GenErrorDefaultMessageWithBlockHeader

func GenErrorDefaultMessageWithBlockHeader(source int, bh *types.BlockHeader) *notify.DefaultMessage

func GenHashCorrectBlocks

func GenHashCorrectBlocks() []*types.Block

func GenHashCorrectBlocksByFirstHash

func GenHashCorrectBlocksByFirstHash(firstBlockHash common.Hash, len int) []*types.Block

func GenOnlyHasTransBlocks

func GenOnlyHasTransBlocks() []*types.Block

func GeneCorrectBlockHeaders

func GeneCorrectBlockHeaders() []*types.BlockHeader

func GeneCorrectBlockHeadersByFirstHash

func GeneCorrectBlockHeadersByFirstHash(firstHash common.Hash, len int) []*types.BlockHeader

func GeneErrorBlockHeaders

func GeneErrorBlockHeaders() []*types.BlockHeader

func MarshalErorSyncRequest

func MarshalErorSyncRequest() ([]byte, error)

func MarshalNilSyncRequest

func MarshalNilSyncRequest() ([]byte, error)

func NewBlock

func NewBlock(bh *types.BlockHeader, txs []*types.RawTransaction) *types.Block

func NewBlockWithTxs

func NewBlockWithTxs(txs []*types.RawTransaction) *types.Block

func NewCorrectBlockHeader

func NewCorrectBlockHeader(hash common.Hash, preHash common.Hash) *types.BlockHeader

func NewNilBlockHeader

func NewNilBlockHeader() *types.BlockHeader

func NewNilHeaderMessage

func NewNilHeaderMessage(source string) *notify.DefaultMessage

func NewRandomErrorBlockHeader

func NewRandomErrorBlockHeader() *types.BlockHeader

func NewRandomFullBlockHeader

func NewRandomFullBlockHeader(height uint64) *types.BlockHeader

Types

type Block

type Block struct {
	Header               *BlockHeader   `protobuf:"bytes,1,req,name=Header" json:"Header,omitempty"`
	Transactions         []*Transaction `protobuf:"bytes,2,rep,name=transactions" json:"transactions,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (*Block) Descriptor

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

func (*Block) GetHeader

func (m *Block) GetHeader() *BlockHeader

func (*Block) GetTransactions

func (m *Block) GetTransactions() []*Transaction

func (*Block) ProtoMessage

func (*Block) ProtoMessage()

func (*Block) Reset

func (m *Block) Reset()

func (*Block) String

func (m *Block) String() string

func (*Block) XXX_DiscardUnknown

func (m *Block) XXX_DiscardUnknown()

func (*Block) XXX_Marshal

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

func (*Block) XXX_Merge

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

func (*Block) XXX_Size

func (m *Block) XXX_Size() int

func (*Block) XXX_Unmarshal

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

type BlockHeader

type BlockHeader struct {
	Hash                 []byte   `protobuf:"bytes,1,opt,name=Hash" json:"Hash,omitempty"`
	Height               *string  `protobuf:"bytes,2,opt,name=Height" json:"Height,omitempty"`
	PreHash              []byte   `protobuf:"bytes,3,opt,name=PreHash" json:"PreHash,omitempty"`
	Elapsed              *int32   `protobuf:"varint,4,opt,name=Elapsed" json:"Elapsed,omitempty"`
	ProveValue           []byte   `protobuf:"bytes,5,opt,name=ProveValue" json:"ProveValue,omitempty"`
	TotalQN              *uint64  `protobuf:"varint,6,opt,name=TotalQN" json:"TotalQN,omitempty"`
	CurTime              *int64   `protobuf:"varint,7,opt,name=CurTime" json:"CurTime,omitempty"`
	Castor               []byte   `protobuf:"bytes,8,opt,name=Castor" json:"Castor,omitempty"`
	GroupId              []byte   `protobuf:"bytes,9,opt,name=GroupId" json:"GroupId,omitempty"`
	Signature            []byte   `protobuf:"bytes,10,opt,name=Signature" json:"Signature,omitempty"`
	Nonce                *int32   `protobuf:"varint,11,opt,name=Nonce" json:"Nonce,omitempty"`
	TxTree               []byte   `protobuf:"bytes,12,opt,name=TxTree" json:"TxTree,omitempty"`
	ReceiptTree          []byte   `protobuf:"bytes,13,opt,name=ReceiptTree" json:"ReceiptTree,omitempty"`
	StateTree            []byte   `protobuf:"bytes,14,opt,name=StateTree" json:"StateTree,omitempty"`
	ExtraData            []byte   `protobuf:"bytes,15,opt,name=ExtraData" json:"ExtraData,omitempty"`
	Random               []byte   `protobuf:"bytes,16,opt,name=Random" json:"Random,omitempty"`
	GasFee               *uint64  `protobuf:"varint,17,opt,name=GasFee" json:"GasFee,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*BlockHeader) Descriptor

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

func (*BlockHeader) GetCastor

func (m *BlockHeader) GetCastor() []byte

func (*BlockHeader) GetCurTime

func (m *BlockHeader) GetCurTime() int64

func (*BlockHeader) GetElapsed

func (m *BlockHeader) GetElapsed() int32

func (*BlockHeader) GetExtraData

func (m *BlockHeader) GetExtraData() []byte

func (*BlockHeader) GetGasFee

func (m *BlockHeader) GetGasFee() uint64

func (*BlockHeader) GetGroupId

func (m *BlockHeader) GetGroupId() []byte

func (*BlockHeader) GetHash

func (m *BlockHeader) GetHash() []byte

func (*BlockHeader) GetHeight

func (m *BlockHeader) GetHeight() string

func (*BlockHeader) GetNonce

func (m *BlockHeader) GetNonce() int32

func (*BlockHeader) GetPreHash

func (m *BlockHeader) GetPreHash() []byte

func (*BlockHeader) GetProveValue

func (m *BlockHeader) GetProveValue() []byte

func (*BlockHeader) GetRandom

func (m *BlockHeader) GetRandom() []byte

func (*BlockHeader) GetReceiptTree

func (m *BlockHeader) GetReceiptTree() []byte

func (*BlockHeader) GetSignature

func (m *BlockHeader) GetSignature() []byte

func (*BlockHeader) GetStateTree

func (m *BlockHeader) GetStateTree() []byte

func (*BlockHeader) GetTotalQN

func (m *BlockHeader) GetTotalQN() uint64

func (*BlockHeader) GetTxTree

func (m *BlockHeader) GetTxTree() []byte

func (*BlockHeader) ProtoMessage

func (*BlockHeader) ProtoMessage()

func (*BlockHeader) Reset

func (m *BlockHeader) Reset()

func (*BlockHeader) String

func (m *BlockHeader) String() string

func (*BlockHeader) XXX_DiscardUnknown

func (m *BlockHeader) XXX_DiscardUnknown()

func (*BlockHeader) XXX_Marshal

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

func (*BlockHeader) XXX_Merge

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

func (*BlockHeader) XXX_Size

func (m *BlockHeader) XXX_Size() int

func (*BlockHeader) XXX_Unmarshal

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

type BlockResponseMsg

type BlockResponseMsg struct {
	Blocks               []*Block `protobuf:"bytes,1,rep,name=Blocks" json:"Blocks,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*BlockResponseMsg) Descriptor

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

func (*BlockResponseMsg) GetBlocks

func (m *BlockResponseMsg) GetBlocks() []*Block

func (*BlockResponseMsg) ProtoMessage

func (*BlockResponseMsg) ProtoMessage()

func (*BlockResponseMsg) Reset

func (m *BlockResponseMsg) Reset()

func (*BlockResponseMsg) String

func (m *BlockResponseMsg) String() string

func (*BlockResponseMsg) XXX_DiscardUnknown

func (m *BlockResponseMsg) XXX_DiscardUnknown()

func (*BlockResponseMsg) XXX_Marshal

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

func (*BlockResponseMsg) XXX_Merge

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

func (*BlockResponseMsg) XXX_Size

func (m *BlockResponseMsg) XXX_Size() int

func (*BlockResponseMsg) XXX_Unmarshal

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

type SyncRequest

type SyncRequest struct {
	ReqHeight            *int64   `protobuf:"varint,1,opt,name=ReqHeight" json:"ReqHeight,omitempty"`
	ReqSize              *int64   `protobuf:"varint,2,opt,name=ReqSize" json:"ReqSize,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*SyncRequest) Descriptor

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

func (*SyncRequest) GetReqHeight

func (m *SyncRequest) GetReqHeight() int64

func (*SyncRequest) GetReqSize

func (m *SyncRequest) GetReqSize() int64

func (*SyncRequest) ProtoMessage

func (*SyncRequest) ProtoMessage()

func (*SyncRequest) Reset

func (m *SyncRequest) Reset()

func (*SyncRequest) String

func (m *SyncRequest) String() string

func (*SyncRequest) XXX_DiscardUnknown

func (m *SyncRequest) XXX_DiscardUnknown()

func (*SyncRequest) XXX_Marshal

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

func (*SyncRequest) XXX_Merge

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

func (*SyncRequest) XXX_Size

func (m *SyncRequest) XXX_Size() int

func (*SyncRequest) XXX_Unmarshal

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

type Transaction

type Transaction struct {
	Data                 []byte   `protobuf:"bytes,1,opt,name=Data" json:"Data,omitempty"`
	Value                []byte   `protobuf:"bytes,2,opt,name=Value" json:"Value,omitempty"`
	Nonce                *uint64  `protobuf:"varint,3,req,name=Nonce" json:"Nonce,omitempty"`
	Target               []byte   `protobuf:"bytes,4,opt,name=Target" json:"Target,omitempty"`
	GasLimit             []byte   `protobuf:"bytes,5,req,name=GasLimit" json:"GasLimit,omitempty"`
	GasPrice             []byte   `protobuf:"bytes,6,req,name=GasPrice" json:"GasPrice,omitempty"`
	Hash                 []byte   `protobuf:"bytes,7,req,name=Hash" json:"Hash,omitempty"`
	ExtraData            []byte   `protobuf:"bytes,8,opt,name=ExtraData" json:"ExtraData,omitempty"`
	Type                 *int32   `protobuf:"varint,9,req,name=Type" json:"Type,omitempty"`
	Sign                 []byte   `protobuf:"bytes,10,opt,name=Sign" json:"Sign,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Transaction) Descriptor

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

func (*Transaction) GetData

func (m *Transaction) GetData() []byte

func (*Transaction) GetExtraData

func (m *Transaction) GetExtraData() []byte

func (*Transaction) GetGasLimit

func (m *Transaction) GetGasLimit() []byte

func (*Transaction) GetGasPrice

func (m *Transaction) GetGasPrice() []byte

func (*Transaction) GetHash

func (m *Transaction) GetHash() []byte

func (*Transaction) GetNonce

func (m *Transaction) GetNonce() uint64

func (*Transaction) GetSign

func (m *Transaction) GetSign() []byte

func (*Transaction) GetTarget

func (m *Transaction) GetTarget() []byte

func (*Transaction) GetType

func (m *Transaction) GetType() int32

func (*Transaction) GetValue

func (m *Transaction) GetValue() []byte

func (*Transaction) ProtoMessage

func (*Transaction) ProtoMessage()

func (*Transaction) Reset

func (m *Transaction) Reset()

func (*Transaction) String

func (m *Transaction) String() string

func (*Transaction) XXX_DiscardUnknown

func (m *Transaction) XXX_DiscardUnknown()

func (*Transaction) XXX_Marshal

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

func (*Transaction) XXX_Merge

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

func (*Transaction) XXX_Size

func (m *Transaction) XXX_Size() int

func (*Transaction) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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