Skip to content

Commit

Permalink
test/e2e: add a case to withdraw from PoW faucet
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Dec 30, 2022
1 parent b3d5d2e commit 6809cc1
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions tests/src/e2e/ledger_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,10 @@ fn run_ledger_load_state_and_reset() -> Result<()> {
/// 3. Submit a transaction to update an account's validity predicate
/// 4. Submit a custom tx
/// 5. Submit a tx to initialize a new account
/// 6. Query token balance
/// 7. Query the raw bytes of a storage key
/// 6. Submit a tx to withdraw from faucet account (requires PoW challenge
/// solution)
/// 7. Query token balance
/// 8. Query the raw bytes of a storage key
#[test]
fn ledger_txs_and_queries() -> Result<()> {
let test = setup::network(|genesis| genesis, None)?;
Expand Down Expand Up @@ -388,6 +390,24 @@ fn ledger_txs_and_queries() -> Result<()> {
"--ledger-address",
&validator_one_rpc,
],
// 6. Submit a tx to withdraw from faucet account (requires PoW challenge
// solution)
vec![
"transfer",
"--source",
"faucet",
"--target",
ALBERT,
"--token",
NAM,
"--amount",
"10.1",
// Faucet withdrawal requires an explicit signer
"--signer",
ALBERT,
"--ledger-address",
&validator_one_rpc,
],
];

for tx_args in &txs_args {
Expand All @@ -409,7 +429,7 @@ fn ledger_txs_and_queries() -> Result<()> {
}

let query_args_and_expected_response = vec![
// 6. Query token balance
// 7. Query token balance
(
vec![
"balance",
Expand All @@ -436,7 +456,7 @@ fn ledger_txs_and_queries() -> Result<()> {
let nam = find_address(&test, NAM)?;
let storage_key = token::balance_key(&nam, &christel).to_string();
let query_args_and_expected_response = vec![
// 7. Query storage key and get hex-encoded raw bytes
// 8. Query storage key and get hex-encoded raw bytes
(
vec![
"query-bytes",
Expand Down

0 comments on commit 6809cc1

Please sign in to comment.