From a95ad47589661f8ed862ba7347c0ee2cca3a7338 Mon Sep 17 00:00:00 2001 From: wuwei1972 Date: Sat, 13 Apr 2019 11:25:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E6=8F=90=E4=BA=A412---?= =?UTF-8?q?=E5=90=88=E7=BA=A6=E9=83=A8=E7=BD=B2=E6=97=B6=E5=80=99=E7=9A=84?= =?UTF-8?q?ol=E7=9A=84oldvalue=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=88=90ByteString.Empty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/scala/rep/sc/scalax/SandboxScala.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/rep/sc/scalax/SandboxScala.scala b/src/main/scala/rep/sc/scalax/SandboxScala.scala index 00828810..6aa36bce 100644 --- a/src/main/scala/rep/sc/scalax/SandboxScala.scala +++ b/src/main/scala/rep/sc/scalax/SandboxScala.scala @@ -64,18 +64,18 @@ class SandboxScala(cid:ChaincodeId) extends Sandbox(cid){ if(!bRestore){ val txid = serialise(t.id) shim.sr.Put(key_tx,txid) - shim.ol.append(OperLog(key_tx, null, ByteString.copyFrom(txid))) + shim.ol.append(OperLog(key_tx, ByteString.EMPTY, ByteString.copyFrom(txid))) //写入初始状态 val key_tx_state = WorldStateKeyPreFix+ tx_cid + PRE_STATE val state_enable = serialise(true) shim.sr.Put(key_tx_state,state_enable) - shim.ol.append(OperLog(key_tx_state, null, ByteString.copyFrom(state_enable))) + shim.ol.append(OperLog(key_tx_state, ByteString.EMPTY, ByteString.copyFrom(state_enable))) //利用kv记住合约的开发者 val coder_bytes = serialise(coder) shim.sr.Put(key_coder,coder_bytes) - shim.ol.append(OperLog(key_coder, null, ByteString.copyFrom(coder_bytes))) + shim.ol.append(OperLog(key_coder, ByteString.EMPTY, ByteString.copyFrom(coder_bytes))) } new ActionResult(1) //由于Invoke为最频繁调用,因此应尽量避免在处理中I/O读写,比如合约状态的检查就最好在内存中处理