Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
新注册的用户请输入邮箱并保存,随后登录邮箱激活账号。后续可直接使用邮箱登录!
Open sidebar
白 鹿
contract-sdk-go
Commits
37d72bd5
Commit
37d72bd5
authored
Dec 20, 2022
by
tianle
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2.3.1_qc' into 'develop' (merge request !37)
v2.3.1_qc
parents
e7219ed0
39be28fc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
8 deletions
+12
-8
sandbox/runtime_client.go
sandbox/runtime_client.go
+1
-2
sandbox/tx_handler.go
sandbox/tx_handler.go
+2
-5
sdk/response.go
sdk/response.go
+8
-0
sdk/sdk.go
sdk/sdk.go
+1
-1
No files found.
sandbox/runtime_client.go
View file @
37d72bd5
...
...
@@ -132,8 +132,7 @@ func (r *RuntimeClient) PutMsgWithNotify(msg *protogo.DockerVMMessage,
// PutMsg put msg to send channel
func
(
r
*
RuntimeClient
)
PutMsg
(
msg
*
protogo
.
DockerVMMessage
)
{
r
.
logger
.
Debugf
(
"put msg to sendMsgCh, txId [%s], msgType [%s], chan len: [%d]"
,
msg
.
TxId
,
msg
.
Type
,
len
(
r
.
sendMsgCh
))
r
.
logger
.
Debugf
(
"put msg to sendMsgCh, txId [%s], chan len: [%d]"
,
msg
.
TxId
,
len
(
r
.
sendMsgCh
))
r
.
sendMsgCh
<-
msg
}
...
...
sandbox/tx_handler.go
View file @
37d72bd5
...
...
@@ -17,9 +17,6 @@ import (
)
const
(
_dockerGoMethodInitContract
=
"InitContract"
_dockerGoMethodUpgradeContract
=
"UpgradeContract"
_initContract
=
"init_contract"
_upgradeContract
=
"upgrade"
_invokeContract
=
"invoke_contract"
//Compatible with version < 2.3.0
...
...
@@ -92,7 +89,7 @@ func (h *TxHandler) listenPendingQueue() error {
for
{
select
{
case
msg
:=
<-
h
.
pendingQueue
:
h
.
sandboxLogger
.
Debugf
(
"get msg from pending queue, txId:
[%s], msgType:
[%s]"
,
msg
.
TxId
,
msg
.
Type
)
h
.
sandboxLogger
.
Debugf
(
"get msg from pending queue, txId: [%s]"
,
msg
.
TxId
)
if
err
:=
h
.
handleTxRequest
(
msg
);
err
!=
nil
{
errCh
<-
err
}
...
...
@@ -204,7 +201,7 @@ func (h *TxHandler) handleTxRequest(msg *protogo.DockerVMMessage) error {
txResponse
.
WriteMap
=
nil
txResponse
.
ReadMap
=
nil
txResponse
.
Events
=
nil
if
method
==
_
dockerGoMethodI
nitContract
||
method
==
_
dockerGoMethodU
pgradeContract
{
if
method
==
_
i
nitContract
||
method
==
_
u
pgradeContract
{
signal
.
Type
=
protogo
.
DockerVMType_ERROR
}
}
...
...
sdk/response.go
View file @
37d72bd5
...
...
@@ -28,6 +28,14 @@ func Success(payload []byte) protogo.Response {
}
}
// Success normal
func
SuccessNormal
()
protogo
.
Response
{
return
protogo
.
Response
{
Status
:
OK
,
Payload
:
[]
byte
(
"success"
),
}
}
// Error ...
func
Error
(
msg
string
)
protogo
.
Response
{
return
protogo
.
Response
{
...
...
sdk/sdk.go
View file @
37d72bd5
...
...
@@ -684,7 +684,7 @@ func (s *SDK) CallContract(contractName, method string, args map[string][]byte)
return
protogo
.
Response
{
Status
:
ERROR
,
Message
:
result
.
SysCallMessage
.
Message
,
Payload
:
nil
,
Payload
:
result
.
SysCallMessage
.
Payload
[
KeyCallContractResp
]
,
}
}
...
...
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