Commit e47c0e55 authored by harrylee's avatar harrylee

fix a bug for exec

parent 94ec47d9
......@@ -319,7 +319,7 @@ func (client *JSONClient) InitBroker(bxhId, appChainId, privateKey string) (*Res
// 发布跨链事件
func (client *JSONClient) EmitDataSwapInterchainEvent(dstServiceID, args, argscb, argsrb string, privateKey string) (*Response, error) {
// FIXME 这里需完善 funcName="interchainGet,interchainSet," txType=0 表示是存在类数据交换
tx := broker.EmitInterchainEvent("", dstServiceID, "interchainGet,interchainSet,", args, argsrb, argsrb, 0)
tx := broker.EmitInterchainEvent("", dstServiceID, "interchainGet,interchainSet,", args, argscb, argsrb, 0)
return client.SendTransactionSync(privateKey, tx)
}
......@@ -338,16 +338,14 @@ func (client *JSONClient) Execute(requst *Request, privateKey string) (*Response
if err != nil {
return nil, fmt.Errorf("cannot parse %s to uint64", string(requst.Args[3]))
}
// reqType==0 表示跨入交易, reqType==1 表示跨出交易,响应更新
if reqType != 0 {
// reqType==0 表示查询请求,需要更新inner index
if reqType == 0 {
tx := broker.UpdateIndex("", srcChainServiceID, targetCID, sequenceNum, reqType, 0)
resp, err := client.SendTransactionSync(privateKey, tx)
if err != nil {
return resp, err
}
}
//splitedCID[1]就是合约名称
splitedCID := strings.Split(targetCID, "&")
if len(splitedCID) != 2 {
......@@ -358,7 +356,6 @@ func (client *JSONClient) Execute(requst *Request, privateKey string) (*Response
if err := json.Unmarshal(requst.Args[4], callFunc); err != nil {
return nil, fmt.Errorf("unmarshal call func failed for %s", requst.Args[4])
}
fmt.Println("==================callfunc=======",callFunc.Func)
// 调用相应链码, (链码名称,参数,通道名称)
if splitedCID[1] == storage.StorageX || splitedCID[1] == broker.BrokerX {
//interchainGet方法是在sdk封装的,用于支持跨链之前数据的查询
......
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