mirror of
https://gitee.com/BDWare/cp.git
synced 2025-01-10 01:44:08 +00:00
fix: _mul misuse bugs
This commit is contained in:
parent
df94bedbae
commit
14db4a8f6c
@ -1165,8 +1165,8 @@ public class ContractProcess {
|
||||
return JsonUtil.toJson(ret);
|
||||
}
|
||||
|
||||
public String getContract() {
|
||||
return JsonUtil.toJson(contract);
|
||||
public Contract getContract() {
|
||||
return contract;
|
||||
}
|
||||
|
||||
public String getPID() {
|
||||
|
@ -5,6 +5,7 @@ import groovy.util.ScriptException;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.bdware.sc.ContractProcess;
|
||||
import org.bdware.sc.bean.ContractExecType;
|
||||
import org.bdware.sc.bean.ContractRequest;
|
||||
import org.bdware.sc.conn.ResultCallback;
|
||||
import org.bdware.sc.conn.SocketGet;
|
||||
@ -240,7 +241,8 @@ public class JavaScriptEntry {
|
||||
app.doSignature(keyPair);
|
||||
app.setRequesterDOI(doi);
|
||||
app.setFromDebug(isDebug);
|
||||
if (numOfCopies > 1) {
|
||||
ContractExecType type = ContractProcess.instance.getContract().getType();
|
||||
if (type.needSeq()) {
|
||||
app.setRequestID(
|
||||
String.format(
|
||||
"%d_%d_%d_%d_mul",
|
||||
|
@ -515,7 +515,7 @@ public class DesktopEngine extends JSEngine {
|
||||
|
||||
List<REvent> msgList = JavaScriptEntry.msgList;
|
||||
JavaScriptEntry.msgList = null;
|
||||
if (!msgList.isEmpty()) {
|
||||
if (msgList != null && !msgList.isEmpty()) {
|
||||
contractRes.events = msgList;
|
||||
contractRes.eventRelated = true;
|
||||
}
|
||||
|
@ -104,8 +104,10 @@ public class ContractHandler extends MsgHandler implements Runnable {
|
||||
|
||||
@Description("set members")
|
||||
public void setMembers(GetMessage msg, ResultCallback cb) {
|
||||
cb.onResult(cs.setMembers(JsonUtil.fromJson(msg.arg,new TypeToken<List<String>>(){}.getType())));
|
||||
cb.onResult(cs.setMembers(JsonUtil.fromJson(msg.arg, new TypeToken<List<String>>() {
|
||||
}.getType())));
|
||||
}
|
||||
|
||||
@Description("get current contract name")
|
||||
public void getContractName(GetMessage msg, ResultCallback cb) {
|
||||
cb.onResult(cs.getContractName());
|
||||
@ -116,7 +118,7 @@ public class ContractHandler extends MsgHandler implements Runnable {
|
||||
cb.onResult(cs.setContract(JsonUtil.fromJson(msg.arg, Contract.class)));
|
||||
}
|
||||
|
||||
@Description(value = "execute contract",isAsync = true)
|
||||
@Description(value = "execute contract", isAsync = true)
|
||||
public void executeContract(GetMessage msg, ResultCallback cb) {
|
||||
cb.onResult(cs.executeContract(msg.arg));
|
||||
}
|
||||
@ -232,7 +234,7 @@ public class ContractHandler extends MsgHandler implements Runnable {
|
||||
|
||||
@Description("get contract")
|
||||
public void getContract(GetMessage msg, ResultCallback cb) {
|
||||
cb.onResult(cs.getContract());
|
||||
cb.onResult(JsonUtil.toJson(cs.getContract()));
|
||||
}
|
||||
|
||||
@Description("setPID")
|
||||
|
Loading…
Reference in New Issue
Block a user