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
50
51
52
53
54
use transistor::client::Crux;
use transistor::types::response::TxLogsResponse;
async fn tx_logs() -> TxLogsResponse {
let body = Crux::new("localhost", "3000")
.http_client()
.tx_logs()
.await
.unwrap();
return body;
}
#[tokio::main]
async fn main() {
let tx_logs = tx_logs().await;
println!("Body = {:#?}", tx_logs);
// Body = TxLogsResponse {
// tx_events: [
// TxLogResponse {
// tx___tx_id: 0,
// tx___tx_time: "2020-07-09T23:38:06.465-00:00",
// tx__event___tx_events: Some(
// [
// [
// ":crux.tx/put",
// "a15f8b81a160b4eebe5c84e9e3b65c87b9b2f18e",
// "125d29eb3bed1bf51d64194601ad4ff93defe0e2",
// ],
// ],
// ),
// },
// TxLogResponse {
// tx___tx_id: 1,
// tx___tx_time: "2020-07-09T23:39:33.815-00:00",
// tx__event___tx_events: Some(
// [
// [
// ":crux.tx/put",
// "a15f8b81a160b4eebe5c84e9e3b65c87b9b2f18e",
// "1b42e0d5137e3833423f7bb958622bee29f91eee",
// ],
// ],
// ),
// },
// ...
// ]
// }
}
#[tokio::test]
async fn test_tx_logs() {
let tx_logs = tx_logs().await;
assert!(tx_logs.tx_events.len() > 0)
}