Struct chain_impl_mockchain::transaction::Transaction
source · pub struct Transaction<P> {
pub(super) data: Box<[u8]>,
pub(super) tstruct: TransactionStruct,
pub(super) phantom: PhantomData<P>,
}
Fields§
§data: Box<[u8]>
§tstruct: TransactionStruct
§phantom: PhantomData<P>
Implementations§
source§impl<P> Transaction<P>
impl<P> Transaction<P>
pub fn as_slice(&self) -> TransactionSlice<'_, P>
pub fn hash(&self) -> TransactionSignDataHash
pub fn nb_inputs(&self) -> u8
sourcepub fn block0_payload(payload: &P, payload_auth: &P::Auth) -> Transaction<P>where
P: Payload,
pub fn block0_payload(payload: &P, payload_auth: &P::Auth) -> Transaction<P>where P: Payload,
Create a specific block0 payload transaction
pub fn block0_payload_builder(payload: &P) -> TxBuilderState<SetAuthData<P>>where P: Payload,
pub fn nb_witnesses(&self) -> u8
pub fn nb_outputs(&self) -> u8
pub fn total_input(&self) -> Result<Value, ValueError>
pub fn total_output(&self) -> Result<Value, ValueError>
pub fn balance(&self, fee: Value) -> Result<Balance, ValueError>
pub fn verify_strictly_balanced(&self, fee: Value) -> Result<(), BalanceError>
pub fn verify_possibly_balanced(&self) -> Result<(), BalanceError>
Trait Implementations§
source§impl<Extra: Arbitrary + Payload> Arbitrary for Transaction<Extra>where
Extra::Auth: Arbitrary,
impl<Extra: Arbitrary + Payload> Arbitrary for Transaction<Extra>where Extra::Auth: Arbitrary,
source§impl<P> AsRef<[u8]> for Transaction<P>
impl<P> AsRef<[u8]> for Transaction<P>
source§impl<P> Clone for Transaction<P>
impl<P> Clone for Transaction<P>
source§impl<P> Debug for Transaction<P>
impl<P> Debug for Transaction<P>
source§impl<Extra: Payload> Deserialize for Transaction<Extra>
impl<Extra: Payload> Deserialize for Transaction<Extra>
fn deserialize<R: Read>(codec: &mut Codec<R>) -> Result<Self, ReadError>
fn deserialize_validate<R>(codec: &mut Codec<R>) -> Result<(), ReadError>where R: Read,
source§impl<P> PartialEq<Transaction<P>> for Transaction<P>
impl<P> PartialEq<Transaction<P>> for Transaction<P>
source§impl<Extra: Payload> Serialize for Transaction<Extra>
impl<Extra: Payload> Serialize for Transaction<Extra>
impl<P> Eq for Transaction<P>
Auto Trait Implementations§
impl<P> RefUnwindSafe for Transaction<P>where P: RefUnwindSafe,
impl<P> Send for Transaction<P>where P: Send,
impl<P> Sync for Transaction<P>where P: Sync,
impl<P> Unpin for Transaction<P>where P: Unpin,
impl<P> UnwindSafe for Transaction<P>where P: UnwindSafe,
Blanket Implementations§
§impl<T> Base32Len for Twhere
T: AsRef<[u8]>,
impl<T> Base32Len for Twhere T: AsRef<[u8]>,
§fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
Calculate the base32 serialized length
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> DeserializeFromSlice for Twhere
T: Deserialize,
impl<T> DeserializeFromSlice for Twhere T: Deserialize,
fn deserialize_from_slice(codec: &mut Codec<&[u8]>) -> Result<T, ReadError>
fn deserialize_validate_from_slice( codec: &mut Codec<&[u8]> ) -> Result<(), ReadError>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> ToHex for Twhere
T: AsRef<[u8]>,
impl<T> ToHex for Twhere T: AsRef<[u8]>,
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)