chia_sdk_driver/layers/action_layer/singleton_action.rs
1pub trait ActionSingleton {
2 type State;
3 type Constants;
4}
5
6pub trait SingletonAction<AS: ActionSingleton> {
7 fn from_constants(constants: &AS::Constants) -> Self;
8
9 // you may also add:
10
11 // fn curry_tree_hash(constants: &AS::Constants) -> TreeHash;
12
13 // fn construct_puzzle(&self, ctx: &mut SpendContext) -> Result<NodePtr, DriverError>;
14
15 // fn spend(
16 // self,
17 // ctx: &mut SpendContext,
18 // action_singleton: &Self::ActionSingleton,
19 // params: &Self::SpendParams,
20 // ) -> Result<(Option<Conditions>, Spend, Self::SpendReturnParams), DriverError>;
21
22 // and a function to return the slots this action creates
23}