From 2f65a20d1608613aeb2c445e55acd41204e3b415 Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Tue, 2 Aug 2022 18:54:42 -0400 Subject: [PATCH] Add IsDealActive func to template wq --- chain/actors/builtin/market/actor.go.template | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chain/actors/builtin/market/actor.go.template b/chain/actors/builtin/market/actor.go.template index a96c62e43..66298a18a 100644 --- a/chain/actors/builtin/market/actor.go.template +++ b/chain/actors/builtin/market/actor.go.template @@ -185,6 +185,10 @@ func GetDealFees(deal market{{.latestVersion}}.DealProposal, height abi.ChainEpo return ef, big.Sub(tf, ef) } +func IsDealActive(state market{{.latestVersion}}.DealState) bool { + return state.SectorStartEpoch > -1 && state.SlashEpoch == -1 +} + func labelFromGoString(s string) (market{{.latestVersion}}.DealLabel, error) { if utf8.ValidString(s) { return market{{.latestVersion}}.NewLabelFromString(s)