aboutsummaryrefslogtreecommitdiff
path: root/include/hotstuff/client.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/hotstuff/client.h')
-rw-r--r--include/hotstuff/client.h27
1 files changed, 13 insertions, 14 deletions
diff --git a/include/hotstuff/client.h b/include/hotstuff/client.h
index 95a003d..92b4eec 100644
--- a/include/hotstuff/client.h
+++ b/include/hotstuff/client.h
@@ -8,22 +8,21 @@
namespace hotstuff {
-enum {
- REQ_CMD = 0x4,
- RESP_CMD = 0x5,
- CHK_CMD = 0x6
+struct MsgReqCmd {
+ static const opcode_t opcode = 0x4;
+ DataStream serialized;
+ command_t cmd;
+ MsgReqCmd(const Command &cmd);
+ MsgReqCmd(DataStream &&s): serialized(std::move(s)) {}
+ void postponed_parse(HotStuffCore *hsc);
};
-struct MsgClient: public salticidae::MsgBase<> {
- using MsgBase::MsgBase;
- void gen_reqcmd(const Command &cmd);
- void parse_reqcmd(command_t &cmd, HotStuffCore *hsc) const;
-
- void gen_respcmd(const Finality &fin);
- void parse_respcmd(Finality &fin) const;
-
- void gen_chkcmd(const uint256_t &cmd_hash);
- void parse_chkcmd(uint256_t &cmd_hash) const;
+struct MsgRespCmd {
+ static const opcode_t opcode = 0x5;
+ DataStream serialized;
+ Finality fin;
+ MsgRespCmd(const Finality &fin);
+ MsgRespCmd(DataStream &&s);
};
class CommandDummy: public Command {