Skip to content

Commit 3bf52bf

Browse files
authored
Action types (#191)
<!-- ps-id: 6cc3715d-71d8-406a-81ca-b2bd1d22b1e5 -->
1 parent 99925e9 commit 3bf52bf

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

crates/node-types/src/action.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//! # Action
2+
//!
3+
//! Actions use predicates to generate solutions.
4+
5+
use essential_types::{PredicateAddress, Value};
6+
7+
/// Actions represent are used as the input to solve a predicate
8+
/// and generate a [`Solution`](essential_types::Solution).
9+
pub struct Action {
10+
/// The predicate that will be solved by this action.
11+
pub predicate_to_solve: PredicateAddress,
12+
/// The inputs to the predicate.
13+
pub inputs: Vec<Value>,
14+
}
15+
16+
/// An atomic unordered set of actions.
17+
/// These all occur at the same time.
18+
/// It is invalid for the solutions generated
19+
/// by these actions to mutate the same keys.
20+
pub struct ActionSet {
21+
/// An unordered set of actions.
22+
pub actions: Vec<Action>,
23+
}

crates/node-types/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use essential_types::{
1414
};
1515
use serde::{Deserialize, Serialize};
1616

17+
pub mod action;
1718
pub mod block;
1819

1920
/// Wrappers around tokio's `watch` channel for notifying of new blocks.

0 commit comments

Comments
 (0)