ln_gateway::db

Trait GatewayDbtxNcExt

source
pub trait GatewayDbtxNcExt {
Show 15 methods // Required methods async fn save_federation_config(&mut self, config: &FederationConfig); async fn load_federation_configs_v0( &mut self, ) -> BTreeMap<FederationId, FederationConfigV0>; async fn load_federation_configs( &mut self, ) -> BTreeMap<FederationId, FederationConfig>; async fn load_federation_config( &mut self, federation_id: FederationId, ) -> Option<FederationConfig>; async fn remove_federation_config(&mut self, federation_id: FederationId); async fn load_gateway_keypair(&mut self) -> Option<KeyPair>; async fn load_gateway_keypair_assert_exists(&mut self) -> KeyPair; async fn load_or_create_gateway_keypair(&mut self) -> KeyPair; async fn load_gateway_config(&mut self) -> Option<GatewayConfiguration>; async fn set_gateway_config( &mut self, gateway_config: &GatewayConfiguration, ); async fn save_new_preimage_authentication( &mut self, payment_hash: Hash, preimage_auth: Hash, ); async fn load_preimage_authentication( &mut self, payment_hash: Hash, ) -> Option<Hash>; async fn save_registered_incoming_contract( &mut self, federation_id: FederationId, incoming_amount: Amount, contract: IncomingContract, ) -> Option<RegisteredIncomingContract>; async fn load_registered_incoming_contract( &mut self, payment_image: PaymentImage, ) -> Option<RegisteredIncomingContract>; async fn dump_database( &mut self, prefix_names: Vec<String>, ) -> BTreeMap<String, Box<dyn Serialize + Send>>;
}

Required Methods§

source

async fn save_federation_config(&mut self, config: &FederationConfig)

source

async fn load_federation_configs_v0( &mut self, ) -> BTreeMap<FederationId, FederationConfigV0>

source

async fn load_federation_configs( &mut self, ) -> BTreeMap<FederationId, FederationConfig>

source

async fn load_federation_config( &mut self, federation_id: FederationId, ) -> Option<FederationConfig>

source

async fn remove_federation_config(&mut self, federation_id: FederationId)

source

async fn load_gateway_keypair(&mut self) -> Option<KeyPair>

Returns the keypair that uniquely identifies the gateway.

source

async fn load_gateway_keypair_assert_exists(&mut self) -> KeyPair

Returns the keypair that uniquely identifies the gateway.

§Panics

Gateway keypair does not exist.

source

async fn load_or_create_gateway_keypair(&mut self) -> KeyPair

Returns the keypair that uniquely identifies the gateway, creating it if it does not exist. Remember to commit the transaction after calling this method.

source

async fn load_gateway_config(&mut self) -> Option<GatewayConfiguration>

source

async fn set_gateway_config(&mut self, gateway_config: &GatewayConfiguration)

source

async fn save_new_preimage_authentication( &mut self, payment_hash: Hash, preimage_auth: Hash, )

source

async fn load_preimage_authentication( &mut self, payment_hash: Hash, ) -> Option<Hash>

source

async fn save_registered_incoming_contract( &mut self, federation_id: FederationId, incoming_amount: Amount, contract: IncomingContract, ) -> Option<RegisteredIncomingContract>

Saves a registered incoming contract, returning the previous contract with the same payment hash if it existed.

source

async fn load_registered_incoming_contract( &mut self, payment_image: PaymentImage, ) -> Option<RegisteredIncomingContract>

source

async fn dump_database( &mut self, prefix_names: Vec<String>, ) -> BTreeMap<String, Box<dyn Serialize + Send>>

Reads and serializes structures from the gateway’s database for the purpose for serializing to JSON for inspection.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<Cap: Send> GatewayDbtxNcExt for DatabaseTransaction<'_, Cap>

source§

async fn save_federation_config(&mut self, config: &FederationConfig)

source§

async fn load_federation_configs_v0( &mut self, ) -> BTreeMap<FederationId, FederationConfigV0>

source§

async fn load_federation_configs( &mut self, ) -> BTreeMap<FederationId, FederationConfig>

source§

async fn load_federation_config( &mut self, federation_id: FederationId, ) -> Option<FederationConfig>

source§

async fn remove_federation_config(&mut self, federation_id: FederationId)

source§

async fn load_gateway_keypair(&mut self) -> Option<KeyPair>

source§

async fn load_gateway_keypair_assert_exists(&mut self) -> KeyPair

source§

async fn load_or_create_gateway_keypair(&mut self) -> KeyPair

source§

async fn load_gateway_config(&mut self) -> Option<GatewayConfiguration>

source§

async fn set_gateway_config(&mut self, gateway_config: &GatewayConfiguration)

source§

async fn save_new_preimage_authentication( &mut self, payment_hash: Hash, preimage_auth: Hash, )

source§

async fn load_preimage_authentication( &mut self, payment_hash: Hash, ) -> Option<Hash>

source§

async fn save_registered_incoming_contract( &mut self, federation_id: FederationId, incoming_amount: Amount, contract: IncomingContract, ) -> Option<RegisteredIncomingContract>

source§

async fn load_registered_incoming_contract( &mut self, payment_image: PaymentImage, ) -> Option<RegisteredIncomingContract>

source§

async fn dump_database( &mut self, prefix_names: Vec<String>, ) -> BTreeMap<String, Box<dyn Serialize + Send>>

Implementors§