Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chain33-sdk-go
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
chain33-sdk-go
Commits
e47c0e55
Commit
e47c0e55
authored
Dec 08, 2021
by
harrylee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a bug for exec
parent
94ec47d9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
jsonclient.go
client/jsonclient.go
+3
-6
No files found.
client/jsonclient.go
View file @
e47c0e55
...
...
@@ -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
,
args
r
b
,
argsrb
,
0
)
tx
:=
broker
.
EmitInterchainEvent
(
""
,
dstServiceID
,
"interchainGet,interchainSet,"
,
args
,
args
c
b
,
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封装的,用于支持跨链之前数据的查询
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment