cala_server/graphql/
convert.rs

1use super::primitives::*;
2
3pub(super) trait ToGlobalId {
4    fn to_global_id(&self) -> async_graphql::types::ID;
5}
6
7impl From<JSON> for cala_ledger::tx_template::Params {
8    fn from(json: JSON) -> Self {
9        let mut map = Self::default();
10        let inner = json.into_inner();
11        if let Some(object) = inner.as_object() {
12            for (k, v) in object {
13                map.insert(k.clone(), v.clone());
14            }
15        }
16        map
17    }
18}