chore: chain/actors: Use type proxies instead of versioned GST imports

This commit is contained in:
Łukasz Magiera
2023-08-29 15:28:16 +02:00
parent c1304dee25
commit 4ee20965fa
45 changed files with 145 additions and 86 deletions
+5 -7
View File
@@ -19,8 +19,6 @@ import (
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/big"
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/dline"
@@ -794,7 +792,7 @@ func (a *StateAPI) StateGetAllocationForPendingDeal(ctx context.Context, dealId
if err != nil {
return nil, err
}
if allocationId == verifregtypes.NoAllocationID {
if allocationId == verifreg.NoAllocationID {
return nil, nil
}
@@ -1040,7 +1038,7 @@ func (a *StateAPI) StateMinerAllocated(ctx context.Context, addr address.Address
return mas.GetAllocatedSectors()
}
func (a *StateAPI) StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*minertypes.SectorPreCommitOnChainInfo, error) {
func (a *StateAPI) StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorPreCommitOnChainInfo, error) {
ts, err := a.Chain.GetTipSetFromKey(ctx, tsk)
if err != nil {
return nil, xerrors.Errorf("loading tipset %s: %w", tsk, err)
@@ -1315,7 +1313,7 @@ func (m *StateModule) MsigGetPending(ctx context.Context, addr address.Address,
var initialPledgeNum = types.NewInt(110)
var initialPledgeDen = types.NewInt(100)
func (a *StateAPI) StateMinerPreCommitDepositForPower(ctx context.Context, maddr address.Address, pci minertypes.SectorPreCommitInfo, tsk types.TipSetKey) (types.BigInt, error) {
func (a *StateAPI) StateMinerPreCommitDepositForPower(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk types.TipSetKey) (types.BigInt, error) {
ts, err := a.Chain.GetTipSetFromKey(ctx, tsk)
if err != nil {
return types.EmptyInt, xerrors.Errorf("loading tipset %s: %w", tsk, err)
@@ -1347,7 +1345,7 @@ func (a *StateAPI) StateMinerPreCommitDepositForPower(ctx context.Context, maddr
sectorWeight = builtin.QAPowerForWeight(ssize, duration, w, vw)
}
} else {
sectorWeight = minertypes.QAPowerMax(ssize)
sectorWeight = miner.QAPowerMax(ssize)
}
var powerSmoothed builtin.FilterEstimate
@@ -1379,7 +1377,7 @@ func (a *StateAPI) StateMinerPreCommitDepositForPower(ctx context.Context, maddr
return types.BigDiv(types.BigMul(deposit, initialPledgeNum), initialPledgeDen), nil
}
func (a *StateAPI) StateMinerInitialPledgeCollateral(ctx context.Context, maddr address.Address, pci minertypes.SectorPreCommitInfo, tsk types.TipSetKey) (types.BigInt, error) {
func (a *StateAPI) StateMinerInitialPledgeCollateral(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk types.TipSetKey) (types.BigInt, error) {
// TODO: this repeats a lot of the previous function. Fix that.
ts, err := a.Chain.GetTipSetFromKey(ctx, tsk)
if err != nil {
+3 -3
View File
@@ -35,7 +35,6 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
builtintypes "github.com/filecoin-project/go-state-types/builtin"
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/api"
@@ -43,6 +42,7 @@ import (
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/builtin"
lminer "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/gen"
"github.com/filecoin-project/lotus/chain/types"
mktsdagstore "github.com/filecoin-project/lotus/markets/dagstore"
@@ -488,7 +488,7 @@ func (sm *StorageMinerAPI) SectorReceive(ctx context.Context, meta api.RemoteSec
return err
}
func (sm *StorageMinerAPI) ComputeWindowPoSt(ctx context.Context, dlIdx uint64, tsk types.TipSetKey) ([]minertypes.SubmitWindowedPoStParams, error) {
func (sm *StorageMinerAPI) ComputeWindowPoSt(ctx context.Context, dlIdx uint64, tsk types.TipSetKey) ([]lminer.SubmitWindowedPoStParams, error) {
var ts *types.TipSet
var err error
if tsk == types.EmptyTSK {
@@ -1395,7 +1395,7 @@ func (sm *StorageMinerAPI) withdrawBalance(ctx context.Context, amount abi.Token
amount = available
}
params, err := actors.SerializeParams(&minertypes.WithdrawBalanceParams{
params, err := actors.SerializeParams(&lminer.WithdrawBalanceParams{
AmountRequested: amount,
})
if err != nil {