diff --git a/crates/node-types/src/action.rs b/crates/node-types/src/action.rs new file mode 100644 index 0000000..09667d2 --- /dev/null +++ b/crates/node-types/src/action.rs @@ -0,0 +1,23 @@ +//! # Action +//! +//! Actions use predicates to generate solutions. + +use essential_types::{PredicateAddress, Value}; + +/// Actions represent are used as the input to solve a predicate +/// and generate a [`Solution`](essential_types::Solution). +pub struct Action { + /// The predicate that will be solved by this action. + pub predicate_to_solve: PredicateAddress, + /// The inputs to the predicate. + pub inputs: Vec, +} + +/// An atomic unordered set of actions. +/// These all occur at the same time. +/// It is invalid for the solutions generated +/// by these actions to mutate the same keys. +pub struct ActionSet { + /// An unordered set of actions. + pub actions: Vec, +} diff --git a/crates/node-types/src/lib.rs b/crates/node-types/src/lib.rs index 6d0a94d..10f8713 100644 --- a/crates/node-types/src/lib.rs +++ b/crates/node-types/src/lib.rs @@ -14,6 +14,7 @@ use essential_types::{ }; use serde::{Deserialize, Serialize}; +pub mod action; pub mod block; /// Wrappers around tokio's `watch` channel for notifying of new blocks.