pub struct MockTransaction {
pub mock_info: MockInfo,
pub tx: Transaction,
}
Expand description
A wrapper transaction with mock inputs and deps.
Fields§
§mock_info: MockInfo
§tx: Transaction
Implementations§
Source§impl MockTransaction
impl MockTransaction
Sourcepub fn get_input_cell<F: FnMut(OutPoint) -> Result<Option<(CellOutput, Bytes, Option<Byte32>)>, String>>(
&self,
input: &CellInput,
live_cell_getter: F,
) -> Result<Option<(CellOutput, Bytes, Option<Byte32>)>, String>
pub fn get_input_cell<F: FnMut(OutPoint) -> Result<Option<(CellOutput, Bytes, Option<Byte32>)>, String>>( &self, input: &CellInput, live_cell_getter: F, ) -> Result<Option<(CellOutput, Bytes, Option<Byte32>)>, String>
Retrieve the input cell data for a given cell input.
Sourcepub fn get_dep_cell<F: FnMut(OutPoint) -> Result<Option<(CellOutput, Bytes, Option<Byte32>)>, String>>(
&self,
out_point: &OutPoint,
live_cell_getter: F,
) -> Result<Option<(CellOutput, Bytes, Option<Byte32>)>, String>
pub fn get_dep_cell<F: FnMut(OutPoint) -> Result<Option<(CellOutput, Bytes, Option<Byte32>)>, String>>( &self, out_point: &OutPoint, live_cell_getter: F, ) -> Result<Option<(CellOutput, Bytes, Option<Byte32>)>, String>
Retrieve the cell dependency data for a given out point.
Sourcepub fn get_header<F: FnMut(H256) -> Result<Option<HeaderView>, String>>(
&self,
block_hash: &H256,
header_getter: F,
) -> Result<Option<HeaderView>, String>
pub fn get_header<F: FnMut(H256) -> Result<Option<HeaderView>, String>>( &self, block_hash: &H256, header_getter: F, ) -> Result<Option<HeaderView>, String>
Retrieve the header for a given block hash.
Sourcepub fn core_transaction(&self) -> TransactionView
pub fn core_transaction(&self) -> TransactionView
Generate the core transaction.
Trait Implementations§
Source§impl Clone for MockTransaction
impl Clone for MockTransaction
Source§fn clone(&self) -> MockTransaction
fn clone(&self) -> MockTransaction
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 Default for MockTransaction
impl Default for MockTransaction
Source§fn default() -> MockTransaction
fn default() -> MockTransaction
Returns the “default value” for a type. Read more
Source§impl From<MockTransaction> for ReprMockTransaction
impl From<MockTransaction> for ReprMockTransaction
Source§fn from(tx: MockTransaction) -> ReprMockTransaction
fn from(tx: MockTransaction) -> ReprMockTransaction
Converts to this type from the input type.
Source§impl From<ReprMockTransaction> for MockTransaction
impl From<ReprMockTransaction> for MockTransaction
Source§fn from(tx: ReprMockTransaction) -> MockTransaction
fn from(tx: ReprMockTransaction) -> MockTransaction
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for MockTransaction
impl RefUnwindSafe for MockTransaction
impl Send for MockTransaction
impl Sync for MockTransaction
impl Unpin for MockTransaction
impl UnwindSafe for MockTransaction
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)