pub struct SetMirrorAdvertiseUrlsParams {
pub urls: Option<Vec<String>>,
}Expand description
control.config.setMirrorAdvertiseUrls params.
§The three states this ONE optional field carries, and why an empty list is refused
None(absent, or JSONnull) CLEARS the override, reverting to dig-node#562’s DERIVED default — this node’s own discovered public address.Some(urls)with at least one entry SETS the override to exactly those URLs.Some(vec![])— an EXPLICIT empty list — is REFUSED as-32602 INVALID_PARAMSrather than silently taken to mean either of the above. It is genuinely ambiguous between “advertise nothing” (forfeiting every mirror reward this node could otherwise earn this epoch) and “go back to automatic” — and guessing wrong either forfeits money the operator did not intend to give up, or silently overrides a deliberate choice to stop advertising. SeeSelf::validated.
Fields§
§urls: Option<Vec<String>>The URLs to advertise, or None to clear the override and revert to the derived default.
See the type doc for why Some(vec![]) is refused rather than accepted as either meaning.
Implementations§
Source§impl SetMirrorAdvertiseUrlsParams
impl SetMirrorAdvertiseUrlsParams
Sourcepub fn validated(self) -> Result<Self, ControlError>
pub fn validated(self) -> Result<Self, ControlError>
Refuse an explicit empty list, and refuse any entry that is not a well-formed absolute URL,
both as -32602 INVALID_PARAMS. None and a non-empty list of well-formed URLs both pass
through unchanged.
Refused rather than guessed at, for the same reason CollateralMarginSetParams::validated
refuses rather than clamps: a caller is stating an intent right now, and silently applying a
different meaning than the one requested would make a subsequent
MirrorAdvertiseView disagree with what the caller believes
it set — on a surface that gates real mirror-coin rewards.
Trait Implementations§
Source§impl Clone for SetMirrorAdvertiseUrlsParams
impl Clone for SetMirrorAdvertiseUrlsParams
Source§fn clone(&self) -> SetMirrorAdvertiseUrlsParams
fn clone(&self) -> SetMirrorAdvertiseUrlsParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more