新注册的用户请输入邮箱并保存,随后登录邮箱激活账号。后续可直接使用邮箱登录!

Commit c3709648 authored by tianle's avatar tianle

Merge branch 'v2.3.1_qc_empty_getstate' into 'v2.3.1_qc' (merge request !53)

v2.3.1_qc_empty_getstate
No related merge requests found
......@@ -25,8 +25,9 @@ import (
)
const (
mountContractDir = "contract-bins"
msgIterIsNil = "iterator is nil"
mountContractDir = "contract-bins"
msgIterIsNil = "iterator is nil"
version2310 uint32 = 2030100
)
var dockerVMMsgPool = sync.Pool{
......
......@@ -335,8 +335,12 @@ func (r *RuntimeInstance) handleGetStateRequest(txId string, recvMsg *protogo.Do
})
response.SysCallMessage.Code = protocol.ContractSdkSignalResultSuccess
response.SysCallMessage.Payload = map[string][]byte{
config.KeyStateValue: value,
// nil value in map[string][]byte will be empty []byte after grpc transfer, old version ignored this problem
if txSimContext.GetBlockVersion() < version2310 || value != nil {
response.SysCallMessage.Payload = map[string][]byte{
config.KeyStateValue: value,
}
}
gasUsed, err = gas.GetStateGasUsed(gasUsed, value)
if err != nil {
......
......@@ -93,6 +93,8 @@ CpIO2ZrxkJ1Nm/FKZzMLQjp7Dm//xEMkpCbqqC6koOkRP2MKGSnEGXGfRr1QgBvr
cmCertAddressFromCert = "305f98514f3c2f6fcaeb8247ed147bacf99990f8"
blockFingerprint = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
version2310 uint32 = 2030100
)
var (
......@@ -665,7 +667,7 @@ func mockGetBlockVersion(simContext *mock.MockTxSimContext) {
// GetBlockVersion get block version
func GetBlockVersion() uint32 {
return uint32(2300)
return version2310
}
// 获取sender公钥
......
......@@ -123,6 +123,9 @@ func TestDockerGoGetState(t *testing.T) {
parameters["field"] = []byte("field1")
parameters["value"] = []byte("500")
method := methodPutState
mockTxContext.EXPECT().GetBlockVersion().DoAndReturn(
GetBlockVersion,
).AnyTimes()
mockPut(mockTxContext, ContractNameTest, protocol.GetKey([]byte("key1"), []byte("field1")), []byte("500"))
result, _ := mockRuntimeInstance.Invoke(mockContractId, method, nil,
......
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