@@ -20,10 +20,9 @@ import (
20
20
"testing"
21
21
22
22
"github.com/hyperledger/fabric/core/chaincode/shim"
23
- main "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example03"
24
23
)
25
24
26
- func checkInit (t * testing.T , scc * main. SimpleChaincode , stub * shim.MockStub , args []string ) {
25
+ func checkInit (t * testing.T , scc * SimpleChaincode , stub * shim.MockStub , args []string ) {
27
26
_ , err := stub .MockInit ("1" , "init" , args )
28
27
if err != nil {
29
28
fmt .Println ("Init failed" , err )
@@ -43,7 +42,7 @@ func checkState(t *testing.T, stub *shim.MockStub, name string, value string) {
43
42
}
44
43
}
45
44
46
- func checkQuery (t * testing.T , scc * main. SimpleChaincode , stub * shim.MockStub , args []string , value string ) {
45
+ func checkQuery (t * testing.T , scc * SimpleChaincode , stub * shim.MockStub , args []string , value string ) {
47
46
bytes , err := scc .Query (stub , "query" , args )
48
47
if err != nil {
49
48
// expected failure
@@ -62,7 +61,7 @@ func checkQuery(t *testing.T, scc *main.SimpleChaincode, stub *shim.MockStub, ar
62
61
}
63
62
}
64
63
65
- func checkInvoke (t * testing.T , scc * main. SimpleChaincode , stub * shim.MockStub , args []string ) {
64
+ func checkInvoke (t * testing.T , scc * SimpleChaincode , stub * shim.MockStub , args []string ) {
66
65
_ , err := stub .MockInvoke ("1" , "query" , args )
67
66
if err != nil {
68
67
fmt .Println ("Invoke" , args , "failed" , err )
@@ -71,7 +70,7 @@ func checkInvoke(t *testing.T, scc *main.SimpleChaincode, stub *shim.MockStub, a
71
70
}
72
71
73
72
func TestExample03_Init (t * testing.T ) {
74
- scc := new (main. SimpleChaincode )
73
+ scc := new (SimpleChaincode )
75
74
stub := shim .NewMockStub ("ex03" , scc )
76
75
77
76
// Init A=123 B=234
@@ -81,7 +80,7 @@ func TestExample03_Init(t *testing.T) {
81
80
}
82
81
83
82
func TestExample03_Query (t * testing.T ) {
84
- scc := new (main. SimpleChaincode )
83
+ scc := new (SimpleChaincode )
85
84
stub := shim .NewMockStub ("ex03" , scc )
86
85
87
86
// Init A=345 B=456
0 commit comments