Sigil documentation
ReferenceRust referencesigil-sdk

sigil-sdk · gal_adapter

Source declarations, signatures and documentation for gal_adapter.

Source: sigil/node/sigil-sdk/src/gal_adapter.rs. SHA-256: 112592422588ed8ce1147b668a9d5d3dc34b8a217c66db583c02b3227ab3a4b4.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

Module condition:

#[cfg(feature = "gal")]

gal_adapter::FinalizedBlockFuture

Future returned by [FinalizedBlockSource::Dynamic] closures.

#[cfg(feature = "gal")]
pub type FinalizedBlockFuture<'a> =
    Pin<Box<dyn Future<Output = Result<u64, AnchorError>> + Send + 'a>>;

Source line: 24.

gal_adapter::MarsToOasGalSource

Wraps any mars_protocol::SigilAnchorClient and exposes it as an oas_resolve::LineageAnchor. Resolvers built on top of this adapter transparently pick up production Sigil RPC, the in-memory mock, or any other SigilAnchorClient implementation.

#[cfg(feature = "gal")]
pub struct MarsToOasGalSource {

}

Source line: 31.

gal_adapter::FinalizedBlockSource

How the adapter discovers the current finalized block. This avoids a hard dependency on a specific RPC method name; callers either supply a live closure (production: query sigil_getLatestBlock and return its height) or pin a fixed value (tests).

#[cfg(feature = "gal")]
pub enum FinalizedBlockSource {
    /// Use a fixed value. Useful for tests and for staging environments
    /// that already pin a head.
    Fixed(u64),
    /// Resolve the value lazily on every call. The closure is async to
    /// allow it to perform a Sigil RPC `sigil_getLatestBlock` call.
    Dynamic(Arc<dyn Fn() -> FinalizedBlockFuture<'static> + Send + Sync>),
}

Source line: 40.

gal_adapter::MarsToOasGalSource::with_fixed_block

Build an adapter with a static finalized-block height. Useful for tests and for environments where the head height is supplied out-of-band.

#[cfg(feature = "gal")]
pub fn with_fixed_block(client: Arc<dyn SigilAnchorClient>, block: u64) -> Self;

Source line: 53.

gal_adapter::MarsToOasGalSource::with_dynamic_block

Build an adapter with a dynamic finalized-block source.

#[cfg(feature = "gal")]
pub fn with_dynamic_block(
        client: Arc<dyn SigilAnchorClient>,
        source: FinalizedBlockSource,
    ) -> Self;

Source line: 61.

On this page