Bitcoin Output/Transaction definitions

This commit is contained in:
Luke Parker
2024-09-10 03:48:06 -04:00
parent 0ccf71df1e
commit 247cc8f0cc
17 changed files with 504 additions and 299 deletions

View File

@@ -19,10 +19,19 @@ pub trait Address:
+ BorshSerialize
+ BorshDeserialize
{
/// Write this address.
fn write(&self, writer: &mut impl io::Write) -> io::Result<()>;
/// Read an address.
fn read(reader: &mut impl io::Read) -> io::Result<Self>;
}
// This casts a wide net, yet it only implements `Address` for things `Into<ExternalAddress>` so
// it should only implement this for addresses
impl<
A: Send
+ Sync
+ Clone
+ Into<ExternalAddress>
+ TryFrom<ExternalAddress>
+ BorshSerialize
+ BorshDeserialize,
> Address for A
{
}
/// The type of the output.