1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
pub mod memo;
pub mod payment;
pub mod signed_command;
use crate::verifiable::Verifiable;
pub use memo::SignedCommandMemo;
pub use payment::PaymentPayload;
pub use signed_command::{
SignedCommand, SignedCommandPayload, SignedCommandPayloadBody, SignedCommandPayloadCommon,
};
use mina_serialization_types::json::UserCommandJson;
use mina_serialization_types_macros::AutoFrom;
use proof_systems::mina_signer::Signer;
use versioned::*;
#[derive(Clone, Eq, PartialEq, Debug, AutoFrom)]
#[auto_from(mina_serialization_types::staged_ledger_diff::UserCommand)]
pub enum UserCommand {
SignedCommand(SignedCommand),
}
impl_from_with_proxy!(
UserCommand,
mina_serialization_types::staged_ledger_diff::UserCommand,
UserCommandJson
);
impl<CTX> Verifiable<CTX> for UserCommand
where
CTX: Signer<SignedCommandPayload>,
{
fn verify(&self, ctx: &mut CTX) -> bool {
match self {
UserCommand::SignedCommand(sc) => sc.verify(ctx),
}
}
}