Skip to content

Commit 1ffde44

Browse files
committed
Remove unneeded imports from chaincode tests
Change-Id: I870509063e2ec0277961f72414afc44d85d82447 Signed-off-by: Gabor Hosszu <[email protected]>
1 parent 78c4b68 commit 1ffde44

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

examples/chaincode/go/chaincode_example02/chaincode_example02_test.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"testing"
2121

2222
"github.com/hyperledger/fabric/core/chaincode/shim"
23-
main "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02"
2423
)
2524

2625
func checkInit(t *testing.T, stub *shim.MockStub, args []string) {
@@ -68,7 +67,7 @@ func checkInvoke(t *testing.T, stub *shim.MockStub, args []string) {
6867
}
6968

7069
func TestExample02_Init(t *testing.T) {
71-
scc := new(main.SimpleChaincode)
70+
scc := new(SimpleChaincode)
7271
stub := shim.NewMockStub("ex02", scc)
7372

7473
// Init A=123 B=234
@@ -79,7 +78,7 @@ func TestExample02_Init(t *testing.T) {
7978
}
8079

8180
func TestExample02_Query(t *testing.T) {
82-
scc := new(main.SimpleChaincode)
81+
scc := new(SimpleChaincode)
8382
stub := shim.NewMockStub("ex02", scc)
8483

8584
// Init A=345 B=456
@@ -93,7 +92,7 @@ func TestExample02_Query(t *testing.T) {
9392
}
9493

9594
func TestExample02_Invoke(t *testing.T) {
96-
scc := new(main.SimpleChaincode)
95+
scc := new(SimpleChaincode)
9796
stub := shim.NewMockStub("ex02", scc)
9897

9998
// Init A=567 B=678

examples/chaincode/go/chaincode_example03/chaincode_example03_test.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ import (
2020
"testing"
2121

2222
"github.com/hyperledger/fabric/core/chaincode/shim"
23-
main "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example03"
2423
)
2524

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) {
2726
_, err := stub.MockInit("1", "init", args)
2827
if err != nil {
2928
fmt.Println("Init failed", err)
@@ -43,7 +42,7 @@ func checkState(t *testing.T, stub *shim.MockStub, name string, value string) {
4342
}
4443
}
4544

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) {
4746
bytes, err := scc.Query(stub, "query", args)
4847
if err != nil {
4948
// expected failure
@@ -62,7 +61,7 @@ func checkQuery(t *testing.T, scc *main.SimpleChaincode, stub *shim.MockStub, ar
6261
}
6362
}
6463

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) {
6665
_, err := stub.MockInvoke("1", "query", args)
6766
if err != nil {
6867
fmt.Println("Invoke", args, "failed", err)
@@ -71,7 +70,7 @@ func checkInvoke(t *testing.T, scc *main.SimpleChaincode, stub *shim.MockStub, a
7170
}
7271

7372
func TestExample03_Init(t *testing.T) {
74-
scc := new(main.SimpleChaincode)
73+
scc := new(SimpleChaincode)
7574
stub := shim.NewMockStub("ex03", scc)
7675

7776
// Init A=123 B=234
@@ -81,7 +80,7 @@ func TestExample03_Init(t *testing.T) {
8180
}
8281

8382
func TestExample03_Query(t *testing.T) {
84-
scc := new(main.SimpleChaincode)
83+
scc := new(SimpleChaincode)
8584
stub := shim.NewMockStub("ex03", scc)
8685

8786
// Init A=345 B=456

examples/chaincode/go/chaincode_example04/chaincode_example04.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type SimpleChaincode struct {
3434
func (t *SimpleChaincode) GetChaincodeToCall() string {
3535
//This is the hashcode for github.com/hyperledger/fabric/core/example/chaincode/chaincode_example02
3636
//if the example is modifed this hashcode will change!!
37-
chainCodeToCall := "0588c9b192603a2d39f2223ec524e30119698a36e77369c9d6df2ca16b85043406c67502787362e99f46d68b81b3f59000a149041ddba90047cf72e56fdfce96"
37+
chainCodeToCall := "980d4bb7f69578592e5775a6da86d81a221887817d7164d3e9d4d4df1c981440abf9a61417eaf8ad6f7fc79893da36de2cf4709131e9af39bca6ebc2e5a1cd9d"
3838
return chainCodeToCall
3939
}
4040

0 commit comments

Comments
 (0)