mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +00:00
Get WASM example compiling via 'trunk serve'
This commit is contained in:
@@ -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()?;
|
||||
|
||||
Reference in New Issue
Block a user