Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sidecar-client-fabric
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
sidecar-client-fabric
Commits
1b4f494b
Commit
1b4f494b
authored
Aug 19, 2021
by
jzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:invoke update
parent
383759b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
client.go
client.go
+1
-1
contracts.zip
example/contracts.zip
+0
-0
broker.go
example/contracts/src/broker/broker.go
+5
-5
No files found.
client.go
View file @
1b4f494b
...
...
@@ -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
{
...
...
example/contracts.zip
View file @
1b4f494b
No preview for this file type
example/contracts/src/broker/broker.go
View file @
1b4f494b
...
...
@@ -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
]
...
...
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