From 33683f567cbea1ebec276ac4d4656a93dde7959f Mon Sep 17 00:00:00 2001 From: Thomas Niederberger Date: Tue, 11 Jun 2024 11:59:13 +0200 Subject: [PATCH] Improve example --- examples/wasm/examples/wasm_example.rs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/examples/wasm/examples/wasm_example.rs b/examples/wasm/examples/wasm_example.rs index 2ad49f383..b026cfeaf 100644 --- a/examples/wasm/examples/wasm_example.rs +++ b/examples/wasm/examples/wasm_example.rs @@ -34,32 +34,34 @@ fn main() -> Result { sr25519::Public::from_ss58check("5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty") .unwrap() .into(); - let bob: MultiAddress = MultiAddress::Id(bob_account); + let _bob: MultiAddress = MultiAddress::Id(bob_account); let es_converted: ExtrinsicSigner = alice.clone().into(); let es_new = ExtrinsicSigner::::new(alice.clone()); assert_eq!(es_converted.signer().public(), es_new.signer().public()); + let extrinsic = UncheckedExtrinsic::from_bytes(&[]); + match extrinsic { + Ok(_) => panic!("Extrinsic should be invalid"), + Err(_) => (), + } + //let _xt1: Bytes = extrinsic.unwrap().encode().into(); + + //assert_eq!(4, 5); + /*let call1 = RuntimeCall::Balances(BalancesCall::force_transfer { source: bob.clone(), dest: bob.clone(), value: 10, }); - let call2 = RuntimeCall::Balances(BalancesCall::transfer_allow_death { - dest: bob.clone(), - value: 2000, - }); - let call3 = - RuntimeCall::Balances(BalancesCall::transfer_allow_death { dest: bob, value: 1000 }); - let _xt1: Bytes = UncheckedExtrinsic::new_unsigned(call1).encode().into(); - let _xt2: Bytes = UncheckedExtrinsic::new_unsigned(call2).encode().into(); - let _xt3: Bytes = UncheckedExtrinsic::new_unsigned(call3).encode().into();*/ + */ + /* let recipients_extrinsic_address: ExtrinsicAddressOf = bob_account.clone().into(); //let recipient = AccountKeyring::Bob.to_account_id(); - //assert!(4 == 5, "x wasn't true!"); + let spec_version = 1; let transaction_version = 2; let genesis_hash = H256::zero();