Merge request and command types

main
Joey Hines 2024-06-01 15:06:29 -06:00
parent b4ff7f0648
commit a53f743fb9
No known key found for this signature in database
GPG Key ID: 995E531F7A569DDB
4 changed files with 6 additions and 11 deletions

2
Cargo.lock generated
View File

@ -295,7 +295,7 @@ dependencies = [
[[package]]
name = "raas_types"
version = "0.0.4"
version = "0.0.5"
dependencies = [
"bytes",
"prost",

View File

@ -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"]

View File

@ -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 {

View File

@ -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());
}