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 use 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§
Source§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for Transaction
impl Debug for Transaction
Source§impl Default for Transaction
impl Default for Transaction
Source§fn default() -> Transaction
fn default() -> Transaction
Source§impl<'de> Deserialize<'de> for Transaction
impl<'de> Deserialize<'de> for Transaction
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>,
Source§impl From<Transaction> for Transaction
impl From<Transaction> for Transaction
Source§fn from(input: Transaction) -> Self
fn from(input: Transaction) -> Self
Source§impl From<Transaction> for Transaction
impl From<Transaction> for Transaction
Source§fn from(json: Transaction) -> Self
fn from(json: Transaction) -> Self
Source§impl Hash for Transaction
impl Hash for Transaction
Source§impl JsonSchema for Transaction
impl JsonSchema for Transaction
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreSource§impl PartialEq for Transaction
impl PartialEq for Transaction
Source§impl Serialize for Transaction
impl Serialize for Transaction
impl Eq for Transaction
impl StructuralPartialEq for Transaction
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)