Struct ckb_jsonrpc_types::Transaction
source · [−]pub struct Transaction {
pub version: Version,
pub cell_deps: Vec<CellDep>,
pub header_deps: Vec<H256>,
pub inputs: Vec<CellInput>,
pub outputs: Vec<CellOutput>,
pub outputs_data: Vec<JsonBytes>,
pub witnesses: Vec<JsonBytes>,
}
Expand description
The transaction.
Refer to RFC CKB Transaction Structure.
Fields
version: Version
Reserved for future usage. It must equal 0 in current version.
cell_deps: Vec<CellDep>
An array of cell deps.
CKB locates lock script and type script code via cell deps. The script also can uses syscalls to read the cells here.
Unlike inputs, the live cells can be used as cell deps in multiple transactions.
header_deps: Vec<H256>
An array of header deps.
The block must already be in the canonical chain.
Lock script and type script can read the header information of blocks listed here.
inputs: Vec<CellInput>
An array of input cells.
In the canonical chain, any cell can only appear as an input once.
outputs: Vec<CellOutput>
An array of output cells.
outputs_data: Vec<JsonBytes>
Output cells data.
This is a parallel array of outputs. The cell capacity, lock, and type of the output i is
outputs[i]
and its data is outputs_data[i]
.
witnesses: Vec<JsonBytes>
An array of variable-length binaries.
Lock script and type script can read data here to verify the transaction.
For example, the bundled secp256k1 lock script requires storing the signature in
witnesses
.
Trait Implementations
sourceimpl Clone for Transaction
impl Clone for Transaction
sourcefn clone(&self) -> Transaction
fn clone(&self) -> Transaction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Transaction
impl Debug for Transaction
sourceimpl Default for Transaction
impl Default for Transaction
sourcefn default() -> Transaction
fn default() -> Transaction
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for Transaction
impl<'de> Deserialize<'de> for Transaction
sourcefn 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
sourceimpl From<Transaction> for Transaction
impl From<Transaction> for Transaction
sourcefn from(input: Transaction) -> Self
fn from(input: Transaction) -> Self
Converts to this type from the input type.
sourceimpl From<Transaction> for Transaction
impl From<Transaction> for Transaction
sourcefn from(json: Transaction) -> Self
fn from(json: Transaction) -> Self
Converts to this type from the input type.
sourceimpl Hash for Transaction
impl Hash for Transaction
sourceimpl PartialEq<Transaction> for Transaction
impl PartialEq<Transaction> for Transaction
sourcefn eq(&self, other: &Transaction) -> bool
fn eq(&self, other: &Transaction) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Transaction) -> bool
fn ne(&self, other: &Transaction) -> bool
This method tests for !=
.
sourceimpl Serialize for Transaction
impl Serialize for Transaction
impl Eq for Transaction
impl StructuralEq for Transaction
impl StructuralPartialEq for Transaction
Auto Trait Implementations
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more