lamarge 0.8.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
use super::*;

#[test]
fn next_cursor_is_required_but_nullable() {
    let last: Page<u8> =
        serde_json::from_str(r#"{"data":[1],"next_cursor":null,"has_more":false}"#).unwrap();
    assert_eq!(last.next_cursor, None);
    let page: Page<u8> =
        serde_json::from_str(r#"{"data":[],"next_cursor":"c","has_more":true}"#).unwrap();
    assert_eq!(page.next_cursor.as_ref().map(PageCursor::as_str), Some("c"));
    assert!(serde_json::from_str::<Page<u8>>(r#"{"data":[],"has_more":false}"#).is_err());
}