diff --git a/libparsec/crates/protocol/tests/authenticated_cmds/v4/shamir_recovery_setup.rs b/libparsec/crates/protocol/tests/authenticated_cmds/v4/shamir_recovery_setup.rs index 5cc4d94aa0f..10a7b4c0f46 100644 --- a/libparsec/crates/protocol/tests/authenticated_cmds/v4/shamir_recovery_setup.rs +++ b/libparsec/crates/protocol/tests/authenticated_cmds/v4/shamir_recovery_setup.rs @@ -7,7 +7,7 @@ use libparsec_types::{DateTime, ShamirRevealToken}; use super::authenticated_cmds; -macro_rules! test_de_serialization { +macro_rules! test_roundtrip_serialization { ($encoded:literal, $expected:path, $load:path) => { let raw = hex!($encoded); let data = $load(&raw).unwrap(); @@ -39,7 +39,7 @@ pub fn rep_shamir_setup_already_exists() { // Generated from Rust implementation (Parsec v3.0.0-b.6+dev 2024-06-06) // Content: // "status": "shamir_setup_already_exist" - test_de_serialization!( + test_roundtrip_serialization!( "81a6737461747573bb7368616d69725f73657475705f616c72656164795f6578697374 \ 73", authenticated_cmds::shamir_recovery_setup::Rep::ShamirSetupAlreadyExists, @@ -51,7 +51,7 @@ pub fn rep_brief_invalid_data() { // Generated from Rust implementation (Parsec v3.0.0-b.6+dev 2024-06-06) // Content: // "status": "brief_invalid_data" - test_de_serialization!( + test_roundtrip_serialization!( "81a6737461747573b262726965665f696e76616c69645f64617461", authenticated_cmds::shamir_recovery_setup::Rep::BriefInvalidData, authenticated_cmds::shamir_recovery_setup::Rep::load @@ -61,7 +61,7 @@ pub fn rep_share_invalid_data() { // Generated from Rust implementation (Parsec v3.0.0-b.6+dev 2024-06-06) // Content: // "status": "share_invalid_data" - test_de_serialization!( + test_roundtrip_serialization!( "81a6737461747573b273686172655f696e76616c69645f64617461", authenticated_cmds::shamir_recovery_setup::Rep::ShareInvalidData, authenticated_cmds::shamir_recovery_setup::Rep::load @@ -71,7 +71,7 @@ pub fn rep_invalid_recipient() { // Generated from Rust implementation (Parsec v3.0.0-b.6+dev 2024-06-06) // Content: // "status": "invalid_recipient" - test_de_serialization!( + test_roundtrip_serialization!( "81a6737461747573b1696e76616c69645f726563697069656e74", authenticated_cmds::shamir_recovery_setup::Rep::InvalidRecipient, authenticated_cmds::shamir_recovery_setup::Rep::load @@ -81,7 +81,7 @@ pub fn rep_share_recipient_not_in_brief() { // Generated from Rust implementation (Parsec v3.0.0-b.6+dev 2024-06-06) // Content: // "status": "share_recipient_not_in_brief" - test_de_serialization!( + test_roundtrip_serialization!( "81a6737461747573bc73686172655f726563697069656e745f6e6f745f696e5f627269 \ 6566", authenticated_cmds::shamir_recovery_setup::Rep::ShareRecipientNotInBrief, @@ -92,7 +92,7 @@ pub fn rep_duplicate_share_for_recipient() { // Generated from Rust implementation (Parsec v3.0.0-b.6+dev 2024-06-06) // Content: // "status": "duplicate_share_for_recipient" - test_de_serialization!( + test_roundtrip_serialization!( "81a6737461747573bd6475706c69636174655f73686172655f666f725f726563697069 \ 656e74", authenticated_cmds::shamir_recovery_setup::Rep::DuplicateShareForRecipient, @@ -103,7 +103,7 @@ pub fn rep_author_included_as_recipient() { // Generated from Rust implementation (Parsec v3.0.0-b.6+dev 2024-06-06) // Content: // "status": "author_included_as_recipient" - test_de_serialization!( + test_roundtrip_serialization!( "81a6737461747573bc617574686f725f696e636c756465645f61735f72656369706965 \ 6e74", authenticated_cmds::shamir_recovery_setup::Rep::AuthorIncludedAsRecipient, @@ -114,7 +114,7 @@ pub fn rep_missing_share_for_recipient() { // Generated from Rust implementation (Parsec v3.0.0-b.6+dev 2024-06-06) // Content: // "status": "missing_share_for_recipient" - test_de_serialization!( + test_roundtrip_serialization!( "81a6737461747573bb6d697373696e675f73686172655f666f725f726563697069656e \ 74", authenticated_cmds::shamir_recovery_setup::Rep::MissingShareForRecipient, @@ -125,7 +125,7 @@ pub fn rep_threshold_greater_than_total_shares() { // Generated from Rust implementation (Parsec v3.0.0-b.6+dev 2024-06-06) // Content: // "status": "threshold_greater_than_total_shares" - test_de_serialization!( + test_roundtrip_serialization!( "81a6737461747573d9237468726573686f6c645f677265617465725f7468616e5f746f \ 74616c5f736861726573", authenticated_cmds::shamir_recovery_setup::Rep::ThresholdGreaterThanTotalShares, @@ -148,7 +148,7 @@ pub fn rep_timestamp_out_of_ballpark() { client_timestamp: dt, server_timestamp: dt, }; - test_de_serialization!( + test_roundtrip_serialization!( "85a6737461747573b974696d657374616d705f6f75745f6f665f62616c6c7061726bbc \ 62616c6c7061726b5f636c69656e745f6561726c795f6f6666736574cb404000000000 \ 0000bb62616c6c7061726b5f636c69656e745f6c6174655f6f6666736574cb40400000 \ @@ -167,7 +167,7 @@ pub fn rep_require_greater_timestamp() { let req = authenticated_cmds::shamir_recovery_setup::Rep::RequireGreaterTimestamp { strictly_greater_than: DateTime::from_f64_with_us_precision(1234567890.), }; - test_de_serialization!( + test_roundtrip_serialization!( "82a6737461747573b9726571756972655f677265617465725f74696d657374616d70b5 \ 7374726963746c795f677265617465725f7468616ed70141d26580b4800000", req, @@ -179,7 +179,7 @@ pub fn rep_ok() { // Generated from Rust implementation (Parsec v3.0.0-b.6+dev 2024-05-29) // Content: // "status": "ok" - test_de_serialization!( + test_roundtrip_serialization!( "81a6737461747573a26f6b", authenticated_cmds::shamir_recovery_setup::Rep::Ok, authenticated_cmds::shamir_recovery_setup::Rep::load