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 28, 2022
1 parent 2d85050 commit 223e899
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 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 @@ -323,11 +325,11 @@ fn ledger_txs_and_queries() -> Result<()> {
NAM,
"--amount",
"10.1",
"--fee-amount",
"--gas-amount",
"0",
"--gas-limit",
"0",
"--fee-token",
"--gas-token",
NAM,
"--ledger-address",
&validator_one_rpc,
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 223e899

Please sign in to comment.