Merge request and command types
parent
b4ff7f0648
commit
a53f743fb9
|
@ -295,7 +295,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "raas_types"
|
||||
version = "0.0.4"
|
||||
version = "0.0.5"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"prost",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "raas_types"
|
||||
version = "0.0.4"
|
||||
version = "0.0.5"
|
||||
edition = "2021"
|
||||
description = "Protobuf definitions for RaaS"
|
||||
authors = ["Joey Hines joey@ahines.net"]
|
||||
|
|
|
@ -6,10 +6,7 @@ package raas.cmd;
|
|||
|
||||
message Command {
|
||||
uint32 id = 1;
|
||||
uint64 timestamp = 2;
|
||||
oneof cmd {
|
||||
raas.bot.roll.RollCmd roll_cmd = 3;
|
||||
}
|
||||
Request request = 2;
|
||||
}
|
||||
|
||||
message Request {
|
||||
|
|
|
@ -126,18 +126,16 @@ mod test {
|
|||
use tokio::io::BufReader;
|
||||
|
||||
#[test]
|
||||
fn create_cmd() {
|
||||
let cmd = raas::cmd::Command {
|
||||
id: 0,
|
||||
fn create_request() {
|
||||
let cmd = raas::cmd::Request {
|
||||
timestamp: 0,
|
||||
cmd: Some(raas::cmd::command::Cmd::RollCmd(raas::bot::roll::RollCmd {
|
||||
cmd: Some(raas::cmd::request::Cmd::RollCmd(raas::bot::roll::RollCmd {
|
||||
cmd: Some(raas::bot::roll::roll_cmd::Cmd::Roll(
|
||||
raas::bot::roll::Roll { rotations: 1 },
|
||||
)),
|
||||
})),
|
||||
};
|
||||
|
||||
assert_eq!(cmd.id, 0);
|
||||
assert_eq!(cmd.timestamp, 0);
|
||||
assert!(cmd.cmd.is_some());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue