feat(core):event update
package io.nuls.core.event;
import io.nuls.core.chain.entity.BaseNulsData;
+import io.nuls.core.chain.entity.NulsDigestData;
+import io.nuls.core.chain.entity.NulsSignData;
import io.nuls.core.utils.io.NulsByteBuffer;
import io.nuls.core.utils.io.NulsOutputStreamBuffer;
@@ -13,11 +15,10 @@ import java.io.OutputStream;
*/
public abstract class BaseNulsEvent<T extends BaseNulsData> extends BaseNulsData {
private NulsEventHeader header;
-
+ private NulsDigestData hash;
+ private NulsSignData sign;
private T eventBody;
-
-
public BaseNulsEvent(short moduleId, short eventType, byte[] extend) {
this.header = new NulsEventHeader(moduleId, eventType, extend);
}
@@ -26,7 +27,6 @@ public abstract class BaseNulsEvent<T extends BaseNulsData> extends BaseNulsData
this.header = new NulsEventHeader(moduleId, eventType, null);
}
-
@Override
public final int size() {
if (eventBody != null) {
@@ -68,4 +68,20 @@ public abstract class BaseNulsEvent<T extends BaseNulsData> extends BaseNulsData
public void setHeader(NulsEventHeader header) {
this.header = header;
}
+
+ public NulsDigestData getHash() {
+ return hash;
+ }
+
+ public void setHash(NulsDigestData hash) {
+ this.hash = hash;
+ }
+
+ public NulsSignData getSign() {
+ return sign;
+ }
+
+ public void setSign(NulsSignData sign) {
+ this.sign = sign;
+ }
}
