pub struct SpecDiff {Show 13 fields
pub old: WasmSummary,
pub new: WasmSummary,
pub added_functions: Vec<ContractFunction>,
pub removed_functions: Vec<ContractFunction>,
pub changed_functions: Vec<FunctionSignatureChange>,
pub added_events: Vec<String>,
pub removed_events: Vec<String>,
pub changed_events: Vec<EventSignatureChange>,
pub added_types: Vec<String>,
pub removed_types: Vec<String>,
pub changed_types: Vec<TypeDefinitionChange>,
pub size_delta_bytes: i64,
pub size_delta_pct: Option<f64>,
}Expand description
The full comparison result between two contract WASM binaries.
Eq is not derived because size_delta_pct is an Option<f64>.
Fields§
§old: WasmSummaryMetadata of the “old” (baseline) WASM.
new: WasmSummaryMetadata of the “new” (candidate) WASM.
added_functions: Vec<ContractFunction>Functions present in new but absent from old.
removed_functions: Vec<ContractFunction>Functions present in old but absent from new.
changed_functions: Vec<FunctionSignatureChange>Functions present in both whose signature (inputs + outputs) changed.
added_events: Vec<String>Events present in new but absent from old.
removed_events: Vec<String>Events present in old but absent from new.
changed_events: Vec<EventSignatureChange>Events present in both whose signature (prefix topics, params, data format) changed.
added_types: Vec<String>Custom types present in new but absent from old.
removed_types: Vec<String>Custom types present in old but absent from new.
changed_types: Vec<TypeDefinitionChange>Custom types present in both whose definition (kind or members) changed.
size_delta_bytes: i64Signed size change: new.size_bytes - old.size_bytes (negative when the
candidate shrank). Always present; independent of any policy flag.
size_delta_pct: Option<f64>Percentage growth relative to the old artifact, rounded to one decimal
place (e.g. 2157.6). null when the old artifact is zero bytes and
the new one is not — a relative change against an empty baseline is
mathematically undefined, and is never coerced to 0 or infinity.
Both artifacts empty ⇒ Some(0.0).
Implementations§
Source§impl SpecDiff
impl SpecDiff
Sourcepub fn is_identical(&self) -> bool
pub fn is_identical(&self) -> bool
True when the two WASM binaries declare an identical ABI surface (same functions, signatures, events, and custom types).
Sourcepub fn total_changes(&self) -> usize
pub fn total_changes(&self) -> usize
Total number of breaking/non-breaking deltas (a single count used for quick pass/fail triage in CI).