diff --git a/chain/actors/builtin/market/actor.go.template b/chain/actors/builtin/market/actor.go.template index febc93c1f8..9750f1352a 100644 --- a/chain/actors/builtin/market/actor.go.template +++ b/chain/actors/builtin/market/actor.go.template @@ -156,7 +156,19 @@ type DealState interface { } func DealStatesEqual(a, b DealState) bool { - return DealStatesEqual(a, b) + if a.SectorNumber() != b.SectorNumber() { + return false + } + if a.SectorStartEpoch() != b.SectorStartEpoch() { + return false + } + if a.LastUpdatedEpoch() != b.LastUpdatedEpoch() { + return false + } + if a.SlashEpoch() != b.SlashEpoch() { + return false + } + return true } type DealStateChanges struct { @@ -207,16 +219,7 @@ func (e *emptyDealState) SlashEpoch() abi.ChainEpoch { } func (e *emptyDealState) Equals(other DealState) bool { - if e.SectorStartEpoch() != other.SectorStartEpoch() { - return false - } - if e.LastUpdatedEpoch() != other.LastUpdatedEpoch() { - return false - } - if e.SlashEpoch() != other.SlashEpoch() { - return false - } - return true + return DealStatesEqual(e, other) } func EmptyDealState() DealState { diff --git a/chain/actors/builtin/market/market.go b/chain/actors/builtin/market/market.go index 4b603d6588..10e58663c0 100644 --- a/chain/actors/builtin/market/market.go +++ b/chain/actors/builtin/market/market.go @@ -284,7 +284,19 @@ type DealState interface { } func DealStatesEqual(a, b DealState) bool { - return DealStatesEqual(a, b) + if a.SectorNumber() != b.SectorNumber() { + return false + } + if a.SectorStartEpoch() != b.SectorStartEpoch() { + return false + } + if a.LastUpdatedEpoch() != b.LastUpdatedEpoch() { + return false + } + if a.SlashEpoch() != b.SlashEpoch() { + return false + } + return true } type DealStateChanges struct { @@ -334,16 +346,7 @@ func (e *emptyDealState) SlashEpoch() abi.ChainEpoch { } func (e *emptyDealState) Equals(other DealState) bool { - if e.SectorStartEpoch() != other.SectorStartEpoch() { - return false - } - if e.LastUpdatedEpoch() != other.LastUpdatedEpoch() { - return false - } - if e.SlashEpoch() != other.SlashEpoch() { - return false - } - return true + return DealStatesEqual(e, other) } func EmptyDealState() DealState {