Skip to content

Commit

Permalink
Arseni- add (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
seniakalma committed Jul 29, 2024
1 parent 26ac691 commit 5fef3cc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ docker run --name zebra-node --network zcash-network -p 18232:18232 qedit/zebra-
Here are the 3 options (No parameters will default to the first configuration)

```bash
docker run --network zcash-network -e ZCASH_NODE_ADDRESS=127.0.0.1 -e ZCASH_NODE_PORT=18232 -e ZCASH_NODE_PROTOCOL=http zcash_tx_tool
docker run --network zcash-network -e ZCASH_NODE_ADDRESS=zebra-node -e ZCASH_NODE_PORT=18232 -e ZCASH_NODE_PROTOCOL=http zcash_tx_tool
docker run --network zcash-network -e ZCASH_NODE_ADDRESS=<Domain> -e ZCASH_NODE_PORT=18232 -e ZCASH_NODE_PROTOCOL=http zcash_tx_tool
docker run -it --network zcash-network -e ZCASH_NODE_ADDRESS=127.0.0.1 -e ZCASH_NODE_PORT=18232 -e ZCASH_NODE_PROTOCOL=http zcash_tx_tool
docker run -it --network zcash-network -e ZCASH_NODE_ADDRESS=zebra-node -e ZCASH_NODE_PORT=18232 -e ZCASH_NODE_PROTOCOL=http zcash_tx_tool
docker run -it --network zcash-network -e ZCASH_NODE_ADDRESS=<Domain> -e ZCASH_NODE_PORT=18232 -e ZCASH_NODE_PROTOCOL=http zcash_tx_tool
```
The '-it' parameter was added to allow the demo to be interactive.
14 changes: 14 additions & 0 deletions src/commands/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::components::rpc_client::reqwest::ReqwestRpcClient;
use crate::prelude::*;
use crate::components::wallet::Wallet;
use crate::config::AppConfig;
use std::io::{self, Write};


/// Run the E2E test
Expand Down Expand Up @@ -61,6 +62,8 @@ impl Runnable for TestCmd {
let mut balances = TestBalances::get(&mut wallet);
print_balances("=== Initial balances ===", balances);

pause();

// --------------------- Shield miner's reward ---------------------

let shielding_tx = create_shield_coinbase_tx(miner, coinbase_txid, &mut wallet);
Expand All @@ -69,6 +72,8 @@ impl Runnable for TestCmd {
let expected_delta = TestBalances::new(500_000_000 /*coinbase_reward*/, 0);
balances = check_balances("=== Balances after shielding ===", balances, expected_delta, &mut wallet);

pause();

// --------------------- Create transfer ---------------------

let amount_to_transfer_1: i64 = 2;
Expand All @@ -78,9 +83,18 @@ impl Runnable for TestCmd {

let expected_delta = TestBalances::new(-amount_to_transfer_1, amount_to_transfer_1);
check_balances("=== Balances after transfer ===", balances, expected_delta, &mut wallet);

pause();
}
}

fn pause() {
print!("Press Enter to continue the demo...");
io::stdout().flush().unwrap();
let mut input = String::new();
io::stdin().read_line(&mut input).unwrap();
}

fn prepare_test(config: &Reader<AppConfig>, wallet: &mut Wallet, rpc_client: &mut ReqwestRpcClient) -> TxId {
wallet.reset();
sync_from_height(config.chain.nu5_activation_height, wallet, rpc_client);
Expand Down

0 comments on commit 5fef3cc

Please sign in to comment.