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 check_future_secret(
        &self,
        commit_num: u64,
        suggested: &SecretKey
    ) -> Result<bool, Status>;
    fn validator(&self) -> Arc<dyn Validator>;
}
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

source

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

Get the per-commitment secret for a holder commitment transaction

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

Implementors§