Struct chain_impl_mockchain::transaction::TxBuilderState
source · pub struct TxBuilderState<T> {
data: Vec<u8>,
tstruct: TransactionStruct,
phantom: PhantomData<T>,
}
Expand description
A Transaction builder with an associated state machine
Fields§
§data: Vec<u8>
§tstruct: TransactionStruct
§phantom: PhantomData<T>
Implementations§
source§impl<State> TxBuilderState<State>
impl<State> TxBuilderState<State>
fn current_pos(&self) -> usize
source§impl TxBuilderState<SetPayload>
impl TxBuilderState<SetPayload>
sourcepub fn set_payload<P: Payload>(self, payload: &P) -> TxBuilderState<SetTtl<P>>
pub fn set_payload<P: Payload>(self, payload: &P) -> TxBuilderState<SetTtl<P>>
Set the payload of this transaction
pub fn set_nopayload(self) -> TxBuilderState<SetTtl<NoExtra>>
source§impl<P> TxBuilderState<SetTtl<P>>
impl<P> TxBuilderState<SetTtl<P>>
pub fn set_expiry_date( self, valid_until: BlockDate ) -> TxBuilderState<SetIOs<P>>
source§impl<P> TxBuilderState<SetIOs<P>>
impl<P> TxBuilderState<SetIOs<P>>
sourcepub fn set_ios(
self,
inputs: &[Input],
outputs: &[Output<Address>]
) -> TxBuilderState<SetWitnesses<P>>
pub fn set_ios( self, inputs: &[Input], outputs: &[Output<Address>] ) -> TxBuilderState<SetWitnesses<P>>
Set the inputs and outputs of this transaction
This cannot accept more than 255 inputs, 255 outputs, since the length is encoded as u8, and hence will assert.
Note that further restriction apply to the ledger, which only accept up to 254 outputs
source§impl<P> TxBuilderState<SetWitnesses<P>>
impl<P> TxBuilderState<SetWitnesses<P>>
sourcepub fn get_auth_data_for_witness(&self) -> TransactionAuthData<'_>
pub fn get_auth_data_for_witness(&self) -> TransactionAuthData<'_>
Get the authenticated data consisting of the payload and the input/outputs
sourcepub fn set_witnesses(
self,
witnesses: &[Witness]
) -> TxBuilderState<SetAuthData<P>>where
P: Payload,
pub fn set_witnesses( self, witnesses: &[Witness] ) -> TxBuilderState<SetAuthData<P>>where P: Payload,
Set the witnesses of the transaction. There’s need to be 1 witness per inputs, although it is not enforced by this construction
Note that the same number of witnesses as the number of inputs need to be added here, otherwise an assert will raise.
sourcepub fn set_witnesses_unchecked(
self,
witnesses: &[Witness]
) -> TxBuilderState<SetAuthData<P>>where
P: Payload,
pub fn set_witnesses_unchecked( self, witnesses: &[Witness] ) -> TxBuilderState<SetAuthData<P>>where P: Payload,
Set the witnesses of the transaction.
source§impl<P: Payload> TxBuilderState<SetAuthData<P>>
impl<P: Payload> TxBuilderState<SetAuthData<P>>
sourcepub fn get_auth_data(&self) -> TransactionBindingAuthData<'_>
pub fn get_auth_data(&self) -> TransactionBindingAuthData<'_>
Get the authenticated data related to possible overall data for transaction and payload binding
sourcepub fn set_payload_auth(self, auth_data: &P::Auth) -> Transaction<P>
pub fn set_payload_auth(self, auth_data: &P::Auth) -> Transaction<P>
Set the authenticated data