pub struct TransactionInputs(_);
Implementations§
source§impl TransactionInputs
impl TransactionInputs
pub fn from_bytes(bytes: Vec<u8>) -> Result<TransactionInputs, DeserializeError>
source§impl TransactionInputs
impl TransactionInputs
pub fn from_hex(hex_str: &str) -> Result<TransactionInputs, DeserializeError>
source§impl TransactionInputs
impl TransactionInputs
pub fn new() -> Self
pub fn get(&self, index: usize) -> TransactionInput
pub fn add(&mut self, elem: &TransactionInput)
sourcepub fn to_option(&self) -> Option<TransactionInputs>
pub fn to_option(&self) -> Option<TransactionInputs>
Examples found in repository?
src/tx_builder.rs (line 1777)
1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783
fn build_and_size(&self) -> Result<(TransactionBody, usize), JsError> {
let fee = self
.fee
.ok_or_else(|| JsError::from_str("Fee not specified"))?;
let built = TransactionBody {
inputs: self.inputs.inputs(),
outputs: self.outputs.clone(),
fee,
ttl: self.ttl,
certs: self.certs.clone(),
withdrawals: self.withdrawals.clone(),
update: None,
auxiliary_data_hash: match &self.auxiliary_data {
None => None,
Some(x) => Some(utils::hash_auxiliary_data(x)),
},
validity_start_interval: self.validity_start_interval,
mint: match &self.mint {
None => None,
Some(mint_builder) => Some(mint_builder.build()),
},
script_data_hash: self.script_data_hash.clone(),
collateral: self.collateral.inputs_option(),
required_signers: self.required_signers.to_option(),
network_id: None,
collateral_return: self.collateral_return.clone(),
total_collateral: self.total_collateral.clone(),
reference_inputs: self.get_reference_inputs().to_option(),
};
// we must build a tx with fake data (of correct size) to check the final Transaction size
let full_tx = fake_full_tx(self, built)?;
let full_tx_size = full_tx.to_bytes().len();
return Ok((full_tx.body, full_tx_size));
}
Trait Implementations§
source§impl Clone for TransactionInputs
impl Clone for TransactionInputs
source§fn clone(&self) -> TransactionInputs
fn clone(&self) -> TransactionInputs
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TransactionInputs
impl Debug for TransactionInputs
source§impl<'de> Deserialize<'de> for TransactionInputs
impl<'de> Deserialize<'de> for TransactionInputs
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Deserialize for TransactionInputs
impl Deserialize for TransactionInputs
fn deserialize<R: BufRead + Seek>(
raw: &mut Deserializer<R>
) -> Result<Self, DeserializeError>
source§impl JsonSchema for TransactionInputs
impl JsonSchema for TransactionInputs
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl Ord for TransactionInputs
impl Ord for TransactionInputs
source§fn cmp(&self, other: &TransactionInputs) -> Ordering
fn cmp(&self, other: &TransactionInputs) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<TransactionInputs> for TransactionInputs
impl PartialEq<TransactionInputs> for TransactionInputs
source§fn eq(&self, other: &TransactionInputs) -> bool
fn eq(&self, other: &TransactionInputs) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<TransactionInputs> for TransactionInputs
impl PartialOrd<TransactionInputs> for TransactionInputs
source§fn partial_cmp(&self, other: &TransactionInputs) -> Option<Ordering>
fn partial_cmp(&self, other: &TransactionInputs) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more