X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Futil%2Ftest_channel_signer.rs;h=c57c5a9d6fd12b2330f587ed0ea8949cf6124eb0;hb=5fdc770b4641bc260f33174341f44ae148d118e3;hp=2fb1c494f93f4141210225817fdf5f07ebc49644;hpb=448b191fec4c6d1e9638c82aade7385b1516aa5d;p=rust-lightning diff --git a/lightning/src/util/test_channel_signer.rs b/lightning/src/util/test_channel_signer.rs index 2fb1c494..c57c5a9d 100644 --- a/lightning/src/util/test_channel_signer.rs +++ b/lightning/src/util/test_channel_signer.rs @@ -88,7 +88,7 @@ impl TestChannelSigner { } } - pub fn channel_type_features(&self) -> &ChannelTypeFeatures { self.inner.channel_type_features() } + pub fn channel_type_features(&self) -> &ChannelTypeFeatures { self.inner.channel_type_features().unwrap() } #[cfg(test)] pub fn get_enforcement_state(&self) -> MutexGuard { @@ -158,7 +158,7 @@ impl EcdsaChannelSigner for TestChannelSigner { fn sign_holder_commitment_and_htlcs(&self, commitment_tx: &HolderCommitmentTransaction, secp_ctx: &Secp256k1) -> Result<(Signature, Vec), ()> { let trusted_tx = self.verify_holder_commitment_tx(commitment_tx, secp_ctx); let commitment_txid = trusted_tx.txid(); - let holder_csv = self.inner.counterparty_selected_contest_delay(); + let holder_csv = self.inner.counterparty_selected_contest_delay().unwrap(); let state = self.state.lock().unwrap(); let commitment_number = trusted_tx.commitment_number(); @@ -219,7 +219,7 @@ impl EcdsaChannelSigner for TestChannelSigner { } fn sign_closing_transaction(&self, closing_tx: &ClosingTransaction, secp_ctx: &Secp256k1) -> Result { - closing_tx.verify(self.inner.funding_outpoint().into_bitcoin_outpoint()) + closing_tx.verify(self.inner.funding_outpoint().unwrap().into_bitcoin_outpoint()) .expect("derived different closing transaction"); Ok(self.inner.sign_closing_transaction(closing_tx, secp_ctx).unwrap()) } @@ -256,15 +256,17 @@ impl Writeable for TestChannelSigner { impl TestChannelSigner { fn verify_counterparty_commitment_tx<'a, T: secp256k1::Signing + secp256k1::Verification>(&self, commitment_tx: &'a CommitmentTransaction, secp_ctx: &Secp256k1) -> TrustedCommitmentTransaction<'a> { - commitment_tx.verify(&self.inner.get_channel_parameters().as_counterparty_broadcastable(), - self.inner.counterparty_pubkeys(), self.inner.pubkeys(), secp_ctx) - .expect("derived different per-tx keys or built transaction") + commitment_tx.verify( + &self.inner.get_channel_parameters().unwrap().as_counterparty_broadcastable(), + self.inner.counterparty_pubkeys().unwrap(), self.inner.pubkeys(), secp_ctx + ).expect("derived different per-tx keys or built transaction") } fn verify_holder_commitment_tx<'a, T: secp256k1::Signing + secp256k1::Verification>(&self, commitment_tx: &'a CommitmentTransaction, secp_ctx: &Secp256k1) -> TrustedCommitmentTransaction<'a> { - commitment_tx.verify(&self.inner.get_channel_parameters().as_holder_broadcastable(), - self.inner.pubkeys(), self.inner.counterparty_pubkeys(), secp_ctx) - .expect("derived different per-tx keys or built transaction") + commitment_tx.verify( + &self.inner.get_channel_parameters().unwrap().as_holder_broadcastable(), + self.inner.pubkeys(), self.inner.counterparty_pubkeys().unwrap(), secp_ctx + ).expect("derived different per-tx keys or built transaction") } }