Struct breez_sdk_core::lightning::util::test_utils::TestKeysInterface
pub struct TestKeysInterface {
pub backing: PhantomKeysManager,
pub override_random_bytes: Mutex<Option<[u8; 32]>>,
pub disable_revocation_policy_check: bool,
/* private fields */
}
Fields§
§backing: PhantomKeysManager
§override_random_bytes: Mutex<Option<[u8; 32]>>
§disable_revocation_policy_check: bool
Implementations§
§impl TestKeysInterface
impl TestKeysInterface
pub fn new(seed: &[u8; 32], network: Network) -> TestKeysInterface
pub fn expect(
&self,
expectation: OnGetShutdownScriptpubkey,
) -> &TestKeysInterface
pub fn expect( &self, expectation: OnGetShutdownScriptpubkey, ) -> &TestKeysInterface
Sets an expectation that sign::SignerProvider::get_shutdown_scriptpubkey
is
called.
pub fn derive_channel_keys( &self, channel_value_satoshis: u64, id: &[u8; 32], ) -> TestChannelSigner
Trait Implementations§
§impl EntropySource for TestKeysInterface
impl EntropySource for TestKeysInterface
§fn get_secure_random_bytes(&self) -> [u8; 32]
fn get_secure_random_bytes(&self) -> [u8; 32]
Gets a unique, cryptographically-secure, random 32-byte value. This method must return a
different value each time it is called.
§impl NodeSigner for TestKeysInterface
impl NodeSigner for TestKeysInterface
§fn ecdh(
&self,
recipient: Recipient,
other_key: &PublicKey,
tweak: Option<&Scalar>,
) -> Result<SharedSecret, ()>
fn ecdh( &self, recipient: Recipient, other_key: &PublicKey, tweak: Option<&Scalar>, ) -> Result<SharedSecret, ()>
Gets the ECDH shared secret of our node secret and
other_key
, multiplying by tweak
if
one is provided. Note that this tweak can be applied to other_key
instead of our node
secret, though this is less efficient. Read more§fn get_inbound_payment_key_material(&self) -> KeyMaterial
fn get_inbound_payment_key_material(&self) -> KeyMaterial
Get secret key material as bytes for use in encrypting and decrypting inbound payment data. Read more
§fn sign_invoice(
&self,
hrp_bytes: &[u8],
invoice_data: &[u5],
recipient: Recipient,
) -> Result<RecoverableSignature, ()>
fn sign_invoice( &self, hrp_bytes: &[u8], invoice_data: &[u5], recipient: Recipient, ) -> Result<RecoverableSignature, ()>
Sign an invoice. Read more
§fn sign_bolt12_invoice_request(
&self,
invoice_request: &UnsignedInvoiceRequest,
) -> Result<Signature, ()>
fn sign_bolt12_invoice_request( &self, invoice_request: &UnsignedInvoiceRequest, ) -> Result<Signature, ()>
Signs the
TaggedHash
of a BOLT 12 invoice request. Read more§fn sign_bolt12_invoice(
&self,
invoice: &UnsignedBolt12Invoice,
) -> Result<Signature, ()>
fn sign_bolt12_invoice( &self, invoice: &UnsignedBolt12Invoice, ) -> Result<Signature, ()>
Signs the
TaggedHash
of a BOLT 12 invoice. Read more§fn sign_gossip_message(
&self,
msg: UnsignedGossipMessage<'_>,
) -> Result<Signature, ()>
fn sign_gossip_message( &self, msg: UnsignedGossipMessage<'_>, ) -> Result<Signature, ()>
Sign a gossip message. Read more
§impl SignerProvider for TestKeysInterface
impl SignerProvider for TestKeysInterface
§type Signer = TestChannelSigner
type Signer = TestChannelSigner
A type which implements
WriteableEcdsaChannelSigner
which will be returned by Self::derive_channel_signer
.§fn generate_channel_keys_id(
&self,
inbound: bool,
channel_value_satoshis: u64,
user_channel_id: u128,
) -> [u8; 32]
fn generate_channel_keys_id( &self, inbound: bool, channel_value_satoshis: u64, user_channel_id: u128, ) -> [u8; 32]
Generates a unique
channel_keys_id
that can be used to obtain a Self::Signer
through
SignerProvider::derive_channel_signer
. The user_channel_id
is provided to allow
implementations of SignerProvider
to maintain a mapping between itself and the generated
channel_keys_id
. Read more§fn derive_channel_signer(
&self,
channel_value_satoshis: u64,
channel_keys_id: [u8; 32],
) -> TestChannelSigner
fn derive_channel_signer( &self, channel_value_satoshis: u64, channel_keys_id: [u8; 32], ) -> TestChannelSigner
Derives the private key material backing a
Signer
. Read more§fn read_chan_signer(
&self,
buffer: &[u8],
) -> Result<<TestKeysInterface as SignerProvider>::Signer, DecodeError>
fn read_chan_signer( &self, buffer: &[u8], ) -> Result<<TestKeysInterface as SignerProvider>::Signer, DecodeError>
Reads a
Signer
for this SignerProvider
from the given input stream.
This is only called during deserialization of other objects which contain
WriteableEcdsaChannelSigner
-implementing objects (i.e., ChannelMonitor
s and ChannelManager
s).
The bytes are exactly those which <Self::Signer as Writeable>::write()
writes, and
contain no versioning scheme. You may wish to include your own version prefix and ensure
you’ve read all of the provided bytes to ensure no corruption occurred. Read more§fn get_destination_script(&self) -> Result<Script, ()>
fn get_destination_script(&self) -> Result<Script, ()>
Get a script pubkey which we send funds to when claiming on-chain contestable outputs. Read more
§fn get_shutdown_scriptpubkey(&self) -> Result<ShutdownScript, ()>
fn get_shutdown_scriptpubkey(&self) -> Result<ShutdownScript, ()>
Get a script pubkey which we will send funds to when closing a channel. Read more
Auto Trait Implementations§
impl !Freeze for TestKeysInterface
impl RefUnwindSafe for TestKeysInterface
impl Send for TestKeysInterface
impl Sync for TestKeysInterface
impl Unpin for TestKeysInterface
impl UnwindSafe for TestKeysInterface
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Forward to the method defined on the type
Any
.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Forward to the method defined on the type
Any
.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request