Skip to content

Commit

Permalink
fixed token transfer test
Browse files Browse the repository at this point in the history
  • Loading branch information
claravanstaden authored and claravanstaden committed Oct 29, 2023
1 parent cc9b1fc commit b27ed8b
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 14 deletions.
49 changes: 48 additions & 1 deletion parachain/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions smoketest/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 24 additions & 13 deletions smoketest/tests/transfer_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use snowbridge_smoketest::{
v3::{
junction::{Junction, NetworkId},
junctions::Junctions,
junctions::Junctions::Here,
multiasset::{AssetId, Fungibility, MultiAsset, MultiAssets},
},
VersionedMultiAssets, VersionedMultiLocation,
Expand Down Expand Up @@ -59,18 +60,25 @@ async fn transfer_token() {

let signer: PairSigner<AssetHubConfig, _> = PairSigner::new(keypair);

let fee: u128 = 1000_800_566_581;
let amount: u128 = 1_000_000_000;
let assets = VersionedMultiAssets::V3(MultiAssets(vec![MultiAsset {
id: AssetId::Concrete(MultiLocation {
parents: 2,
interior: Junctions::X3(
Junction::GlobalConsensus(NetworkId::Ethereum { chain_id: 15 }),
Junction::AccountKey20 { network: None, key: GATEWAY_PROXY_CONTRACT.into() },
Junction::AccountKey20 { network: None, key: WETH_CONTRACT.into() },
),
}),
fun: Fungibility::Fungible(amount),
}]));
let assets = VersionedMultiAssets::V3(MultiAssets(vec![
MultiAsset {
id: AssetId::Concrete(MultiLocation { parents: 1, interior: Here }),
fun: Fungibility::Fungible(fee),
},
MultiAsset {
id: AssetId::Concrete(MultiLocation {
parents: 2,
interior: Junctions::X3(
Junction::GlobalConsensus(NetworkId::Ethereum { chain_id: 15 }),
Junction::AccountKey20 { network: None, key: GATEWAY_PROXY_CONTRACT.into() },
Junction::AccountKey20 { network: None, key: WETH_CONTRACT.into() },
),
}),
fun: Fungibility::Fungible(amount),
},
]));

let destination = VersionedMultiLocation::V3(MultiLocation {
parents: 2,
Expand Down Expand Up @@ -100,7 +108,10 @@ async fn transfer_token() {
.await
.expect("call success");

println!("bridge_transfer call issued at assethub block hash {:?}", result.block_hash());
println!(
"reserve_transfer_assets call issued at assethub block hash {:?}",
result.block_hash()
);

let wait_for_blocks = 50;
let mut stream = ethereum_client.subscribe_blocks().await.unwrap().take(wait_for_blocks);
Expand All @@ -120,7 +131,7 @@ async fn transfer_token() {
}
}
if transfer_event_found {
break
break;
}
}
assert!(transfer_event_found);
Expand Down

0 comments on commit b27ed8b

Please sign in to comment.