Commit 1b4f494b authored by jzhe's avatar jzhe

feat:invoke update

parent 383759b4
......@@ -565,7 +565,7 @@ func (c *Client) GetReceipt(ibtp *pb.IBTP) (*pb.IBTP, error) {
return c.generateCallback(ibtp, result[1:], status)
}
func (c Client) InvokeIndexUpdate(from string, index uint64, serviceId string, category pb.IBTP_Category) (*channel.Response, *Response, error) {
func (c *Client) InvokeIndexUpdate(from string, index uint64, serviceId string, category pb.IBTP_Category) (*channel.Response, *Response, error) {
reqType := strconv.FormatUint(uint64(category), 10)
args := util.ToChaincodeArgs(from, strconv.FormatUint(index, 10), serviceId, reqType)
request := channel.Request{
......
No preview for this file type
......@@ -312,7 +312,7 @@ func (broker *Broker) updateIndex(stub shim.ChaincodeStubInterface, srcChainServ
if reqType == 0 {
inServicePair := genServicePair(srcChainServiceID, curServiceID)
if err := broker.checkIndex(stub, inServicePair, sequenceNum, innerMeta); err != nil {
return err
return fmt.Errorf("inner meta:%v", err)
}
if err := broker.markInCounter(stub, inServicePair); err != nil {
......@@ -322,7 +322,7 @@ func (broker *Broker) updateIndex(stub shim.ChaincodeStubInterface, srcChainServ
outServicePair := genServicePair(curServiceID, srcChainServiceID)
if err := broker.checkIndex(stub, outServicePair, sequenceNum, callbackMeta); err != nil {
return err
return fmt.Errorf("callback:%v", err)
}
idx, err := strconv.ParseUint(sequenceNum, 10, 64)
......@@ -343,7 +343,7 @@ func (broker *Broker) updateIndex(stub shim.ChaincodeStubInterface, srcChainServ
return err
}
if idx < meta[inServicePair]+1 {
return fmt.Errorf("incorrect index, expect %d", meta[inServicePair]+1)
return fmt.Errorf("incorrect dstRollback index, expect %d", meta[inServicePair]+1)
}
if err := broker.markDstRollbackCounter(stub, inServicePair, idx); err != nil {
return err
......@@ -354,8 +354,8 @@ func (broker *Broker) updateIndex(stub shim.ChaincodeStubInterface, srcChainServ
}
func (broker *Broker) invokeIndexUpdate(stub shim.ChaincodeStubInterface, args []string) pb.Response {
if len(args) != 3 {
return errorResponse("incorrect number of arguments, expecting 3")
if len(args) != 4 {
return errorResponse("incorrect number of arguments, expecting 4")
}
srcServiceID := args[0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment