pub trait ChainAnchor: Send + Sync {
// Required methods
fn anchor(&self, hash: &[u8; 32]) -> Result<AnchorReceipt, String>;
fn verify(&self, receipt: &AnchorReceipt) -> Result<bool, String>;
fn backend_name(&self) -> &str;
}Expand description
Trait for anchoring chain state to an external ledger or store.
Implementations:
MockAnchor— always-succeeds (tests)crate::chain_anchor::FileLedgerAnchor— append-only hash-linked local ledger (production-useful default; WEFT-137)crate::chain_anchor::ExternalLedgerAnchor— external-ledger stub with intent log + endpoint wiring (until a public ledger is chosen)
Frequency policy and config wiring live in
crate::chain_anchor::AnchoringController.
Required Methods§
Sourcefn anchor(&self, hash: &[u8; 32]) -> Result<AnchorReceipt, String>
fn anchor(&self, hash: &[u8; 32]) -> Result<AnchorReceipt, String>
Anchor the given hash to the external backend.
Sourcefn verify(&self, receipt: &AnchorReceipt) -> Result<bool, String>
fn verify(&self, receipt: &AnchorReceipt) -> Result<bool, String>
Verify a previously anchored hash against its receipt.
Sourcefn backend_name(&self) -> &str
fn backend_name(&self) -> &str
Return the backend name for display/logging.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".