Get WASM example compiling via 'trunk serve'

This commit is contained in:
James Wilson
2025-12-16 18:28:16 +00:00
parent c1d30da488
commit 4819b00655
17 changed files with 33145 additions and 33772 deletions
+7 -5
View File
@@ -1,7 +1,6 @@
use subxt::{
PolkadotConfig,
utils::{AccountId32, MultiAddress},
OnlineClient,
OnlineClient, PolkadotConfig,
};
use subxt_signer::sr25519::dev::{self};
@@ -21,7 +20,8 @@ pub async fn main() {
async fn run() -> Result<(), Box<dyn std::error::Error>> {
// (the port 42069 is specified in the asset-hub-zombienet.toml)
let api = OnlineClient::<StatemintConfig>::from_url("ws://127.0.0.1:42069").await?;
let config = StatemintConfig::new();
let api = OnlineClient::<StatemintConfig>::from_url(config, "ws://127.0.0.1:42069").await?;
println!("Connection with parachain established.");
let alice: MultiAddress<AccountId32, ()> = dev::alice().public_key().into();
@@ -36,6 +36,7 @@ async fn run() -> Result<(), Box<dyn std::error::Error>> {
.create(COLLECTION_ID, alice.clone());
let _collection_creation_events = api
.tx()
.await?
.sign_and_submit_then_watch_default(&collection_creation_tx, &alice_pair_signer)
.await
.map(|e| {
@@ -52,6 +53,7 @@ async fn run() -> Result<(), Box<dyn std::error::Error>> {
.mint(COLLECTION_ID, NTF_ID, alice.clone());
let _nft_creation_events = api
.tx()
.await?
.sign_and_submit_then_watch_default(&nft_creation_tx, &alice_pair_signer)
.await
.map(|e| {
@@ -65,9 +67,9 @@ async fn run() -> Result<(), Box<dyn std::error::Error>> {
// check in storage, that alice is the official owner of the NFT:
let nft_owner_storage_query = statemint::storage().uniques().asset();
let nft_storage_details = api
.storage()
.at_latest()
.at_current_block()
.await?
.storage()
.fetch(nft_owner_storage_query, (COLLECTION_ID, NTF_ID))
.await?
.decode()?;