use edn_derive::Serialize;
use transistor::client::Crux;
use transistor::types::response::TxLogResponse;
use transistor::types::Actions;
use transistor::types::CruxId;
#[cfg(not(feature = "async"))]
fn tx_log() -> TxLogResponse {
let person1 = Person {
crux__db___id: CruxId::new("jorge-3"),
first_name: "Michael".to_string(),
last_name: "Jorge".to_string(),
};
let person2 = Person {
crux__db___id: CruxId::new("manuel-1"),
first_name: "Diego".to_string(),
last_name: "Manuel".to_string(),
};
let actions = Actions::new().append_put(person1).append_put(person2);
let body = Crux::new("localhost", "3000")
.http_client()
.tx_log(actions)
.unwrap();
return body;
}
#[test]
#[cfg(not(feature = "async"))]
fn test_tx_log() {
let tx_log = tx_log();
assert!(tx_log.tx___tx_id > 0)
}
#[cfg(not(feature = "async"))]
fn main() {
let body = tx_log();
println!("Body = {:?}", body);
}
#[derive(Debug, Clone, Serialize)]
#[allow(non_snake_case)]
pub struct Person {
crux__db___id: CruxId,
first_name: String,
last_name: String,
}