Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: assert number of payload values
Erik Kundt committed 6 months ago
commit 42525c40a85f603f1577ef9f00d1a26446b604d2
parent 08c29fb4bd138c5e1c1db67506ca957e011ce0dd
1 file changed +4 -0
modified crates/radicle-cli/src/commands/id/args.rs
@@ -48,6 +48,10 @@ impl Payload {
    ) -> impl Iterator<Item = Result<Self, PayloadParseError>> + use<'_> {
        // `clap` makes sure we don't have 3 values per option occurence, so we can just
        // chunk the aggregated list
+
        debug_assert!(
+
            values.len() % 3 == 0,
+
            "number of values should be divsible by 3"
+
        );
        values.chunks(3).map(|chunk| {
            Ok(Payload {
                id: PayloadId::from_str(&chunk[0])?,