pub enum TestTransaction {
V1(TestIntentV1),
V2 {
root_intent: TestIntentV2,
subintents: Vec<TestIntentV2>,
},
}
Variants§
Implementations§
Source§impl TestTransaction
impl TestTransaction
Sourcepub fn new_v1_from_nonce(
manifest: TransactionManifestV1,
nonce: u32,
initial_proofs: BTreeSet<NonFungibleGlobalId>,
) -> Self
pub fn new_v1_from_nonce( manifest: TransactionManifestV1, nonce: u32, initial_proofs: BTreeSet<NonFungibleGlobalId>, ) -> Self
The nonce needs to be globally unique amongst test transactions on your ledger
pub fn new_from_any_manifest( any_manifest: AnyManifest, nonce: u32, initial_proofs: BTreeSet<NonFungibleGlobalId>, ) -> Result<Self, String>
pub fn new_v1( manifest: TransactionManifestV1, hash: Hash, initial_proofs: BTreeSet<NonFungibleGlobalId>, ) -> Self
Sourcepub fn new_v2_builder(nonce: u32) -> TestTransactionV2Builder
pub fn new_v2_builder(nonce: u32) -> TestTransactionV2Builder
§Example usage
ⓘ
let mut ledger = LedgerSimulatorBuilder::new().build();
let mut builder = TestTransaction::new_v2_builder(ledger.next_transaction_nonce());
let child = builder.add_subintent(
ManifestBuilder::new_subintent_v2()
.yield_to_parent(())
.build(),
[child_public_key.signature_proof()],
);
let transaction = builder.finish_with_root_intent(
ManifestBuilder::new_v2()
.use_child("child", child)
.lock_standard_test_fee(account)
.yield_to_child("child", ())
.build(),
[public_key.signature_proof()],
);
let receipt = ledger.execute_test_transaction(transaction);
pub fn prepare( self, settings: &PreparationSettings, ) -> Result<PreparedTestTransaction, PrepareError>
Trait Implementations§
Source§impl<D: Decoder<ManifestCustomValueKind>> Decode<ManifestCustomValueKind, D> for TestTransaction
impl<D: Decoder<ManifestCustomValueKind>> Decode<ManifestCustomValueKind, D> for TestTransaction
Source§fn decode_body_with_value_kind(
decoder: &mut D,
value_kind: ValueKind<ManifestCustomValueKind>,
) -> Result<Self, DecodeError>
fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<ManifestCustomValueKind>, ) -> Result<Self, DecodeError>
Decodes the type from the decoder, which should match a preloaded value kind. Read more
Source§impl<E: Encoder<ManifestCustomValueKind>> Encode<ManifestCustomValueKind, E> for TestTransaction
impl<E: Encoder<ManifestCustomValueKind>> Encode<ManifestCustomValueKind, E> for TestTransaction
Source§fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
Encodes the SBOR value’s kind to the encoder
Source§fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
Encodes the SBOR body of the type to the encoder. Read more
Source§impl IntoExecutable for TestTransaction
impl IntoExecutable for TestTransaction
type Error = PrepareError
fn into_executable( self, validator: &TransactionValidator, ) -> Result<ExecutableTransaction, Self::Error>
Source§fn into_executable_unwrap(self) -> ExecutableTransactionwhere
Self: Sized,
fn into_executable_unwrap(self) -> ExecutableTransactionwhere
Self: Sized,
For use in tests as a quick mechanism to get an executable.
Validates with a network-independent validator, using the latest settings.
Source§impl SborEnum<ManifestCustomValueKind> for TestTransaction
impl SborEnum<ManifestCustomValueKind> for TestTransaction
fn get_discriminator(&self) -> u8
fn get_length(&self) -> usize
Auto Trait Implementations§
impl Freeze for TestTransaction
impl RefUnwindSafe for TestTransaction
impl Send for TestTransaction
impl Sync for TestTransaction
impl Unpin for TestTransaction
impl UnwindSafe for TestTransaction
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