lamarge 0.9.0

Client for the LaMarge API: sign-in, takes, transfers, withdrawals and market making, each request checked before it is signed.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::*;
use crate::model::TakePreparation;

#[test]
fn debug_never_shows_a_claim_secret_even_nested() {
    let mut fill: serde_json::Value =
        crate::testing::json::fixture("take_preparation/take/fills/0");
    fill["secret"] = format!("0x{}", "7a".repeat(32)).into();
    let mut preparation: serde_json::Value = crate::testing::json::fixture("take_preparation");
    preparation["take"]["fills"] = serde_json::json!([fill.clone()]);
    let fill: Fill = serde_json::from_value(fill).unwrap();
    let preparation: TakePreparation = serde_json::from_value(preparation).unwrap();
    assert_eq!(fill.secret.unwrap().expose_secret(), &B256::repeat_byte(0x7a));
    for debug in [format!("{fill:?}"), format!("{preparation:#?}")] {
        assert!(debug.contains("ClaimSecret(****)"), "{debug}");
        assert!(!debug.contains("7a7a") && !debug.contains("122, 122"), "{debug}");
    }
}