aboutsummaryrefslogtreecommitdiff
path: root/include/hotstuff/client.h
diff options
context:
space:
mode:
authorDeterminant <tederminant@gmail.com>2018-07-20 20:09:24 -0400
committerDeterminant <tederminant@gmail.com>2018-07-20 20:09:24 -0400
commit41efd33a3e165ac329f14b6e1cea935076a8b790 (patch)
tree129dc7a6e161edffa35917707df7273a97cf1dfd /include/hotstuff/client.h
parent928b2c1910bfe957a4cc31746aa395c9ed98006f (diff)
improve msg & msg network interface
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 {