[−][src]Struct ergo_lib::chain::transaction::Transaction
ErgoTransaction is an atomic state transition operation. It destroys Boxes from the state and creates new ones. If transaction is spending boxes protected by some non-trivial scripts, its inputs should also contain proof of spending correctness - context extension (user-defined key-value map) and data inputs (links to existing boxes in the state) that may be used during script reduction to crypto, signatures that satisfies the remaining cryptographic protection of the script. Transactions are not encrypted, so it is possible to browse and view every transaction ever collected into a block.
Fields
inputs: Vec<Input>
inputs, that will be spent by this transaction.
data_inputs: Vec<DataInput>
inputs, that are not going to be spent by transaction, but will be reachable from inputs
scripts. dataInputs
scripts will not be executed, thus their scripts costs are not
included in transaction cost and they do not contain spending proofs.
output_candidates: Vec<ErgoBoxCandidate>
box candidates to be created by this transaction. Differ from ordinary ones in that they do not include transaction id and index
Implementations
impl Transaction
[src]
pub const MAX_OUTPUTS_COUNT: usize
[src]
Maximum number of outputs
pub fn new(
inputs: Vec<Input>,
data_inputs: Vec<DataInput>,
output_candidates: Vec<ErgoBoxCandidate>
) -> Transaction
[src]
inputs: Vec<Input>,
data_inputs: Vec<DataInput>,
output_candidates: Vec<ErgoBoxCandidate>
) -> Transaction
Creates new transaction
pub fn outputs(&self) -> Vec<ErgoBox>
[src]
create ErgoBox from ErgoBoxCandidate with tx id and indices
pub fn bytes_to_sign(&self) -> Vec<u8>
[src]
Serialized tx with empty proofs
pub fn id(&self) -> TxId
[src]
Get transaction id
Trait Implementations
impl Clone for Transaction
[src]
pub fn clone(&self) -> Transaction
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Transaction
[src]
impl<'de> Deserialize<'de> for Transaction
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<Transaction> for Transaction
[src]
pub fn eq(&self, other: &Transaction) -> bool
[src]
pub fn ne(&self, other: &Transaction) -> bool
[src]
impl Serialize for Transaction
[src]
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl SigmaSerializable for Transaction
[src]
pub fn sigma_serialize<W: SigmaByteWrite>(&self, w: &mut W) -> Result<(), Error>
[src]
pub fn sigma_parse<R: SigmaByteRead>(
r: &mut R
) -> Result<Self, SerializationError>
[src]
r: &mut R
) -> Result<Self, SerializationError>
pub fn sigma_serialize_bytes(&self) -> Vec<u8>
[src]
pub fn sigma_parse_bytes(mut bytes: Vec<u8>) -> Result<Self, SerializationError>
[src]
impl StructuralPartialEq for Transaction
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Transaction
[src]
impl !Send for Transaction
[src]
impl !Sync for Transaction
[src]
impl Unpin for Transaction
[src]
impl !UnwindSafe for Transaction
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<F> TryExtractInto<F> for F
[src]
pub fn try_extract_into<T>(Self) -> Result<T, TryExtractFromError> where
T: TryExtractFrom<F>,
[src]
T: TryExtractFrom<F>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,