Skip to main content

Module serde_helpers

Module serde_helpers 

Source
Expand description

Field-level serde helpers for address-based transition fields.

These helpers reshape the JSON / wasm Object output of BTreeMap<PlatformAddress, _> and Option<(PlatformAddress, _)> fields from an opaque map-of-tuples into a self-describing array (or single object) of { address, nonce?, amount? } entries.

Only serde JSON / platform_value output is affected — the bincode Encode / Decode derives on the parent transitions are independent of serde and remain unchanged, so consensus binary format and PlatformSignable sighash are intentionally untouched. Same safety argument as the custom-serde change applied to AddressFundsFeeStrategyStep.

Each helper exposes pub fn serialize and pub fn deserialize so it can be attached to a struct field via #[serde(with = "...")].

Module gating lives on the parent re-export in address_funds/mod.rs (#[cfg(feature = "json-conversion")]), so this file does not need its own inner #![cfg(...)] attribute.

Modules§

address_input_map
#[serde(with = "address_input_map")] helper.
address_output_map_optional_amount
#[serde(with = "address_output_map_optional_amount")] helper.
address_output_map_required_amount
#[serde(with = "address_output_map_required_amount")] helper.
address_output_singular
#[serde(with = "address_output_singular")] helper.