35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package market
|
|
|
|
import (
|
|
"github.com/filecoin-project/go-address"
|
|
"github.com/filecoin-project/go-state-types/abi"
|
|
"github.com/filecoin-project/lotus/chain/types"
|
|
"github.com/filecoin-project/specs-actors/actors/builtin/market"
|
|
"github.com/filecoin-project/specs-actors/actors/util/adt"
|
|
)
|
|
|
|
type v0State struct {
|
|
market.State
|
|
store adt.Store
|
|
}
|
|
|
|
func (s *v0State) TotalLocked() (abi.TokenAmount, error) {
|
|
fml := types.BigAdd(s.TotalClientLockedCollateral, s.TotalProviderLockedCollateral)
|
|
fml = types.BigAdd(fml, s.TotalClientStorageFee)
|
|
return fml, nil
|
|
}
|
|
|
|
func (s *v0State) EscrowTable() (BalanceTable, error) {
|
|
return adt.AsBalanceTable(s.store, s.State.EscrowTable)
|
|
}
|
|
|
|
func (s *v0State) LockedTable() (BalanceTable, error) {
|
|
return adt.AsBalanceTable(s.store, s.State.LockedTable)
|
|
}
|
|
|
|
func (s *v0State) VerifyDealsForActivation(
|
|
minerAddr address.Address, deals []abi.DealID, currEpoch, sectorExpiry abi.ChainEpoch,
|
|
) (weight, verifiedWeight abi.DealWeight, err error) {
|
|
return market.ValidateDealsForActivation(&s.State, s.store, deals, minerAddr, sectorExpiry, currEpoch)
|
|
}
|