Documentation ¶
Index ¶
- func AssertContains(t testing.TB, slice interface{}, value interface{})
- func AssertContainsAll(t testing.TB, sliceActual interface{}, sliceExpected interface{})
- func AssertEquals(t testing.TB, actual interface{}, expected interface{})
- func AssertError(t testing.TB, err error, message string)
- func AssertNil(t testing.TB, value interface{})
- func AssertNoError(t testing.TB, err error, message string)
- func AssertNotEquals(t testing.TB, actual interface{}, expected interface{})
- func AssertNotNil(t testing.TB, value interface{})
- func AssertPanic(t testing.TB, msg string)
- func AssertSame(t testing.TB, actual interface{}, expected interface{})
- func ConstructBlock(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, sign bool) (*common.Envelope, string, error)
- func Contains(slice interface{}, value interface{}) bool
- type BlockGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertContains ¶ added in v1.0.0
AssertContains varifies that the slice contains the value
func AssertContainsAll ¶ added in v1.0.0
AssertContainsAll varifies that sliceActual is a superset of sliceExpected
func AssertEquals ¶ added in v1.0.0
AssertEquals varifies that the two values are equal
func AssertError ¶ added in v1.0.0
AssertError varifies that the err is not nil
func AssertNoError ¶ added in v1.0.0
AssertNoError varifies that the err is nil
func AssertNotEquals ¶ added in v1.0.0
AssertNotEquals varifies that the two values are not equal
func AssertNotNil ¶ added in v1.0.0
AssertNotNil varifies that the value is not nil
func AssertPanic ¶ added in v1.0.0
AssertPanic varifies that a panic is raised during a test
func AssertSame ¶ added in v1.0.0
AssertSame varifies that the two values are same
func ConstructBlock ¶
func ConstructBlock(t *testing.T, blockNum uint64, previousHash []byte, simulationResults [][]byte, sign bool) *common.Block
ConstructBlock constructs a single block
func ConstructBytesProposalResponsePayload ¶
func ConstructBytesProposalResponsePayload(version string, simulationResults []byte) ([]byte, error)
ConstructBytesProposalResponsePayload constructs a ProposalResponse byte with given chaincode version and simulationResults for testing
func ConstructRandomBytes ¶
ConstructRandomBytes constructs random bytes of given size
func ConstructTestBlock ¶
ConstructTestBlock constructs a single block with random contents
func ConstructTestBlocks ¶
ConstructTestBlocks returns a series of blocks starting with blockNum=0. The first block in the returned array is a config tx block that represents a genesis block
Types ¶
type BlockGenerator ¶
type BlockGenerator struct {
// contains filtered or unexported fields
}
BlockGenerator generates a series of blocks for testing
func NewBlockGenerator ¶
func NewBlockGenerator(t *testing.T, ledgerID string, signTxs bool) (*BlockGenerator, *common.Block)
NewBlockGenerator instantiates new BlockGenerator for testing
func (*BlockGenerator) NextBlock ¶
func (bg *BlockGenerator) NextBlock(simulationResults [][]byte) *common.Block
NextBlock constructs next block in sequence that includes a number of transactions - one per simulationResults
func (*BlockGenerator) NextTestBlock ¶
func (bg *BlockGenerator) NextTestBlock(numTx int, txSize int) *common.Block
NextTestBlock constructs next block in sequence block with 'numTx' number of transactions for testing
func (*BlockGenerator) NextTestBlocks ¶
func (bg *BlockGenerator) NextTestBlocks(numBlocks int) []*common.Block
NextTestBlocks constructs 'numBlocks' number of blocks for testing