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§
Sourcefn get_channel_basepoints(&self) -> ChannelPublicKeys
fn get_channel_basepoints(&self) -> ChannelPublicKeys
Get the channel basepoints and public keys
Sourcefn get_per_commitment_point(
&self,
commitment_number: u64,
) -> Result<PublicKey, Status>
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.
Sourcefn get_per_commitment_secret(
&self,
commitment_number: u64,
) -> Result<SecretKey, Status>
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.
Sourcefn get_per_commitment_secret_or_none(
&self,
commitment_number: u64,
) -> Option<SecretKey>
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