X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Futil%2Ftest_utils.rs;h=c167c3412637408ae4008921ee9360dfc9b7f932;hb=5b59178f894b2bc597f19bab8727b4391cde7b87;hp=153f2f28eed11ffe7e55536c98c191714edb6443;hpb=d3231a23919b49085c09c43d0c1b8f8841e3d23c;p=rust-lightning diff --git a/lightning/src/util/test_utils.rs b/lightning/src/util/test_utils.rs index 153f2f28..c167c341 100644 --- a/lightning/src/util/test_utils.rs +++ b/lightning/src/util/test_utils.rs @@ -32,13 +32,14 @@ use bitcoin::network::constants::Network; use bitcoin::hash_types::{BlockHash, Txid}; use bitcoin::secp256k1::{SecretKey, PublicKey, Secp256k1, Signature}; +use bitcoin::secp256k1::recovery::RecoverableSignature; use regex; -use std::time::Duration; +use core::time::Duration; use std::sync::{Mutex, Arc}; -use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; -use std::{cmp, mem}; +use core::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; +use core::{cmp, mem}; use std::collections::{HashMap, HashSet, VecDeque}; use chain::keysinterface::InMemorySigner; @@ -75,6 +76,7 @@ impl keysinterface::KeysInterface for OnlyReadsKeysInterface { fn read_chan_signer(&self, reader: &[u8]) -> Result { EnforcingSigner::read(&mut std::io::Cursor::new(reader)) } + fn sign_invoice(&self, _invoice_preimage: Vec) -> Result { unreachable!(); } } pub struct TestChainMonitor<'a> { @@ -483,6 +485,10 @@ impl keysinterface::KeysInterface for TestKeysInterface { disable_revocation_policy_check: self.disable_revocation_policy_check, }) } + + fn sign_invoice(&self, invoice_preimage: Vec) -> Result { + self.backing.sign_invoice(invoice_preimage) + } } @@ -618,8 +624,8 @@ impl OnRegisterOutput { } } -impl std::fmt::Debug for OnRegisterOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl core::fmt::Debug for OnRegisterOutput { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { f.debug_struct("OnRegisterOutput") .field("outpoint", &self.outpoint()) .field("script_pubkey", self.script_pubkey())