Trait ChannelBase

Source
pub trait ChannelBase: Any {
    // Required methods
    fn get_channel_basepoints(&self) -> ChannelPublicKeys;
    fn get_per_commitment_point(
        &self,
        commitment_number: u64,
    ) -> Result<PublicKey, Status>;
    fn get_per_commitment_secret(
        &self,
        commitment_number: u64,
    ) -> Result<SecretKey, Status>;
    fn get_per_commitment_secret_or_none(
        &self,
        commitment_number: u64,
    ) -> Option<SecretKey>;
    fn check_future_secret(
        &self,
        commit_num: u64,
        suggested: &SecretKey,
    ) -> Result<bool, Status>;
    fn validator(&self) -> Arc<dyn Validator>;
    fn chaninfo(&self) -> SlotInfo;
}
Expand description

A trait implemented by both channel states. See ChannelSlot

Required Methods§

Source

fn get_channel_basepoints(&self) -> ChannelPublicKeys

Get the channel basepoints and public keys

Source

fn get_per_commitment_point( &self, commitment_number: u64, ) -> Result<PublicKey, Status>

Get the per-commitment point for a holder commitment transaction. Errors if the commitment number is too high given the current state.

Source

fn get_per_commitment_secret( &self, commitment_number: u64, ) -> Result<SecretKey, Status>

Get the per-commitment secret for a holder commitment transaction Errors if the commitment number is not ready to be revoked given the current state.

Source

fn get_per_commitment_secret_or_none( &self, commitment_number: u64, ) -> Option<SecretKey>

Get the per-commitment secret or None if the arg is out of range

Source

fn check_future_secret( &self, commit_num: u64, suggested: &SecretKey, ) -> Result<bool, Status>

Check a future secret to support option_data_loss_protect

Source

fn validator(&self) -> Arc<dyn Validator>

Returns the validator for this channel

Source

fn chaninfo(&self) -> SlotInfo

Channel information for logging

Implementors§