chaincodeSecurity

package
v0.0.0-...-ae2d2d9 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

README

TEST METHODS

unit test

  1. If you want to have unit test, please type go test under the catalogue of original file and test file in command line.
  2. go test -cover -covermode count -coverprofile ./cover.out can run unit test while get the cover rate of unit test.

Benchmark test

  1. Type go test -bench=. -benchmem will run all benchmark with unit test.
  2. If you do not want to run unit test while running benchmark, please add argument -run=none, because there usually do not have unit test method called none.
  3. If you want to change testing time(default time is 1s), you can add -benchtime=3s to change testing time to 3s.
  4. go test -benchmem -run=^$ -bench ^(Function name)$ to run benchmark for each specific funtion. For example, go test -benchmem -run=^$ -bench ^(BenchmarkCreateAddReduceDelete)$ run BenchmarkCreateAddReduceDelete funtion.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpleAsset

type SimpleAsset struct {
}

SimpleAsset implements a simple chaincode to manage an asset

func (*SimpleAsset) Init

Init is called during chaincode instantiation to initialize any data. Note that chaincode upgrade also calls this function to reset or to migrate data. When calls function Init, you can set an original account and its value.

func (*SimpleAsset) Invoke

Invoke is called per transaction on the chaincode. Each transaction is either a 'get' or a 'set' on the asset created by Init function. The Set method may create a new asset by specifying a new key-value pair.

Jump to

Keyboard shortcuts

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