diff --git a/.gitignore b/.gitignore index 41c5ca6516..52f405dfd8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ target .env +cucumber-output-junit.xml # Non-root Cargo.locks **/Cargo.lock !/Cargo.lock @@ -61,5 +62,4 @@ clients/validator_node_grpc_client/package-lock.json # moon .moon/cache -.moon/docker -./cucumber-output-junit.xml \ No newline at end of file +.moon/docker \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 30bc0afbc4..1287a7df2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -106,11 +106,6 @@ tari_template_test_tooling = { path = "crates/template_test_tooling" } tari_transaction = { path = "crates/transaction" } tari_transaction_manifest = { path = "crates/transaction_manifest" } tari_validator_node_rpc = { path = "crates/validator_node_rpc" } - -# internal dependencies among workspace crates -libp2p-messaging = { path = "networking/libp2p-messaging" } -libp2p-substream = { path = "networking/libp2p-substream" } -proto_builder = { path = "networking/proto_builder" } sqlite_message_logger = { path = "networking/sqlite_message_logger" } tari_base_node_client = { path = "clients/base_node_client" } tari_indexer_client = { path = "clients/tari_indexer_client", default-features = false } @@ -131,24 +126,27 @@ minotari_node_grpc_client = { git = "https://github.com/tari-project/tari.git", minotari_wallet = { git = "https://github.com/tari-project/tari.git", branch = "development" } minotari_wallet_grpc_client = { git = "https://github.com/tari-project/tari.git", branch = "development" } tari_common = { git = "https://github.com/tari-project/tari.git", branch = "development" } -tari_common_types = { git = "https://github.com/tari-project/tari.git", branch = "development" } tari_common_sqlite = { git = "https://github.com/tari-project/tari.git", branch = "development" } +tari_common_types = { git = "https://github.com/tari-project/tari.git", branch = "development" } tari_hashing = { git = "https://github.com/tari-project/tari.git", branch = "development" } -tari_sidechain = { git = "https://github.com/tari-project/tari.git", branch = "development" } tari_jellyfish = { git = "https://github.com/tari-project/tari.git", branch = "development" } - -# avoid including default features so each crate can choose which ones to import -tari_transaction_components = { git = "https://github.com/tari-project/tari.git", branch = "development" } -tari_node_components = { git = "https://github.com/tari-project/tari.git", branch = "development" } -tari_transaction_key_manager = { git = "https://github.com/tari-project/tari.git", branch = "development" } tari_metrics = { git = "https://github.com/tari-project/tari.git", branch = "development" } tari_mmr = { git = "https://github.com/tari-project/tari.git", branch = "development" } +tari_node_components = { git = "https://github.com/tari-project/tari.git", branch = "development" } tari_p2p = { git = "https://github.com/tari-project/tari.git", branch = "development" } tari_shutdown = { git = "https://github.com/tari-project/tari.git", branch = "development" } +tari_sidechain = { git = "https://github.com/tari-project/tari.git", branch = "development" } +tari_transaction_components = { git = "https://github.com/tari-project/tari.git", branch = "development" } +tari_transaction_key_manager = { git = "https://github.com/tari-project/tari.git", branch = "development" } tari_crypto = "0.22.0" tari_utilities = "0.8.0" +# networking crates +proto_builder = { path = "networking/proto_builder" } +libp2p-messaging = { path = "networking/libp2p-messaging" } +libp2p-substream = { path = "networking/libp2p-substream" } + # third-party dependencies anyhow = "1.0.75" async-graphql = "5.0.7" diff --git a/applications/tari_swarm_daemon/src/process_definitions/wallet_daemon_create_key.rs b/applications/tari_swarm_daemon/src/process_definitions/wallet_daemon_create_key.rs index 1418e72e78..a320991189 100644 --- a/applications/tari_swarm_daemon/src/process_definitions/wallet_daemon_create_key.rs +++ b/applications/tari_swarm_daemon/src/process_definitions/wallet_daemon_create_key.rs @@ -3,6 +3,7 @@ use std::path::PathBuf; +use anyhow::Context; use async_trait::async_trait; use tokio::process::Command; @@ -39,7 +40,7 @@ impl ProcessDefinition for WalletDaemonCreateAccount { "--output", output_path .to_str() - .expect("Non-UTF8 output path in WalletDaemonCreateAccount"), + .context("Non-UTF8 output path in WalletDaemonCreateAccount")?, ]); if let Some(override_keyring_password) = diff --git a/clients/base_node_client/Cargo.toml b/clients/base_node_client/Cargo.toml index 1d0188b7a4..d57c7d5510 100644 --- a/clients/base_node_client/Cargo.toml +++ b/clients/base_node_client/Cargo.toml @@ -10,8 +10,8 @@ license.workspace = true minotari_app_grpc = { workspace = true } minotari_node_grpc_client = { workspace = true } tari_common_types = { workspace = true } -tari_transaction_components = { workspace = true, default-features = false } -tari_node_components = { workspace = true, default-features = false } +tari_transaction_components = { workspace = true } +tari_node_components = { workspace = true } tari_utilities = { workspace = true } tari_ootle_common_types = { workspace = true } tari_template_lib = { workspace = true } diff --git a/integration_tests/src/wallet_daemon_cli.rs b/integration_tests/src/wallet_daemon_cli.rs index a4f0fa40a9..a14bd6ba19 100644 --- a/integration_tests/src/wallet_daemon_cli.rs +++ b/integration_tests/src/wallet_daemon_cli.rs @@ -36,11 +36,11 @@ use tari_ootle_wallet_sdk::{ }; use tari_template_lib::{ constants::STEALTH_TARI_RESOURCE_ADDRESS, - prelude::{PedersenCommitmentBytes, ResourceAddress, RistrettoPublicKeyBytes}, + prelude::{PedersenCommitmentBytes, ResourceAddress, RistrettoPublicKeyBytes, XTR}, resource::TOKEN_SYMBOL, types::{crypto::RangeProofBytes, Amount}, }; -use tari_transaction::{args, UnsignedTransaction}; +use tari_transaction::UnsignedTransaction; use tari_transaction_manifest::{parse_manifest, ManifestValue}; use tari_validator_node_cli::command::transaction::CliArg; use tari_wallet_daemon_client::{ @@ -60,8 +60,8 @@ use tari_wallet_daemon_client::{ ExtClaimBurnProof, ListNftsRequest, MintFaucetNftRequest, - ProofsGenerateRequest, RevealFundsRequest, + StealthTransferRequest, TransactionSubmitRequest, TransactionWaitResultRequest, TransactionWaitResultResponse, @@ -73,7 +73,7 @@ use tokio::{task::JoinSet, time::timeout}; use crate::{ helpers::get_address_from_output, - util::transaction_builder, + util::{cucumber_log, transaction_builder}, validator_node_cli::add_substate_ids, TariWorld, }; @@ -167,67 +167,84 @@ pub async fn transfer_confidential( amount: u64, wallet_daemon_name: String, outputs_name: String, - min_epoch: Option, - max_epoch: Option, -) -> tari_wallet_daemon_client::types::TransactionSubmitResponse { +) { let mut client = get_auth_wallet_daemon_client(world, &wallet_daemon_name).await; let source_account_name = ComponentAddressOrName::Name(source_account_name); - let AccountGetResponse { account, .. } = client.accounts_get(source_account_name.clone()).await.unwrap(); - let source_component_address = account.address; - - let signing_key_index = account.key_index; let dest_account_name = ComponentAddressOrName::Name(dest_account_name); - let destination_account_resp = client + let dest_account = client .accounts_get(dest_account_name) .await .expect("Failed to retrieve destination account address from its name"); - let destination_account = destination_account_resp.account.address; - let destination_public_key = destination_account_resp.public_key; - - let resource_address = STEALTH_TARI_RESOURCE_ADDRESS; - - let create_transfer_proof_req = ProofsGenerateRequest { - account: Some(source_account_name), - amount: amount.into(), - reveal_amount: Amount::zero(), - resource_address, - destination_public_key, - }; - - let transfer_proof_resp = client.create_transfer_proof(create_transfer_proof_req).await.unwrap(); - let withdraw_proof = transfer_proof_resp.proof; - let proof_id = transfer_proof_resp.proof_id; - - let transaction = transaction_builder() - .fee_transaction_pay_from_component(source_component_address, 5000) - .call_method(source_component_address, "withdraw_confidential", args![ - resource_address, - withdraw_proof - ]) - .put_last_instruction_output_on_workspace("bucket") - .call_method(destination_account, "deposit", args![Workspace("bucket")]) - .with_min_epoch(min_epoch) - .with_max_epoch(max_epoch) - .build_unsigned_transaction(); - - let submit_req = TransactionSubmitRequest { - transaction, - signing_key_index: Some(signing_key_index), - proof_ids: vec![proof_id], - detect_inputs: true, - detect_inputs_use_unversioned: true, - }; - - let submit_resp = client.submit_transaction(submit_req).await.unwrap(); + let resp = client + .accounts_stealth_transfer(StealthTransferRequest { + owner_account: source_account_name, + input_selection: ConfidentialTransferInputSelection::ConfidentialOnly, + resource_address: XTR, + destination_public_key: dest_account.public_key, + max_fee: 5000, + blinded_output_amount: amount.into(), + revealed_output_amount: Default::default(), + dry_run: false, + }) + .await + .unwrap(); + // let signing_key_index = account.key_index; + // + // + // let resource_address = STEALTH_TARI_RESOURCE_ADDRESS; + // + // let create_transfer_proof_req = ProofsGenerateRequest { + // account: Some(source_account_name), + // amount: amount.into(), + // reveal_amount: Amount::zero(), + // resource_address, + // destination_public_key, + // }; + // + // let transfer_proof_resp = client.create_transfer_proof(create_transfer_proof_req).await.unwrap(); + // let withdraw_proof = transfer_proof_resp.proof; + // let proof_id = transfer_proof_resp.proof_id; + // + // let transaction = transaction_builder() + // .fee_transaction_pay_from_component(source_component_address, 5000) + // .call_method(source_component_address, "withdraw_confidential", args![ + // resource_address, + // withdraw_proof + // ]) + // .put_last_instruction_output_on_workspace("bucket") + // .call_method(destination_account, "deposit", args![Workspace("bucket")]) + // .with_min_epoch(min_epoch) + // .with_max_epoch(max_epoch) + // .build_unsigned_transaction(); + // + // let submit_req = TransactionSubmitRequest { + // transaction, + // signing_key_index: Some(signing_key_index), + // proof_ids: vec![proof_id], + // detect_inputs: true, + // detect_inputs_use_unversioned: true, + // }; + // + // let submit_resp = client.submit_transaction(submit_req).await.unwrap(); + // let wait_req = TransactionWaitResultRequest { - transaction_id: submit_resp.transaction_id, + transaction_id: resp.transaction_id, timeout_secs: Some(120), }; let wait_resp = client.wait_transaction_result(wait_req).await.unwrap(); + if let Some(reason) = wait_resp + .result + .as_ref() + .expect("Transaction has timed out") + .result + .any_reject() + { + panic!("Transaction failed: {}", reason); + } add_substate_ids( world, @@ -238,8 +255,6 @@ pub async fn transfer_confidential( .result .expect("Transaction has failed"), ); - - submit_resp } pub async fn create_account( @@ -390,7 +405,7 @@ pub async fn get_balance(world: &mut TariWorld, account_name: &str, wallet_daemo .get_account_balances(get_balance_req) .await .expect("Failed to get balance from account"); - eprintln!("resp = {}", serde_json::to_string_pretty(&resp).unwrap()); + cucumber_log(format!("resp = {}", serde_json::to_string_pretty(&resp).unwrap())); resp.balances.iter().map(|e| e.balance + e.confidential_balance).sum() } @@ -410,7 +425,7 @@ pub async fn get_confidential_balance( .get_account_balances(get_balance_req) .await .expect("Failed to get balance from account"); - eprintln!("resp = {}", serde_json::to_string_pretty(&resp).unwrap()); + cucumber_log(format!("resp = {}", serde_json::to_string_pretty(&resp).unwrap())); resp.balances.iter().map(|e| e.confidential_balance).sum() } diff --git a/integration_tests/tests/cucumber.rs b/integration_tests/tests/cucumber.rs index 90e3efde16..3209a05c5f 100644 --- a/integration_tests/tests/cucumber.rs +++ b/integration_tests/tests/cucumber.rs @@ -62,7 +62,7 @@ async fn main() { let file = fs::File::create("cucumber-output-junit.xml").unwrap(); let cucumber_fut = TariWorld::cucumber() - .max_concurrent_scenarios(5) + .max_concurrent_scenarios(2) .with_writer(writer::Tee::new( writer::JUnit::new(file, Verbosity::ShowWorldAndDocString).normalized(), // following config needed to use eprint statements in the tests @@ -392,7 +392,7 @@ async fn call_wallet_daemon_method_and_check_result( .unwrap_or_else(|| panic!("Failed to call first() on results: {:?}", resp)); match result.return_type { Type::U32 => { - let u32_result: u32 = result.decode().unwrap(); + let u32_result: u32 = result.decode()?; assert_eq!(u32_result.to_string(), expected_result); }, _ => todo!(), diff --git a/integration_tests/tests/features/concurrency.feature b/integration_tests/tests/features/concurrency.feature index 189cadeabb..8dede8d5e3 100644 --- a/integration_tests/tests/features/concurrency.feature +++ b/integration_tests/tests/features/concurrency.feature @@ -3,28 +3,9 @@ @concurrency Feature: Concurrency - - Scenario: Concurrent calls to the Counter template - - ##### Setup - # Initialize a base node, wallet, miner and VN - Given a base node BASE - Given a wallet WALLET connected to base node BASE - Given a miner MINER connected to base node BASE and wallet WALLET - - # Initialize a validator node - Given a validator node VN connected to base node BASE and wallet daemon WALLET_D - # Fund wallet to send VN registration tx - When miner MINER mines 10 new blocks - When wallet WALLET has at least 2000 T - When validator node VN sends a registration transaction to base wallet WALLET - When miner MINER mines 26 new blocks - Then the validator node VN is listed as registered - - # Initialize indexer and connect wallet daemon - Given an indexer IDX connected to base node BASE - Given a wallet daemon WALLET_D connected to indexer IDX + Scenario: Concurrent calls to the Counter template + Given a network with registered validator VN and wallet daemon WALLET_D # Create the sender account When I create an account ACC via the wallet daemon WALLET_D with 2000000 free coins diff --git a/integration_tests/tests/features/counter.feature b/integration_tests/tests/features/counter.feature index e4b6dc0277..fab338276c 100644 --- a/integration_tests/tests/features/counter.feature +++ b/integration_tests/tests/features/counter.feature @@ -6,25 +6,7 @@ Feature: Counter template Scenario: Counter template registration and invocation once - - # Initialize a base node, wallet, miner and VN - Given a base node BASE - Given a wallet WALLET connected to base node BASE - Given a miner MINER connected to base node BASE and wallet WALLET - - # Initialize a validator node - Given a validator node VN connected to base node BASE and wallet daemon WALLET_D - - # Fund wallet to send VN registration tx - When miner MINER mines 10 new blocks - When wallet WALLET has at least 2000 T - When validator node VN sends a registration transaction to base wallet WALLET - When miner MINER mines 26 new blocks - Then the validator node VN is listed as registered - - # Initialize indexer and connect wallet daemon - Given an indexer IDX connected to base node BASE - Given a wallet daemon WALLET_D connected to indexer IDX + Given a network with registered validator VN and wallet daemon WALLET_D # Create the sender account When I create an account ACC via the wallet daemon WALLET_D with 2000000 free coins @@ -44,25 +26,7 @@ Feature: Counter template Scenario: Counter template registration and invocation multiple times - - # Initialize a base node, wallet, miner and VN - Given a base node BASE - Given a wallet WALLET connected to base node BASE - Given a miner MINER connected to base node BASE and wallet WALLET - - # Initialize a validator node - Given a validator node VN connected to base node BASE and wallet daemon WALLET_D - - # Fund wallet to send VN registration tx - When miner MINER mines 10 new blocks - When wallet WALLET has at least 2000 T - When validator node VN sends a registration transaction to base wallet WALLET - When miner MINER mines 26 new blocks - Then the validator node VN is listed as registered - - # Initialize indexer and connect wallet daemon - Given an indexer IDX connected to base node BASE - Given a wallet daemon WALLET_D connected to indexer IDX + Given a network with registered validator VN and wallet daemon WALLET_D # Create the sender account When I create an account ACC via the wallet daemon WALLET_D with 2000000 free coins diff --git a/integration_tests/tests/features/epoch_change.feature b/integration_tests/tests/features/epoch_change.feature index 44f2573905..b4bdf48f35 100644 --- a/integration_tests/tests/features/epoch_change.feature +++ b/integration_tests/tests/features/epoch_change.feature @@ -6,25 +6,7 @@ Feature: Epoch change Scenario: EndEpoch command is used on epoch change - # Initialize a base node, wallet, miner and VN - Given a base node BASE - Given a wallet WALLET connected to base node BASE - Given a miner MINER connected to base node BASE and wallet WALLET - - # Initialize two validator nodes - Given a validator node VAL connected to base node BASE and wallet daemon WALLET_D - Given validator VAL nodes connect to all other validators - - # Register VN - When miner MINER mines 10 new blocks - When wallet WALLET has at least 2000 T - When validator node VAL sends a registration transaction to base wallet WALLET - When miner MINER mines 26 new blocks - Then the validator node VAL is listed as registered - - # Initialize indexer and connect wallet daemon - Given an indexer IDX connected to base node BASE - Given a wallet daemon WALLET_D connected to indexer IDX + Given a network with registered validator VN and wallet daemon WALLET_D # Create account When I create an account ACC via the wallet daemon WALLET_D with 2000000 free coins @@ -33,13 +15,13 @@ Feature: Epoch change When wallet daemon WALLET_D publishes the template "faucet" using account ACC # Push a transaction through to get blocks -# When I call function "mint" on template "faucet" on VAL with args "amount_10000" named "FAUCET" +# When I call function "mint" on template "faucet" on VN with args "amount_10000" named "FAUCET" When I call function "mint" on template "faucet" with args "amount_10000" using account ACC to pay fees via wallet daemon WALLET_D named "FAUCET" - When Block height on VN VAL is at least 6 - When miner MINER mines 7 new blocks - Then VAL has scanned to at least height 40 - Then the validator node VAL has started epoch 4 + When Block height on VN VN is at least 6 + When miner NETWORK_MINER mines 15 new blocks + Then VN has scanned to at least height 40 + Then the validator node VN has started epoch 4 # @serial # Scenario: Committee is split into two during epoch change diff --git a/integration_tests/tests/features/fungible.feature b/integration_tests/tests/features/fungible.feature index cf6edbf372..33337dd3b6 100644 --- a/integration_tests/tests/features/fungible.feature +++ b/integration_tests/tests/features/fungible.feature @@ -4,28 +4,9 @@ @concurrent @fungible Feature: Fungible tokens - - Scenario: Mint fungible tokens - - ##### Setup - # Initialize a base node, wallet, miner and VN - Given a base node BASE - Given a wallet WALLET connected to base node BASE - Given a miner MINER connected to base node BASE and wallet WALLET - - # Initialize a validator node - Given a validator node VN connected to base node BASE and wallet daemon WALLET_D - # Fund wallet to send VN registration tx - When miner MINER mines 10 new blocks - When wallet WALLET has at least 2000 T - When validator node VN sends a registration transaction to base wallet WALLET - When miner MINER mines 26 new blocks - Then the validator node VN is listed as registered - - # Initialize indexer and connect wallet daemon - Given an indexer IDX connected to base node BASE - Given a wallet daemon WALLET_D connected to indexer IDX + Scenario: Mint fungible tokens + Given a network with registered validator VN and wallet daemon WALLET_D # Publish faucet template When I create an account ACC via the wallet daemon WALLET_D with 2000000 free coins diff --git a/integration_tests/tests/features/nft.feature b/integration_tests/tests/features/nft.feature index 03242b58ac..8fa6e6df5a 100644 --- a/integration_tests/tests/features/nft.feature +++ b/integration_tests/tests/features/nft.feature @@ -6,26 +6,7 @@ Feature: NFTs Scenario: Mint, mutate and burn non fungible tokens - - ###### Setup - # Initialize a base node, wallet, miner and VN - Given a base node BASE - Given a wallet WALLET connected to base node BASE - Given a miner MINER connected to base node BASE and wallet WALLET - - # Initialize a validator node - Given a validator node VN connected to base node BASE and wallet daemon WALLET_D - - # Fund wallet to send VN registration tx - When miner MINER mines 10 new blocks - When wallet WALLET has at least 2000 T - When validator node VN sends a registration transaction to base wallet WALLET - When miner MINER mines 26 new blocks - Then the validator node VN is listed as registered - - # Initialize indexer and connect wallet daemon - Given an indexer IDX connected to base node BASE - Given a wallet daemon WALLET_D connected to indexer IDX + Given a network with registered validator VN and wallet daemon WALLET_D # Publish the "basic_nft" template When I create an account ACC via the wallet daemon WALLET_D with 2000000 free coins @@ -78,26 +59,7 @@ Feature: NFTs Scenario: Create resource and mint in one transaction - - ##### Setup - # Initialize a base node, wallet, miner and VN - Given a base node BASE - Given a wallet WALLET connected to base node BASE - Given a miner MINER connected to base node BASE and wallet WALLET - - # Initialize a validator node - Given a validator node VN connected to base node BASE and wallet daemon WALLET_D - - # Fund wallet to send VN registration tx - When miner MINER mines 10 new blocks - When wallet WALLET has at least 2000 T - When validator node VN sends a registration transaction to base wallet WALLET - When miner MINER mines 26 new blocks - Then the validator node VN is listed as registered - - # Initialize indexer and connect wallet daemon - Given an indexer IDX connected to base node BASE - Given a wallet daemon WALLET_D connected to indexer IDX + Given a network with registered validator VN and wallet daemon WALLET_D # Publish the "basic_nft" template When I create an account ACC via the wallet daemon WALLET_D with 2000000 free coins diff --git a/integration_tests/tests/features/substates.feature b/integration_tests/tests/features/substates.feature index beb35defd9..4b49932831 100644 --- a/integration_tests/tests/features/substates.feature +++ b/integration_tests/tests/features/substates.feature @@ -6,34 +6,13 @@ Feature: Substates Scenario: Transactions with DOWN local substates are rejected - # Initialize a base node, wallet, miner and VN - Given a base node BASE - Given a wallet WALLET connected to base node BASE - Given a miner MINER connected to base node BASE and wallet WALLET - - # Initialize a VN - Given a validator node VAL_1 connected to base node BASE and wallet daemon WALLET_D - - # The wallet must have some funds before the VN sends transactions - When miner MINER mines 6 new blocks - When wallet WALLET has at least 20 T - - # VN registration - When validator node VAL_1 sends a registration transaction to base wallet WALLET - - # Register the "counter" template - When base wallet WALLET registers the template "counter" - When miner MINER mines 23 new blocks - Then VAL_1 has scanned to at least height 26 - Then the validator node VAL_1 is listed as registered - Then the template "counter" is listed as registered by the validator node VAL_1 - - # Initialize indexer and connect wallet daemon - Given an indexer IDX connected to base node BASE - Given a wallet daemon WALLET_D connected to indexer IDX + Given a network with registered validator VN and wallet daemon WALLET_D # Create account - When I create an account ACC via the wallet daemon WALLET_D with 10000 free coins + When I create an account ACC via the wallet daemon WALLET_D with 10000000 free coins + + # Publish the "counter" template + When wallet daemon WALLET_D publishes the template "counter" using account ACC # Create a new Counter component When I call function "new" on template "counter" using account ACC to pay fees via wallet daemon WALLET_D named "COUNTER_1" diff --git a/integration_tests/tests/features/wallet_daemon.feature b/integration_tests/tests/features/wallet_daemon.feature index 7aea616f38..6d85ecc61f 100644 --- a/integration_tests/tests/features/wallet_daemon.feature +++ b/integration_tests/tests/features/wallet_daemon.feature @@ -6,29 +6,7 @@ Feature: Wallet Daemon Scenario: Create account and transfer faucets via wallet daemon - # Initialize a base node, wallet, miner and VN - Given a base node BASE - Given a wallet WALLET connected to base node BASE - Given a miner MINER connected to base node BASE and wallet WALLET - - # Initialize a VN - Given a validator node VAL_1 connected to base node BASE and wallet daemon WALLET_D - - # The wallet must have some funds before the VN sends transactions - When miner MINER mines 4 new blocks - When wallet WALLET has at least 5000 T - - # VN registration - When validator node VAL_1 sends a registration transaction to base wallet WALLET - When miner MINER mines 26 new blocks - Then VAL_1 has scanned to at least height 27 - Then the validator node VAL_1 is listed as registered - - # Initialize an indexer - Given an indexer IDX connected to base node BASE - - # Initialize the wallet daemon - Given a wallet daemon WALLET_D connected to indexer IDX + Given a network with registered validator VN and wallet daemon WALLET_D # Publish the "fauset" template When I create an account ACC via the wallet daemon WALLET_D with 2000000 free coins @@ -36,18 +14,14 @@ Feature: Wallet Daemon # Create two accounts to test sending the tokens When I create an account ACC_1 via the wallet daemon WALLET_D with 10000 free coins - When I create an account ACC_2 via the wallet daemon WALLET_D - # TODO: remove the wait - When I wait 3 seconds - When I check the balance of ACC_2 on wallet daemon WALLET_D the amount is exactly 0 + When I create an account ACC_2 via the wallet daemon WALLET_D with 100000 free coins + When I check the balance of ACC_2 on wallet daemon WALLET_D the amount is at least 10000 # Create a new Faucet component When I call function "mint" on template "faucet" using account ACC_1 to pay fees via wallet daemon WALLET_D with args "10000" named "FAUCET" # Submit a transaction manifest When I print the cucumber world - # TODO: remove the wait - When I wait 5 seconds When I submit a transaction manifest via wallet daemon WALLET_D with inputs "FAUCET, ACC_1" named "TX1" ``` let faucet = global!["FAUCET/components/TestFaucet"]; @@ -67,38 +41,19 @@ Feature: Wallet Daemon let faucet_resource = global!["FAUCET/resources/0"]; // Withdraw 50 of the tokens and send them to acc2 - let tokens = acc1.withdraw(faucet_resource, Amount(50)); + let tokens = acc1.withdraw(faucet_resource, Amount(1000)); acc2.deposit(tokens); acc2.balance(faucet_resource); acc1.balance(faucet_resource); ``` - # TODO: remove the wait - When I wait 5 seconds # Check balances # `take_free_coins` deposits 10000 faucet tokens, allow up to 2000 in fees - When I check the balance of ACC_1 on wallet daemon WALLET_D the amount is at least 8000 - # TODO: Figure out why this is taking more than 10 seconds to update - # When I wait for ACC_2 on wallet daemon WALLET_D to have balance eq 50 + # TODO: this doesnt check the faucet tokens resource +# When I check the balance of ACC_1 on wallet daemon WALLET_D the amount is exactly 0 +# When I wait for ACC_2 on wallet daemon WALLET_D to have balance eq 1000 Scenario: Claim and transfer confidential assets via wallet daemon - # Initialize a base node, wallet, miner and VN - Given a base node BASE - Given a wallet WALLET connected to base node BASE - Given a miner MINER connected to base node BASE and wallet WALLET - - # Initialize a VN - Given a validator node VN connected to base node BASE and wallet daemon WALLET_D - When miner MINER mines 4 new blocks - When wallet WALLET has at least 5000 T - When validator node VN sends a registration transaction to base wallet WALLET - When miner MINER mines 26 new blocks - Then the validator node VN is listed as registered - - # Initialize an indexer - Given an indexer IDX connected to base node BASE - - # Initialize the wallet daemon - Given a wallet daemon WALLET_D connected to indexer IDX + Given a network with registered validator VN and wallet daemon WALLET_D # When I create a component SECOND_LAYER_TARI of template "fees" on VN using "new" When I create an account ACCOUNT_1 via the wallet daemon WALLET_D with 10000 free coins @@ -107,8 +62,8 @@ Feature: Wallet Daemon When I burn 1000T on wallet NETWORK_CONSOLE_WALLET to proof BURN_PROOF for wallet daemon WALLET_D # unfortunately have to wait for this to get into the mempool.... - Then there is 1 transaction in the mempool of BASE within 10 seconds - When miner MINER mines 13 new blocks + Then there is 1 transaction in the mempool of NETWORK_BASE_NODE within 10 seconds + When miner NETWORK_MINER mines 13 new blocks Then VN has scanned to at least height 40 When I convert commitment in proof BURN_PROOF into COMM_ADDRESS address @@ -116,8 +71,6 @@ Feature: Wallet Daemon When I claim burn BURN_PROOF and spend it into account ACCOUNT_1 using wallet daemon WALLET_D When I print the cucumber world - # TODO: remove the wait - When I wait 5 seconds When I check the confidential balance of ACCOUNT_1 on wallet daemon WALLET_D the amount is at least 10000 # When account ACCOUNT_1 reveals 100 burned tokens via wallet daemon WALLET_D Then I make a confidential transfer with amount 5 from ACCOUNT_1 to ACCOUNT_2 creating output OUTPUT_TX1 via the wallet_daemon WALLET_D @@ -126,13 +79,8 @@ Feature: Wallet Daemon # Initialize a base node, wallet, miner and VN Given a network with registered validator VAL_1 and wallet daemon WALLET_D - # Initialize the wallet daemon - Given a wallet daemon WALLET_D connected to indexer IDX - # Create two accounts to test sending the tokens When I create an account ACC via the wallet daemon WALLET_D with 10000 free coins - When I print the cucumber world - # Mint a new account NFT When I mint a new non fungible token NFT on ACC using wallet daemon WALLET_D diff --git a/integration_tests/tests/steps/wallet_daemon.rs b/integration_tests/tests/steps/wallet_daemon.rs index de267e7b18..4e41fffbdd 100644 --- a/integration_tests/tests/steps/wallet_daemon.rs +++ b/integration_tests/tests/steps/wallet_daemon.rs @@ -120,8 +120,6 @@ async fn when_i_create_transfer_proof_via_wallet_daemon( amount, wallet_daemon_name, outputs_name, - None, - None, ) .await; }