From a87549a4c90c39c8acefc3580b76b56115e955ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E6=97=AD=E9=91=AB?= <15316218227@163.com> Date: Tue, 15 Feb 2022 14:44:17 +0800 Subject: [PATCH] refactor: sdk for consensus algorithm --- .../bdware/server/trustedmodel/ContractExecutor.java | 8 ++++++++ .../org/bdware/server/trustedmodel/MultiReqSeq.java | 11 +++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/main/java/org/bdware/server/trustedmodel/MultiReqSeq.java diff --git a/src/main/java/org/bdware/server/trustedmodel/ContractExecutor.java b/src/main/java/org/bdware/server/trustedmodel/ContractExecutor.java index 1cd23a9..a2f969e 100644 --- a/src/main/java/org/bdware/server/trustedmodel/ContractExecutor.java +++ b/src/main/java/org/bdware/server/trustedmodel/ContractExecutor.java @@ -5,9 +5,17 @@ import org.bdware.sc.conn.Node; import org.bdware.sc.conn.OnHashCallback; import org.bdware.sc.conn.ResultCallback; +import java.util.Map; + public interface ContractExecutor { void execute(String requestID, ContractRequest req, ResultCallback rcb, OnHashCallback hcb); + default void onRecover(Map args) { + } + + default void onDeliverBlock(String data) { + } + default void close() { } diff --git a/src/main/java/org/bdware/server/trustedmodel/MultiReqSeq.java b/src/main/java/org/bdware/server/trustedmodel/MultiReqSeq.java new file mode 100644 index 0000000..9a08e59 --- /dev/null +++ b/src/main/java/org/bdware/server/trustedmodel/MultiReqSeq.java @@ -0,0 +1,11 @@ +package org.bdware.server.trustedmodel; + +public class MultiReqSeq { + public final int seq; + public final long startTime; + + public MultiReqSeq(int s){ + seq = s; + startTime = System.currentTimeMillis(); + } +}