Drop some unnecessary lifetime specifiers in return type definitions
[rust-lightning] / lightning / src / chain / keysinterface.rs
index b7583bb1f7b267e33a2e7b9f6ad4ecefb0eef124..c4045e9c60c4e96aa6989ab0cb48f4e90ed992e4 100644 (file)
@@ -195,22 +195,10 @@ impl Readable for SpendableOutputDescriptor {
 // TODO: We should remove Clone by instead requesting a new ChannelKeys copy when we create
 // ChannelMonitors instead of expecting to clone the one out of the Channel into the monitors.
 pub trait ChannelKeys : Send+Clone {
-       /// Gets the private key for the anchor tx
-       fn funding_key<'a>(&'a self) -> &'a SecretKey;
-       /// Gets the local secret key for blinded revocation pubkey
-       fn revocation_base_key<'a>(&'a self) -> &'a SecretKey;
-       /// Gets the local secret key used in the to_remote output of remote commitment tx (ie the
-       /// output to us in transactions our counterparty broadcasts).
-       /// Also as part of obscured commitment number.
-       fn payment_key<'a>(&'a self) -> &'a SecretKey;
-       /// Gets the local secret key used in HTLC-Success/HTLC-Timeout txn and to_local output
-       fn delayed_payment_base_key<'a>(&'a self) -> &'a SecretKey;
-       /// Gets the local htlc secret key used in commitment tx htlc outputs
-       fn htlc_base_key<'a>(&'a self) -> &'a SecretKey;
        /// Gets the commitment seed
-       fn commitment_seed<'a>(&'a self) -> &'a [u8; 32];
+       fn commitment_seed(&self) -> &[u8; 32];
        /// Gets the local channel public keys and basepoints
-       fn pubkeys<'a>(&'a self) -> &'a ChannelPublicKeys;
+       fn pubkeys(&self) -> &ChannelPublicKeys;
        /// Gets arbitrary identifiers describing the set of keys which are provided back to you in
        /// some SpendableOutputDescriptor types. These should be sufficient to identify this
        /// ChannelKeys object uniquely and lookup or re-derive its keys.
@@ -223,7 +211,7 @@ pub trait ChannelKeys : Send+Clone {
        // TODO: Document the things someone using this interface should enforce before signing.
        // TODO: Add more input vars to enable better checking (preferably removing commitment_tx and
        // making the callee generate it via some util function we expose)!
-       fn sign_remote_commitment<T: secp256k1::Signing + secp256k1::Verification>(&self, feerate_per_kw: u64, commitment_tx: &Transaction, keys: &TxCreationKeys, htlcs: &[&HTLCOutputInCommitment], to_self_delay: u16, secp_ctx: &Secp256k1<T>) -> Result<(Signature, Vec<Signature>), ()>;
+       fn sign_remote_commitment<T: secp256k1::Signing + secp256k1::Verification>(&self, feerate_per_kw: u32, commitment_tx: &Transaction, keys: &TxCreationKeys, htlcs: &[&HTLCOutputInCommitment], to_self_delay: u16, secp_ctx: &Secp256k1<T>) -> Result<(Signature, Vec<Signature>), ()>;
 
        /// Create a signature for a local commitment transaction. This will only ever be called with
        /// the same local_commitment_tx (or a copy thereof), though there are currently no guarantees
@@ -416,16 +404,11 @@ impl InMemoryChannelKeys {
 }
 
 impl ChannelKeys for InMemoryChannelKeys {
-       fn funding_key(&self) -> &SecretKey { &self.funding_key }
-       fn revocation_base_key(&self) -> &SecretKey { &self.revocation_base_key }
-       fn payment_key(&self) -> &SecretKey { &self.payment_key }
-       fn delayed_payment_base_key(&self) -> &SecretKey { &self.delayed_payment_base_key }
-       fn htlc_base_key(&self) -> &SecretKey { &self.htlc_base_key }
        fn commitment_seed(&self) -> &[u8; 32] { &self.commitment_seed }
-       fn pubkeys<'a>(&'a self) -> &'a ChannelPublicKeys { &self.local_channel_pubkeys }
+       fn pubkeys(&self) -> &ChannelPublicKeys { &self.local_channel_pubkeys }
        fn key_derivation_params(&self) -> (u64, u64) { self.key_derivation_params }
 
-       fn sign_remote_commitment<T: secp256k1::Signing + secp256k1::Verification>(&self, feerate_per_kw: u64, commitment_tx: &Transaction, keys: &TxCreationKeys, htlcs: &[&HTLCOutputInCommitment], to_self_delay: u16, secp_ctx: &Secp256k1<T>) -> Result<(Signature, Vec<Signature>), ()> {
+       fn sign_remote_commitment<T: secp256k1::Signing + secp256k1::Verification>(&self, feerate_per_kw: u32, commitment_tx: &Transaction, keys: &TxCreationKeys, htlcs: &[&HTLCOutputInCommitment], to_self_delay: u16, secp_ctx: &Secp256k1<T>) -> Result<(Signature, Vec<Signature>), ()> {
                if commitment_tx.input.len() != 1 { return Err(()); }
 
                let funding_pubkey = PublicKey::from_secret_key(secp_ctx, &self.funding_key);