You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
let valid_until = chrono::DateTime::parse_from_rfc3339("2023-05-20T08:30:45Z").unwrap();
346
+
let min_lifetime = 144;
347
+
let max_client_to_self_delay = 128;
348
+
let min_payment_size_msat = 1;
349
+
let max_payment_size_msat = 100_000_000;
350
+
351
+
let raw = RawOpeningFeeParams{
352
+
min_fee_msat,
353
+
proportional,
354
+
valid_until: valid_until.into(),
355
+
min_lifetime,
356
+
max_client_to_self_delay,
357
+
min_payment_size_msat,
358
+
max_payment_size_msat,
359
+
};
360
+
361
+
let promise_secret = [1u8;32];
362
+
363
+
let opening_fee_params = raw.into_opening_fee_params(&promise_secret);
364
+
let json_str = r#"{"max_client_to_self_delay":128,"max_payment_size_msat":"100000000","min_fee_msat":"100","min_lifetime":144,"min_payment_size_msat":"1","promise":"1134a5c51e3ba2e8f4259610d5e12c1bf4c50ddcd3f8af563e0a00d1fff41dea","proportional":21,"valid_until":"2023-05-20T08:30:45Z"}"#;
let json_str = r#"{"opening_fee_params":{"max_client_to_self_delay":128,"max_payment_size_msat":"100000000","min_fee_msat":"100","min_lifetime":144,"min_payment_size_msat":"1","promise":"1134a5c51e3ba2e8f4259610d5e12c1bf4c50ddcd3f8af563e0a00d1fff41dea","proportional":21,"valid_until":"2023-05-20T08:30:45Z"},"payment_size_msat":"1234"}"#;
let buy_request_variable = BuyRequest{ opening_fee_params, payment_size_msat };
377
+
378
+
// Check we skip serialization if payment_size_msat is None.
379
+
let json_str = r#"{"opening_fee_params":{"max_client_to_self_delay":128,"max_payment_size_msat":"100000000","min_fee_msat":"100","min_lifetime":144,"min_payment_size_msat":"1","promise":"1134a5c51e3ba2e8f4259610d5e12c1bf4c50ddcd3f8af563e0a00d1fff41dea","proportional":21,"valid_until":"2023-05-20T08:30:45Z"}}"#;
// Check we still deserialize correctly if payment_size_msat is 'null'.
384
+
let json_str = r#"{"opening_fee_params":{"max_client_to_self_delay":128,"max_payment_size_msat":"100000000","min_fee_msat":"100","min_lifetime":144,"min_payment_size_msat":"1","promise":"1134a5c51e3ba2e8f4259610d5e12c1bf4c50ddcd3f8af563e0a00d1fff41dea","proportional":21,"valid_until":"2023-05-20T08:30:45Z"},"payment_size_msat":null}"#;
0 commit comments