Skip to content

Commit

Permalink
fix: add test and fix others
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Jan 9, 2025
1 parent 4142de3 commit 3ff015d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
25 changes: 17 additions & 8 deletions cmd/crates/soroban-test/tests/it/integration/tx/operations.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use soroban_cli::{
config::locator,
tx::{builder, ONE_XLM},
utils::contract_id_hash_from_asset,
xdr::{self, ReadXdr, SequenceNumber},
Expand Down Expand Up @@ -267,20 +268,24 @@ async fn account_merge_with_alias() {
#[tokio::test]
async fn set_trustline_flags() {
let sandbox = &TestEnv::new();
let (test, issuer) = setup_accounts(sandbox);
let asset = format!("usdc:{issuer}");
issue_asset(sandbox, &test, &asset, 100_000, 100).await;
let (test, test1) = setup_accounts(sandbox);
let asset = "usdc:test1";
issue_asset(sandbox, &test, asset, 100_000, 100).await;
sandbox
.new_assert_cmd("contract")
.arg("asset")
.arg("deploy")
.arg("--asset")
.arg(&asset)
.arg(asset)
.assert()
.success();
let id = contract_id_hash_from_asset(
asset.parse::<builder::Asset>().unwrap(),
&sandbox.network.network_passphrase,
&format!("usdc:{test1}")
.parse::<builder::Asset>()
.unwrap()
.resolve(&locator::Args::default())
.unwrap(),
&sandbox.network_passphrase,
);
// sandbox
// .new_assert_cmd("contract")
Expand Down Expand Up @@ -542,8 +547,12 @@ async fn change_trust() {

// wrap_cmd(&asset).run().await.unwrap();
let id = contract_id_hash_from_asset(
asset.parse::<builder::Asset>().unwrap(),
&sandbox.network.network_passphrase,
&asset
.parse::<builder::Asset>()
.unwrap()
.resolve(&locator::Args::default())
.unwrap(),
&sandbox.network_passphrase,
);
sandbox
.new_assert_cmd("contract")
Expand Down
14 changes: 8 additions & 6 deletions cmd/crates/soroban-test/tests/it/integration/wrap.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use soroban_cli::{tx::builder, utils::contract_id_hash_from_asset};
use soroban_cli::{config::locator, tx::builder, utils::contract_id_hash_from_asset};
use soroban_test::{AssertExt, TestEnv, LOCAL_NETWORK_PASSPHRASE};

#[tokio::test]
Expand All @@ -12,21 +12,23 @@ async fn burn() {
.arg("test")
.assert()
.stdout_as_str();
let asset = format!("native:{address}");
let asset = "native";
sandbox
.new_assert_cmd("contract")
.arg("asset")
.arg("deploy")
.arg("--source=test")
.arg("--asset")
.arg(&asset)
.arg(asset)
.assert()
.success();
// wrap_cmd(&asset).run().await.unwrap();
let asset: builder::Asset = asset.parse().unwrap();
let asset = asset
.parse::<builder::Asset>()
.unwrap()
.resolve(&locator::Args::default())
.unwrap();
let hash = contract_id_hash_from_asset(&asset, &network_passphrase);
let id = stellar_strkey::Contract(hash.0).to_string();
println!("{id}, {address}");
sandbox
.new_assert_cmd("contract")
.args([
Expand Down

0 comments on commit 3ff015d

Please sign in to comment.