Skip to content

Commit

Permalink
replace total_supply with circulating_supply (#1466)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexytsu authored Oct 26, 2023
1 parent 4419953 commit ca25602
Show file tree
Hide file tree
Showing 18 changed files with 86 additions and 78 deletions.
1 change: 1 addition & 0 deletions integration_tests/src/tests/batch_onboarding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ pub fn batch_onboarding_test(v: &dyn VM, v2: bool) {
v,
&Policy::default(),
&[invariant_failure_patterns::REWARD_STATE_EPOCH_MISMATCH.to_owned()],
None,
);
}

Expand Down
4 changes: 2 additions & 2 deletions integration_tests/src/tests/change_beneficiary_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub fn change_beneficiary_success_test(v: &dyn VM) {
get_beneficiary_return = get_beneficiary(v, &query_addr, &miner_id);
assert!(get_beneficiary_return.proposed.is_none());
assert_active(&change_another_beneificiary_proposal, &get_beneficiary_return.active);
assert_invariants(v, &Policy::default());
assert_invariants(v, &Policy::default(), None);
}

#[vm_test]
Expand Down Expand Up @@ -218,7 +218,7 @@ pub fn change_beneficiary_fail_test(v: &dyn VM) {
change_beneficiary(v, &owner, &miner_id, &back_owner_proposal);
change_beneficiary(v, &beneficiary, &miner_id, &back_owner_proposal);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

fn assert_pending(
Expand Down
6 changes: 3 additions & 3 deletions integration_tests/src/tests/change_owner_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn change_owner_success_test(v: &dyn VM) {
assert_eq!(new_owner, minfo.owner);
assert_eq!(new_owner, minfo.beneficiary);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand Down Expand Up @@ -85,7 +85,7 @@ pub fn keep_beneficiary_when_owner_changed_test(v: &dyn VM) {
assert_eq!(new_owner, minfo.owner);
assert_eq!(beneficiary, minfo.beneficiary);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

pub fn change_owner_fail_test(v: &dyn VM) {
Expand Down Expand Up @@ -155,5 +155,5 @@ pub fn change_owner_fail_test(v: &dyn VM) {
assert_eq!(addr, minfo.owner);
assert_eq!(addr, minfo.beneficiary);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}
10 changes: 8 additions & 2 deletions integration_tests/src/tests/commit_post_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ pub fn submit_post_succeeds_test(v: &dyn VM) {
let p_st: PowerState = get_state(v, &STORAGE_POWER_ACTOR_ADDR).unwrap();
assert_eq!(sector_power.raw, p_st.total_bytes_committed);

assert_invariants(v, &Policy::default());
assert_invariants(v, &Policy::default(), None);
}

#[vm_test]
Expand Down Expand Up @@ -220,7 +220,7 @@ pub fn skip_sector_test(v: &dyn VM) {
let network_stats = get_network_stats(v);
assert!(network_stats.total_bytes_committed.is_zero());
assert!(network_stats.total_pledge_collateral.is_positive());
assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand Down Expand Up @@ -283,6 +283,7 @@ pub fn missed_first_post_deadline_test(v: &dyn VM) {
v,
&Policy::default(),
&[invariant_failure_patterns::REWARD_STATE_EPOCH_MISMATCH.to_owned()],
None,
);
}

Expand Down Expand Up @@ -388,6 +389,7 @@ pub fn overdue_precommit_test(v: &dyn VM) {
v,
&Policy::default(),
&[invariant_failure_patterns::REWARD_STATE_EPOCH_MISMATCH.to_owned()],
None,
);
}

Expand Down Expand Up @@ -459,6 +461,7 @@ pub fn aggregate_bad_sector_number_test(v: &dyn VM) {
v,
&Policy::default(),
&[invariant_failure_patterns::REWARD_STATE_EPOCH_MISMATCH.to_owned()],
None,
);
}

Expand Down Expand Up @@ -562,6 +565,7 @@ pub fn aggregate_size_limits_test(v: &dyn VM) {
v,
&Policy::default(),
&[invariant_failure_patterns::REWARD_STATE_EPOCH_MISMATCH.to_owned()],
None,
);
}

Expand Down Expand Up @@ -629,6 +633,7 @@ pub fn aggregate_bad_sender_test(v: &dyn VM) {
v,
&Policy::default(),
&[invariant_failure_patterns::REWARD_STATE_EPOCH_MISMATCH.to_owned()],
None,
);
}

Expand Down Expand Up @@ -748,5 +753,6 @@ pub fn aggregate_one_precommit_expires_test(v: &dyn VM) {
v,
&Policy::default(),
&[invariant_failure_patterns::REWARD_STATE_EPOCH_MISMATCH.to_owned()],
None,
);
}
1 change: 1 addition & 0 deletions integration_tests/src/tests/extend_sectors_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ pub fn extend_legacy_sector_with_deals_test(v: &dyn VM, do_extend2: bool) {
v,
&Policy::default(),
&[invariant_failure_patterns::REWARD_STATE_EPOCH_MISMATCH.to_owned()],
None,
);
}

Expand Down
4 changes: 2 additions & 2 deletions integration_tests/src/tests/move_partitions_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub fn move_partitions_test(v: &dyn VM) {

cron_tick(v);
v.set_epoch(v.epoch() + 1);
assert_invariants(v, &Policy::default());
assert_invariants(v, &Policy::default(), None);
}

fn submit_post_succeeds_test(v: &dyn VM, miner_info: MinerInfo, sector_info: SectorInfo) {
Expand All @@ -84,7 +84,7 @@ fn submit_post_succeeds_test(v: &dyn VM, miner_info: MinerInfo, sector_info: Sec
let p_st: PowerState = get_state(v, &STORAGE_POWER_ACTOR_ADDR).unwrap();
assert_eq!(sector_power.raw, p_st.total_bytes_committed);

assert_invariants(v, &Policy::default());
assert_invariants(v, &Policy::default(), None);
}

struct SectorInfo {
Expand Down
8 changes: 4 additions & 4 deletions integration_tests/src/tests/multisig_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub fn proposal_hash_test(v: &dyn VM) {
expect.matches(v.take_invocations().last().unwrap());

assert_eq!(sys_act_start_bal + fil_delta, v.actor(&SYSTEM_ACTOR_ADDR).unwrap().balance);
assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

pub fn test_delete_self_inner_test(v: &dyn VM, signers: u64, threshold: usize, remove_idx: usize) {
Expand Down Expand Up @@ -168,7 +168,7 @@ pub fn test_delete_self_inner_test(v: &dyn VM, signers: u64, threshold: usize, r
let new_signers: HashSet<Address> = HashSet::from_iter(st.signers);
let diff: Vec<&Address> = old_signers.symmetric_difference(&new_signers).collect();
assert_eq!(vec![&(addrs[remove_idx])], diff);
assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand All @@ -194,7 +194,7 @@ pub fn swap_self_1_of_2_test(v: &dyn VM) {
);
let st: MsigState = get_state(v, &msig_addr).unwrap();
assert_eq!(vec![bob, chuck], st.signers);
assert_invariants(v, &Policy::default());
assert_invariants(v, &Policy::default(), None);
}

#[vm_test]
Expand Down Expand Up @@ -266,7 +266,7 @@ pub fn swap_self_2_of_3_test(v: &dyn VM) {
let st: MsigState = get_state(v, &msig_addr).unwrap();
assert_eq!(vec![bob, chuck, alice], st.signers);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

fn create_msig(v: &dyn VM, signers: &[Address], threshold: u64) -> Address {
Expand Down
3 changes: 2 additions & 1 deletion integration_tests/src/tests/power_scenario_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub fn power_create_miner_test(v: &dyn VM) {
};

expect.matches(v.take_invocations().last().unwrap());
assert_invariants(v, &Policy::default());
assert_invariants(v, &Policy::default(), None);
}

#[vm_test]
Expand Down Expand Up @@ -219,5 +219,6 @@ pub fn cron_tick_test(v: &dyn VM) {
v,
&Policy::default(),
&[invariant_failure_patterns::REWARD_STATE_EPOCH_MISMATCH.to_owned()],
None,
);
}
32 changes: 16 additions & 16 deletions integration_tests/src/tests/publish_deals_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ pub fn psd_mismatched_provider_test(v: &dyn VM) {
let good_inputs = bf_all(deal_ret.valid_deals);
assert_eq!(vec![0, 2], good_inputs);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand All @@ -163,7 +163,7 @@ pub fn psd_bad_piece_size_test(v: &dyn VM) {
let good_inputs = bf_all(deal_ret.valid_deals);
assert_eq!(vec![1], good_inputs);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand All @@ -180,7 +180,7 @@ pub fn psd_start_time_in_past_test(v: &dyn VM) {
let good_inputs = bf_all(deal_ret.valid_deals);
assert_eq!(vec![1], good_inputs);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand All @@ -196,7 +196,7 @@ pub fn psd_client_address_cannot_be_resolved_test(v: &dyn VM) {
let good_inputs = bf_all(deal_ret.valid_deals);
assert_eq!(vec![0], good_inputs);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand All @@ -211,7 +211,7 @@ pub fn psd_no_client_lockup_test(v: &dyn VM) {
let good_inputs = bf_all(deal_ret.valid_deals);
assert_eq!(vec![1], good_inputs);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand Down Expand Up @@ -241,7 +241,7 @@ pub fn psd_not_enough_client_lockup_for_batch_test(v: &dyn VM) {
let good_inputs = bf_all(deal_ret.valid_deals);
assert_eq!(vec![0], good_inputs);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand Down Expand Up @@ -278,7 +278,7 @@ pub fn psd_not_enough_provider_lockup_for_batch_test(v: &dyn VM) {
let good_inputs = bf_all(deal_ret.valid_deals);
assert_eq!(vec![0], good_inputs);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand All @@ -305,7 +305,7 @@ pub fn psd_duplicate_deal_in_batch_test(v: &dyn VM) {
let good_inputs = bf_all(deal_ret.valid_deals);
assert_eq!(vec![0, 1, 4], good_inputs);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand All @@ -330,7 +330,7 @@ pub fn psd_duplicate_deal_in_state_test(v: &dyn VM) {
let good_inputs2 = bf_all(deal_ret2.valid_deals);
assert_eq!(vec![1], good_inputs2);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand All @@ -357,7 +357,7 @@ pub fn psd_verified_deal_fails_getting_datacap_test(v: &dyn VM) {
let good_inputs = bf_all(deal_ret.valid_deals);
assert_eq!(vec![0, 1], good_inputs);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand Down Expand Up @@ -416,7 +416,7 @@ pub fn psd_random_assortment_of_failures_test(v: &dyn VM) {
let good_inputs = bf_all(deal_ret.valid_deals);
assert_eq!(vec![0, 2, 8], good_inputs);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand All @@ -441,7 +441,7 @@ pub fn psd_all_deals_are_bad_test(v: &dyn VM) {
);

batcher.publish_fail(a.worker);
assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand Down Expand Up @@ -517,7 +517,7 @@ pub fn psd_bad_sig_test(v: &dyn VM) {
}
.matches(v.take_invocations().last().unwrap());

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand All @@ -537,7 +537,7 @@ pub fn all_deals_are_good_test(v: &dyn VM) {
let good_inputs = bf_all(deal_ret.valid_deals);
assert_eq!(vec![0, 1, 2, 3, 4], good_inputs);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand All @@ -563,7 +563,7 @@ pub fn psd_valid_deals_with_ones_longer_than_540_test(v: &dyn VM) {
let good_inputs = bf_all(deal_ret.valid_deals);
assert_eq!(vec![0, 1, 2], good_inputs);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}

#[vm_test]
Expand Down Expand Up @@ -591,5 +591,5 @@ pub fn psd_deal_duration_too_long_test(v: &dyn VM) {
let good_inputs = bf_all(deal_ret.valid_deals);
assert_eq!(vec![0, 1], good_inputs);

assert_invariants(v, &Policy::default())
assert_invariants(v, &Policy::default(), None)
}
Loading

0 comments on commit ca25602

Please sign in to comment.