Skip to content

Commit

Permalink
Fix invariants (#186)
Browse files Browse the repository at this point in the history
Co-authored-by: zenground0 <[email protected]>
  • Loading branch information
ZenGround0 and ZenGround0 authored Apr 21, 2023
1 parent 39a3d9b commit 1e6cf0d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions builtin/v10/miner/invariants.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func CheckStateInvariants(st *State, store adt.Store, balance abi.TokenAmount) (

minerSummary.Deals = map[abi.DealID]DealSummary{}
var allSectors map[abi.SectorNumber]*SectorOnChainInfo
sectorsWithDeals := make(map[abi.SectorNumber]bool)
minerSummary.SectorsWithDeals = make(map[abi.SectorNumber]bool)
if sectorsArr, err := adt.AsArray(store, st.Sectors, SectorsAmtBitwidth); err != nil {
acc.Addf("error loading sectors")
} else {
Expand Down Expand Up @@ -101,7 +101,7 @@ func CheckStateInvariants(st *State, store adt.Store, balance abi.TokenAmount) (
}

if len(sector.DealIDs) > 0 {
sectorsWithDeals[abi.SectorNumber(sno)] = true
minerSummary.SectorsWithDeals[abi.SectorNumber(sno)] = true
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions builtin/v11/miner/invariants.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func CheckStateInvariants(st *State, store adt.Store, balance abi.TokenAmount) (

minerSummary.Deals = map[abi.DealID]DealSummary{}
var allSectors map[abi.SectorNumber]*SectorOnChainInfo
sectorsWithDeals := make(map[abi.SectorNumber]bool)
minerSummary.SectorsWithDeals = make(map[abi.SectorNumber]bool)
if sectorsArr, err := adt.AsArray(store, st.Sectors, SectorsAmtBitwidth); err != nil {
acc.Addf("error loading sectors")
} else {
Expand Down Expand Up @@ -101,7 +101,7 @@ func CheckStateInvariants(st *State, store adt.Store, balance abi.TokenAmount) (
}

if len(sector.DealIDs) > 0 {
sectorsWithDeals[abi.SectorNumber(sno)] = true
minerSummary.SectorsWithDeals[abi.SectorNumber(sno)] = true
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions builtin/v9/miner/invariants.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func CheckStateInvariants(st *State, store adt.Store, balance abi.TokenAmount) (

minerSummary.Deals = map[abi.DealID]DealSummary{}
var allSectors map[abi.SectorNumber]*SectorOnChainInfo
sectorsWithDeals := make(map[abi.SectorNumber]bool)
minerSummary.SectorsWithDeals = make(map[abi.SectorNumber]bool)
if sectorsArr, err := adt.AsArray(store, st.Sectors, SectorsAmtBitwidth); err != nil {
acc.Addf("error loading sectors")
} else {
Expand Down Expand Up @@ -101,7 +101,7 @@ func CheckStateInvariants(st *State, store adt.Store, balance abi.TokenAmount) (
}

if len(sector.DealIDs) > 0 {
sectorsWithDeals[abi.SectorNumber(sno)] = true
minerSummary.SectorsWithDeals[abi.SectorNumber(sno)] = true
}

return nil
Expand Down

0 comments on commit 1e6cf0d

Please sign in to comment.