1 use chain::keysinterface::{ChannelKeys, InMemoryChannelKeys};
3 use secp256k1::key::SecretKey;
5 /// Enforces some rules on ChannelKeys calls. Eventually we will probably want to expose a variant
6 /// of this which would essentially be what you'd want to run on a hardware wallet.
7 pub struct EnforcingChannelKeys {
8 pub inner: InMemoryChannelKeys,
11 impl EnforcingChannelKeys {
12 pub fn new(inner: InMemoryChannelKeys) -> Self {
18 impl ChannelKeys for EnforcingChannelKeys {
19 fn funding_key(&self) -> &SecretKey { self.inner.funding_key() }
20 fn revocation_base_key(&self) -> &SecretKey { self.inner.revocation_base_key() }
21 fn payment_base_key(&self) -> &SecretKey { self.inner.payment_base_key() }
22 fn delayed_payment_base_key(&self) -> &SecretKey { self.inner.delayed_payment_base_key() }
23 fn htlc_base_key(&self) -> &SecretKey { self.inner.htlc_base_key() }
24 fn commitment_seed(&self) -> &[u8; 32] { self.inner.commitment_seed() }
27 impl_writeable!(EnforcingChannelKeys, 0, {