1a3c1fa466
* standarise lp serialisation: - stop using bincode within `LpMessage` in favour of predictable bytes concatenation - use consistent encode/decode interface for every `LpMessage` inner variant - hide usage of bincode within `LpRegistrationResponse` / `LpRegistrationResponse` behind `serialise` / `try_deserialise` interface * reduced 'target_lp_address' len encoding space from u32 to u16
17 lines
530 B
Rust
17 lines
530 B
Rust
// Copyright 2026 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
use bincode::Options;
|
|
|
|
pub use bincode::Error as BincodeError;
|
|
pub use bincode::Options as BincodeOptions;
|
|
|
|
/// Create explicit bincode options for consistent serialization across versions.
|
|
///
|
|
/// Using explicit options future-proofs against bincode 1.x/2.x default changes.
|
|
pub fn lp_bincode_serializer() -> impl BincodeOptions {
|
|
bincode::DefaultOptions::new()
|
|
.with_big_endian()
|
|
.with_varint_encoding()
|
|
}
|