Skip to content

Commit f075adf

Browse files
committed
Added code for inter-contract test case
1 parent a08b472 commit f075adf

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/hyperledger/fabric-chaincode-go/shim"
7+
"github.com/hyperledger/fabric-protos-go/peer"
8+
)
9+
10+
type ContractA struct {
11+
}
12+
13+
func (s *ContractA) Invoke(stub shim.ChaincodeStubInterface) peer.Response {
14+
15+
resp := stub.InvokeChaincode("contractB", []byte("10"), "mychannel")
16+
17+
return shim.Success([]byte("Hello!"))
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/hyperledger/fabric-chaincode-go/shim"
7+
"github.com/hyperledger/fabric-protos-go/peer"
8+
)
9+
10+
type ContractB struct {
11+
}
12+
13+
func (t *ContractB) Invoke(stub shim.ChaincodeStubInterface) peer.Response {
14+
15+
stub.PutState("key1", "Bob")
16+
17+
return shim.Success([]byte("OK"))
18+
}

0 commit comments

Comments
 (0)