Skip to content

Commit

Permalink
check total supply
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Sep 4, 2024
1 parent 50db33f commit 1e36a05
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions crates/tests/src/integration/ledger_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,21 @@ fn pgf_governance_proposal() -> Result<()> {
assert_matches!(captured.result, Ok(_));
assert!(captured.contains(TX_APPLIED_SUCCESS));

// 1.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: 0"));

// 1. Submit proposal
let albert = defaults::albert_address();
let pgf_stewards = StewardsUpdate {
Expand Down Expand Up @@ -1096,6 +1111,24 @@ fn pgf_governance_proposal() -> Result<()> {
// 4. Query the proposal and check the result is the one voted by the
// validator (majority)
while node.current_epoch().0 <= 25 {
if node.current_epoch().0 == 25 {
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: \
114400019.043523"
));
}

node.next_epoch();
}

Expand All @@ -1113,6 +1146,23 @@ fn pgf_governance_proposal() -> Result<()> {

// 5. Wait proposals grace and check proposal author funds
while node.current_epoch().0 < 31 {
if node.current_epoch().0 == 30 {
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: \
114400023.070159"
));
}
node.next_epoch();
}
let query_balance_args = vec![
Expand Down

0 comments on commit 1e36a05

Please sign in to comment.