Documentation ¶
Index ¶
- func ConstructBlock(t *testing.T, blockNum uint64, previousHash []byte, simulationResults [][]byte, ...) *common.Block
- func ConstructBlockFromBlockDetails(t *testing.T, blockDetails *BlockDetails, sign bool) *common.Block
- func ConstructBlockWithTxid(t *testing.T, blockNum uint64, previousHash []byte, simulationResults [][]byte, ...) *common.Block
- func ConstructBytesProposalResponsePayload(version string, simulationResults []byte) ([]byte, error)
- func ConstructRandomBytes(t testing.TB, size int) []byte
- func ConstructTestBlock(t *testing.T, blockNum uint64, numTx int, txSize int) *common.Block
- func ConstructTestBlocks(t *testing.T, numBlocks int) []*common.Block
- func ConstructTransaction(_ *testing.T, simulationResults []byte, txid string, sign bool) (*common.Envelope, string, error)
- func ConstructTransactionFromTxDetails(txDetails *TxDetails, sign bool) (*common.Envelope, string, error)
- func CopyDir(srcroot, destroot string) error
- func CreateTarBytesForTest(testFiles []*TarFileEntry) []byte
- func NewBlock(env []*common.Envelope, blockNum uint64, previousHash []byte) *common.Block
- type BlockDetails
- type BlockGenerator
- func (bg *BlockGenerator) NextBlock(simulationResults [][]byte) *common.Block
- func (bg *BlockGenerator) NextBlockWithTxid(simulationResults [][]byte, txids []string) *common.Block
- func (bg *BlockGenerator) NextTestBlock(numTx int, txSize int) *common.Block
- func (bg *BlockGenerator) NextTestBlocks(numBlocks int) []*common.Block
- type TarFileEntry
- type TxDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructBlock ¶
func ConstructBlockWithTxid ¶
func ConstructBytesProposalResponsePayload ¶
func ConstructBytesProposalResponsePayload(version string, simulationResults []byte) ([]byte, error)
constructBytesProposalResponsePayLoad使用给定的链码版本和模拟结果构造一个ProposalResponse字节用于测试
func ConstructTestBlock ¶
func ConstructTransaction ¶
func CreateTarBytesForTest ¶
func CreateTarBytesForTest(testFiles []*TarFileEntry) []byte
Types ¶
type BlockDetails ¶
type BlockGenerator ¶
type BlockGenerator struct {
// contains filtered or unexported fields
}
BlockGenerator生成一系列用于测试的块
func NewBlockGenerator ¶
func (*BlockGenerator) NextBlock ¶
func (bg *BlockGenerator) NextBlock(simulationResults [][]byte) *common.Block
func (*BlockGenerator) NextBlockWithTxid ¶
func (bg *BlockGenerator) NextBlockWithTxid(simulationResults [][]byte, txids []string) *common.Block
nextBlockWithTxID按顺序构造下一个块,其中包含许多事务-每个模拟结果一个
func (*BlockGenerator) NextTestBlock ¶
func (bg *BlockGenerator) NextTestBlock(numTx int, txSize int) *common.Block
func (*BlockGenerator) NextTestBlocks ¶
func (bg *BlockGenerator) NextTestBlocks(numBlocks int) []*common.Block
type TarFileEntry ¶
type TarFileEntry struct {
Name, Body string
}
Click to show internal directories.
Click to hide internal directories.