Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
brentstone committed Aug 27, 2024
1 parent 3c1af5d commit 80f33ec
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion crates/tests/src/integration/ledger_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ use test_log::test;
use crate::e2e::ledger_tests::prepare_proposal_data;
use crate::e2e::setup::constants::{
ALBERT, ALBERT_KEY, APFEL, BERTHA, BERTHA_KEY, BTC, CHRISTEL, CHRISTEL_KEY,
DAEWON, DOT, ESTER, ETH, GOVERNANCE_ADDRESS, KARTOFFEL, NAM, SCHNITZEL,
DAEWON, DOT, ESTER, ETH, GOVERNANCE_ADDRESS, KARTOFFEL, NAM, PGF_ADDRESS,
SCHNITZEL,
};
use crate::e2e::setup::{apply_use_device, ensure_hot_key};
use crate::integration::helpers::{
Expand Down Expand Up @@ -1151,6 +1152,44 @@ fn pgf_governance_proposal() -> Result<()> {
);
assert!(captured.contains("Pgf fundings: no fundings are currently set."));

// 7.1 Query total NAM supply and PGF balance
let query_balance_args = vec![
"balance",
"--owner",
PGF_ADDRESS,
"--token",
NAM,
"--ledger-address",
&validator_one_rpc,
];
let captured =
CapturedOutput::of(|| run(&node, Bin::Client, query_balance_args));
assert_matches!(captured.result, Ok(_));
assert!(captured.contains("nam: 13.785266"));

let query_total_supply_args = vec![
"total-supply",
"--token",
NAM,
"--ledger-address",
&validator_one_rpc,
];
let captured =
CapturedOutput::of(|| run(&node, Bin::Client, query_total_supply_args));
assert_matches!(captured.result, Ok(_));
assert!(captured.contains(
"token tnam1q9kn74xfzytqkqyycfrhycr8ajam8ny935cge0z5: 114400023904507 \
raw units"
));

let query_native_supply_args =
vec!["native-supply", "--ledger-address", &validator_one_rpc];
let captured = CapturedOutput::of(|| {
run(&node, Bin::Client, query_native_supply_args)
});
assert_matches!(captured.result, Ok(_));
assert!(captured.contains("nam: 114400010.119241"));

// 8. Submit proposal funding
let albert = defaults::albert_address();
let bertha = defaults::bertha_address();
Expand Down

0 comments on commit 80f33ec

Please sign in to comment.