Skip to content

Commit b81da94

Browse files
authored
test: validate that sector updates correctly update sector metadata (#1429)
1 parent db49df1 commit b81da94

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

integration_tests/src/tests/extend_sectors_test.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -672,14 +672,26 @@ pub fn extend_updated_sector_with_claims_test(v: &dyn VM) {
672672
.get_sector(&DynBlockstore::wrap(v.blockstore()), sector_number)
673673
.unwrap()
674674
.unwrap();
675-
assert_eq!(StoragePower::zero(), sector_info_after_update.deal_weight);
676675
// 0 space time
676+
assert_eq!(StoragePower::zero(), sector_info_after_update.deal_weight);
677677

678+
// 32 GiB * the remaining life of the sector
678679
assert_eq!(
679680
DealWeight::from((sector_info_after_update.expiration - v.epoch()) * (32i64 << 30)),
680681
sector_info_after_update.verified_deal_weight
681682
);
682-
// 32 GiB * the remaining life of the sector
683+
684+
// power base epoch is updated correctly
685+
assert_eq!(v.epoch(), sector_info_after_update.power_base_epoch);
686+
687+
// activation not changed
688+
assert_eq!(initial_sector_info.activation, sector_info_after_update.activation);
689+
690+
// replaced day reward updated
691+
assert_eq!(
692+
initial_sector_info.expected_day_reward,
693+
sector_info_after_update.replaced_day_reward
694+
);
683695

684696
// extend the updated sector
685697

@@ -720,14 +732,14 @@ pub fn extend_updated_sector_with_claims_test(v: &dyn VM) {
720732
.get_sector(&DynBlockstore::wrap(v.blockstore()), sector_number)
721733
.unwrap()
722734
.unwrap();
723-
assert_eq!(StoragePower::zero(), sector_info_after_extension.deal_weight);
724735
// 0 space time
736+
assert_eq!(StoragePower::zero(), sector_info_after_extension.deal_weight);
725737

738+
// 32 GiB * the remaining life of the sector
726739
assert_eq!(
727740
DealWeight::from((sector_info_after_extension.expiration - v.epoch()) * (32i64 << 30)),
728741
sector_info_after_extension.verified_deal_weight
729742
);
730-
// 32 GiB * the remaining life of the sector
731743

732744
assert_eq!(sector_info_after_extension.power_base_epoch, v.epoch());
733745
assert_eq!(sector_info_after_update.activation, sector_info_after_extension.activation);

0 commit comments

Comments
 (0)