Enforce in type system that a Bundle contains at least one Action

This commit is contained in:
Jack Grigg 2021-02-24 20:07:49 +00:00
parent 693587a402
commit 97d75bab9a
2 changed files with 4 additions and 1 deletions

View File

@ -20,6 +20,7 @@ rustdoc-args = [ "--html-in-header", "katex-header.html" ]
[dependencies]
halo2 = { git = "https://github.com/zcash/halo2.git", branch = "main" }
nonempty = "0.6"
[dev-dependencies]
criterion = "0.3"

View File

@ -1,5 +1,7 @@
//! Structs related to bundles of Orchard actions.
use nonempty::NonEmpty;
use crate::{
circuit::Proof,
note::{EncryptedNote, NoteCommitment, Nullifier},
@ -36,7 +38,7 @@ pub struct Action {
#[derive(Debug)]
pub struct Bundle {
anchor: Anchor,
actions: Vec<Action>,
actions: NonEmpty<Action>,
value_balance: ValueSum,
}