Skip to content

Commit

Permalink
comment price asserts for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
andymck committed Dec 3, 2024
1 parent 2879a99 commit 65df9d5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
4 changes: 4 additions & 0 deletions mobile_verifier/src/reward_shares.rs
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,8 @@ mod test {

// todo: rebalance the tests to use a normalised hnt price
let hnt_price = HntPrice::new(10000000000000000, 8);
assert_eq!(hnt_price.hnt_price, dec!(100000000));
assert_eq!(hnt_price.price_per_hnt_bone, dec!(1));

let data_transfer_rewards =
TransferRewards::from_transfer_sessions(hnt_price, data_transfer_map, &reward_shares)
Expand Down Expand Up @@ -1010,6 +1012,8 @@ mod test {

// todo: rebalance the tests to use a normalised hnt price
let hnt_price = HntPrice::new(10000000000000000, 8);
assert_eq!(hnt_price.hnt_price, dec!(100000000));
assert_eq!(hnt_price.price_per_hnt_bone, dec!(1));

let reward_shares =
DataTransferAndPocAllocatedRewardBuckets::new(rewards_info.epoch_emissions);
Expand Down
35 changes: 28 additions & 7 deletions mobile_verifier/tests/integrations/hex_boosting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ async fn test_poc_with_boosted_hexes(pool: PgPool) -> anyhow::Result<()> {
.to_u64()
.unwrap();

let hnt_price = HntPrice::new(1000000000000000, 8);
// todo: rebalance the tests to use a normalised hnt price
let hnt_price = HntPrice::new(10000000000000000, 8);
assert_eq!(hnt_price.hnt_price, dec!(100000000));
assert_eq!(hnt_price.price_per_hnt_bone, dec!(1));

let (_, rewards) = tokio::join!(
// run rewards for poc and dc
Expand Down Expand Up @@ -328,7 +331,10 @@ async fn test_poc_boosted_hexes_thresholds_not_met(pool: PgPool) -> anyhow::Resu

let reward_info = default_rewards_info(82_191_780_821_917, Duration::hours(24));

let hnt_price = HntPrice::new(1000000000000000, 8);
// todo: rebalance the tests to use a normalised hnt price
let hnt_price = HntPrice::new(10000000000000000, 8);
assert_eq!(hnt_price.hnt_price, dec!(100000000));
assert_eq!(hnt_price.price_per_hnt_bone, dec!(1));

let (_, rewards) = tokio::join!(
// run rewards for poc and dc
Expand Down Expand Up @@ -492,7 +498,10 @@ async fn test_poc_with_multi_coverage_boosted_hexes(pool: PgPool) -> anyhow::Res

let hex_boosting_client = MockHexBoostingClient::new(boosted_hexes);

let hnt_price = HntPrice::new(1000000000000000, 8);
// todo: rebalance the tests to use a normalised hnt price
let hnt_price = HntPrice::new(10000000000000000, 8);
assert_eq!(hnt_price.hnt_price, dec!(100000000));
assert_eq!(hnt_price.price_per_hnt_bone, dec!(1));

let (_, rewards) = tokio::join!(
// run rewards for poc and dc
Expand Down Expand Up @@ -668,7 +677,10 @@ async fn test_expired_boosted_hex(pool: PgPool) -> anyhow::Result<()> {

let hex_boosting_client = MockHexBoostingClient::new(boosted_hexes);

let hnt_price = HntPrice::new(1000000000000000, 8);
// todo: rebalance the tests to use a normalised hnt price
let hnt_price = HntPrice::new(10000000000000000, 8);
assert_eq!(hnt_price.hnt_price, dec!(100000000));
assert_eq!(hnt_price.price_per_hnt_bone, dec!(1));

let (_, rewards) = tokio::join!(
// run rewards for poc and dc
Expand Down Expand Up @@ -801,7 +813,10 @@ async fn test_reduced_location_score_with_boosted_hexes(pool: PgPool) -> anyhow:
.to_u64()
.unwrap();

let hnt_price = HntPrice::new(1000000000000000, 8);
// todo: rebalance the tests to use a normalised hnt price
let hnt_price = HntPrice::new(10000000000000000, 8);
assert_eq!(hnt_price.hnt_price, dec!(100000000));
assert_eq!(hnt_price.price_per_hnt_bone, dec!(1));

let (_, rewards) = tokio::join!(
// run rewards for poc and dc
Expand Down Expand Up @@ -982,7 +997,10 @@ async fn test_distance_from_asserted_removes_boosting_but_not_location_trust(
.to_u64()
.unwrap();

let hnt_price = HntPrice::new(1000000000000000, 8);
// todo: rebalance the tests to use a normalised hnt price
let hnt_price = HntPrice::new(10000000000000000, 8);
assert_eq!(hnt_price.hnt_price, dec!(100000000));
assert_eq!(hnt_price.price_per_hnt_bone, dec!(1));

let (_, rewards) = tokio::join!(
// run rewards for poc and dc
Expand Down Expand Up @@ -1188,7 +1206,10 @@ async fn test_poc_with_cbrs_and_multi_coverage_boosted_hexes(pool: PgPool) -> an
.to_u64()
.unwrap();

let hnt_price = HntPrice::new(1000000000000000, 8);
// todo: rebalance the tests to use a normalised hnt price
let hnt_price = HntPrice::new(10000000000000000, 8);
assert_eq!(hnt_price.hnt_price, dec!(100000000));
assert_eq!(hnt_price.price_per_hnt_bone, dec!(1));

let (_, rewards) = tokio::join!(
// run rewards for poc and dc
Expand Down
3 changes: 3 additions & 0 deletions mobile_verifier/tests/integrations/rewarder_poc_dc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ async fn test_poc_and_dc_rewards(pool: PgPool) -> anyhow::Result<()> {

let hex_boosting_client = MockHexBoostingClient::new(boosted_hexes);

// todo: rebalance the tests to use a normalised hnt price
let hnt_price = HntPrice::new(10000000000000000, 8);
assert_eq!(hnt_price.hnt_price, dec!(100000000));
assert_eq!(hnt_price.price_per_hnt_bone, dec!(1));

let (_, rewards) = tokio::join!(
// run rewards for poc and dc
Expand Down

0 comments on commit 65df9d5

Please sign in to comment.