rosetta_types/
coin_action.rs

1/*
2 * Rosetta
3 *
4 * Build Once. Integrate Your Blockchain Everywhere.
5 *
6 * The version of the OpenAPI document: 1.4.13
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// CoinAction : CoinActions are different state changes that a Coin can undergo. When a Coin is created, it is coin_created. When a Coin is spent, it is coin_spent. It is assumed that a single Coin cannot be created or spent more than once.
12
13/// CoinActions are different state changes that a Coin can undergo. When a Coin is created, it is coin_created. When a Coin is spent, it is coin_spent. It is assumed that a single Coin cannot be created or spent more than once.
14#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
15pub enum CoinAction {
16    #[serde(rename = "coin_created")]
17    Created,
18    #[serde(rename = "coin_spent")]
19    Spent,
20}
21
22impl ToString for CoinAction {
23    fn to_string(&self) -> String {
24        match self {
25            Self::Created => String::from("coin_created"),
26            Self::Spent => String::from("coin_spent"),
27        }
28    }
29}
30
31impl Default for CoinAction {
32    fn default() -> CoinAction {
33        Self::Created
34    }
35}