Update to go-state-types v0.10.0-alpha-2

This commit is contained in:
Aayush 2022-11-23 17:13:36 -05:00
parent 2651a38f89
commit 40278cd3c1
40 changed files with 334 additions and 213 deletions

View File

@ -208,16 +208,17 @@ func (s *dealStates{{.v}}) array() adt.Array {
} }
func fromV{{.v}}DealState(v{{.v}} market{{.v}}.DealState) DealState { func fromV{{.v}}DealState(v{{.v}} market{{.v}}.DealState) DealState {
{{if (le .v 8)}} ret := DealState{
return DealState{
SectorStartEpoch: v{{.v}}.SectorStartEpoch, SectorStartEpoch: v{{.v}}.SectorStartEpoch,
LastUpdatedEpoch: v{{.v}}.LastUpdatedEpoch, LastUpdatedEpoch: v{{.v}}.LastUpdatedEpoch,
SlashEpoch: v{{.v}}.SlashEpoch, SlashEpoch: v{{.v}}.SlashEpoch,
VerifiedClaim: 0, VerifiedClaim: 0,
} }
{{else}} {{if (ge .v 9)}}
return (DealState)(v{{.v}}) ret.VerifiedClaim = verifregtypes.AllocationId(v{{.v}}.VerifiedClaim)
{{end}} {{end}}
return ret
} }
type dealProposals{{.v}} struct { type dealProposals{{.v}} struct {

View File

@ -187,14 +187,14 @@ func (s *dealStates0) array() adt.Array {
} }
func fromV0DealState(v0 market0.DealState) DealState { func fromV0DealState(v0 market0.DealState) DealState {
ret := DealState{
return DealState{
SectorStartEpoch: v0.SectorStartEpoch, SectorStartEpoch: v0.SectorStartEpoch,
LastUpdatedEpoch: v0.LastUpdatedEpoch, LastUpdatedEpoch: v0.LastUpdatedEpoch,
SlashEpoch: v0.SlashEpoch, SlashEpoch: v0.SlashEpoch,
VerifiedClaim: 0, VerifiedClaim: 0,
} }
return ret
} }
type dealProposals0 struct { type dealProposals0 struct {

View File

@ -186,9 +186,16 @@ func (s *dealStates10) array() adt.Array {
} }
func fromV10DealState(v10 market10.DealState) DealState { func fromV10DealState(v10 market10.DealState) DealState {
ret := DealState{
SectorStartEpoch: v10.SectorStartEpoch,
LastUpdatedEpoch: v10.LastUpdatedEpoch,
SlashEpoch: v10.SlashEpoch,
VerifiedClaim: 0,
}
return (DealState)(v10) ret.VerifiedClaim = verifregtypes.AllocationId(v10.VerifiedClaim)
return ret
} }
type dealProposals10 struct { type dealProposals10 struct {

View File

@ -187,14 +187,14 @@ func (s *dealStates2) array() adt.Array {
} }
func fromV2DealState(v2 market2.DealState) DealState { func fromV2DealState(v2 market2.DealState) DealState {
ret := DealState{
return DealState{
SectorStartEpoch: v2.SectorStartEpoch, SectorStartEpoch: v2.SectorStartEpoch,
LastUpdatedEpoch: v2.LastUpdatedEpoch, LastUpdatedEpoch: v2.LastUpdatedEpoch,
SlashEpoch: v2.SlashEpoch, SlashEpoch: v2.SlashEpoch,
VerifiedClaim: 0, VerifiedClaim: 0,
} }
return ret
} }
type dealProposals2 struct { type dealProposals2 struct {

View File

@ -182,14 +182,14 @@ func (s *dealStates3) array() adt.Array {
} }
func fromV3DealState(v3 market3.DealState) DealState { func fromV3DealState(v3 market3.DealState) DealState {
ret := DealState{
return DealState{
SectorStartEpoch: v3.SectorStartEpoch, SectorStartEpoch: v3.SectorStartEpoch,
LastUpdatedEpoch: v3.LastUpdatedEpoch, LastUpdatedEpoch: v3.LastUpdatedEpoch,
SlashEpoch: v3.SlashEpoch, SlashEpoch: v3.SlashEpoch,
VerifiedClaim: 0, VerifiedClaim: 0,
} }
return ret
} }
type dealProposals3 struct { type dealProposals3 struct {

View File

@ -182,14 +182,14 @@ func (s *dealStates4) array() adt.Array {
} }
func fromV4DealState(v4 market4.DealState) DealState { func fromV4DealState(v4 market4.DealState) DealState {
ret := DealState{
return DealState{
SectorStartEpoch: v4.SectorStartEpoch, SectorStartEpoch: v4.SectorStartEpoch,
LastUpdatedEpoch: v4.LastUpdatedEpoch, LastUpdatedEpoch: v4.LastUpdatedEpoch,
SlashEpoch: v4.SlashEpoch, SlashEpoch: v4.SlashEpoch,
VerifiedClaim: 0, VerifiedClaim: 0,
} }
return ret
} }
type dealProposals4 struct { type dealProposals4 struct {

View File

@ -182,14 +182,14 @@ func (s *dealStates5) array() adt.Array {
} }
func fromV5DealState(v5 market5.DealState) DealState { func fromV5DealState(v5 market5.DealState) DealState {
ret := DealState{
return DealState{
SectorStartEpoch: v5.SectorStartEpoch, SectorStartEpoch: v5.SectorStartEpoch,
LastUpdatedEpoch: v5.LastUpdatedEpoch, LastUpdatedEpoch: v5.LastUpdatedEpoch,
SlashEpoch: v5.SlashEpoch, SlashEpoch: v5.SlashEpoch,
VerifiedClaim: 0, VerifiedClaim: 0,
} }
return ret
} }
type dealProposals5 struct { type dealProposals5 struct {

View File

@ -184,14 +184,14 @@ func (s *dealStates6) array() adt.Array {
} }
func fromV6DealState(v6 market6.DealState) DealState { func fromV6DealState(v6 market6.DealState) DealState {
ret := DealState{
return DealState{
SectorStartEpoch: v6.SectorStartEpoch, SectorStartEpoch: v6.SectorStartEpoch,
LastUpdatedEpoch: v6.LastUpdatedEpoch, LastUpdatedEpoch: v6.LastUpdatedEpoch,
SlashEpoch: v6.SlashEpoch, SlashEpoch: v6.SlashEpoch,
VerifiedClaim: 0, VerifiedClaim: 0,
} }
return ret
} }
type dealProposals6 struct { type dealProposals6 struct {

View File

@ -184,14 +184,14 @@ func (s *dealStates7) array() adt.Array {
} }
func fromV7DealState(v7 market7.DealState) DealState { func fromV7DealState(v7 market7.DealState) DealState {
ret := DealState{
return DealState{
SectorStartEpoch: v7.SectorStartEpoch, SectorStartEpoch: v7.SectorStartEpoch,
LastUpdatedEpoch: v7.LastUpdatedEpoch, LastUpdatedEpoch: v7.LastUpdatedEpoch,
SlashEpoch: v7.SlashEpoch, SlashEpoch: v7.SlashEpoch,
VerifiedClaim: 0, VerifiedClaim: 0,
} }
return ret
} }
type dealProposals7 struct { type dealProposals7 struct {

View File

@ -185,14 +185,14 @@ func (s *dealStates8) array() adt.Array {
} }
func fromV8DealState(v8 market8.DealState) DealState { func fromV8DealState(v8 market8.DealState) DealState {
ret := DealState{
return DealState{
SectorStartEpoch: v8.SectorStartEpoch, SectorStartEpoch: v8.SectorStartEpoch,
LastUpdatedEpoch: v8.LastUpdatedEpoch, LastUpdatedEpoch: v8.LastUpdatedEpoch,
SlashEpoch: v8.SlashEpoch, SlashEpoch: v8.SlashEpoch,
VerifiedClaim: 0, VerifiedClaim: 0,
} }
return ret
} }
type dealProposals8 struct { type dealProposals8 struct {

View File

@ -186,9 +186,16 @@ func (s *dealStates9) array() adt.Array {
} }
func fromV9DealState(v9 market9.DealState) DealState { func fromV9DealState(v9 market9.DealState) DealState {
ret := DealState{
SectorStartEpoch: v9.SectorStartEpoch,
LastUpdatedEpoch: v9.LastUpdatedEpoch,
SlashEpoch: v9.SlashEpoch,
VerifiedClaim: 0,
}
return (DealState)(v9) ret.VerifiedClaim = verifregtypes.AllocationId(v9.VerifiedClaim)
return ret
} }
type dealProposals9 struct { type dealProposals9 struct {

View File

@ -17,7 +17,7 @@ import (
"github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types"
miner{{.latestVersion}} "github.com/filecoin-project/go-state-types/builtin{{import .latestVersion}}miner" minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
{{range .versions}} {{range .versions}}
{{if (le . 7)}} {{if (le . 7)}}
@ -82,8 +82,8 @@ type State interface {
GetSector(abi.SectorNumber) (*SectorOnChainInfo, error) GetSector(abi.SectorNumber) (*SectorOnChainInfo, error)
FindSector(abi.SectorNumber) (*SectorLocation, error) FindSector(abi.SectorNumber) (*SectorLocation, error)
GetSectorExpiration(abi.SectorNumber) (*SectorExpiration, error) GetSectorExpiration(abi.SectorNumber) (*SectorExpiration, error)
GetPrecommittedSector(abi.SectorNumber) (*miner{{.latestVersion}}.SectorPreCommitOnChainInfo, error) GetPrecommittedSector(abi.SectorNumber) (*SectorPreCommitOnChainInfo, error)
ForEachPrecommittedSector(func(miner{{.latestVersion}}.SectorPreCommitOnChainInfo) error) error ForEachPrecommittedSector(func(SectorPreCommitOnChainInfo) error) error
LoadSectors(sectorNos *bitfield.BitField) ([]*SectorOnChainInfo, error) LoadSectors(sectorNos *bitfield.BitField) ([]*SectorOnChainInfo, error)
NumLiveSectors() (uint64, error) NumLiveSectors() (uint64, error)
IsAllocated(abi.SectorNumber) (bool, error) IsAllocated(abi.SectorNumber) (bool, error)
@ -112,7 +112,7 @@ type State interface {
sectors() (adt.Array, error) sectors() (adt.Array, error)
decodeSectorOnChainInfo(*cbg.Deferred) (SectorOnChainInfo, error) decodeSectorOnChainInfo(*cbg.Deferred) (SectorOnChainInfo, error)
precommits() (adt.Map, error) precommits() (adt.Map, error)
decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (miner{{.latestVersion}}.SectorPreCommitOnChainInfo, error) decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (SectorPreCommitOnChainInfo, error)
GetState() interface{} GetState() interface{}
} }
@ -150,7 +150,7 @@ type Partition interface {
UnprovenSectors() (bitfield.BitField, error) UnprovenSectors() (bitfield.BitField, error)
} }
type SectorOnChainInfo = miner{{.latestVersion}}.SectorOnChainInfo type SectorOnChainInfo = minertypes.SectorOnChainInfo
func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.RegisteredPoStProof) (abi.RegisteredSealProof, error) { func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.RegisteredPoStProof) (abi.RegisteredSealProof, error) {
// We added support for the new proofs in network version 7, and removed support for the old // We added support for the new proofs in network version 7, and removed support for the old
@ -205,9 +205,12 @@ func WinningPoStProofTypeFromWindowPoStProofType(nver network.Version, proof abi
} }
} }
type MinerInfo = miner{{.latestVersion}}.MinerInfo type MinerInfo = minertypes.MinerInfo
type WorkerKeyChange = miner{{.latestVersion}}.WorkerKeyChange type BeneficiaryTerm = minertypes.BeneficiaryTerm
type SectorPreCommitOnChainInfo = miner{{.latestVersion}}.SectorPreCommitOnChainInfo type PendingBeneficiaryChange = minertypes.PendingBeneficiaryChange
type WorkerKeyChange = minertypes.WorkerKeyChange
type SectorPreCommitOnChainInfo = minertypes.SectorPreCommitOnChainInfo
type SectorPreCommitInfo = minertypes.SectorPreCommitInfo
type WindowPostVerifyInfo = proof.WindowPoStVerifyInfo type WindowPostVerifyInfo = proof.WindowPoStVerifyInfo
type SectorExpiration struct { type SectorExpiration struct {
@ -235,8 +238,8 @@ type SectorExtensions struct {
} }
type PreCommitChanges struct { type PreCommitChanges struct {
Added []miner{{.latestVersion}}.SectorPreCommitOnChainInfo Added []SectorPreCommitOnChainInfo
Removed []miner{{.latestVersion}}.SectorPreCommitOnChainInfo Removed []SectorPreCommitOnChainInfo
} }
type LockedFunds struct { type LockedFunds struct {

View File

@ -9,7 +9,7 @@ import (
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors" actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/big"
miner10 "github.com/filecoin-project/go-state-types/builtin/v10/miner" minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
"github.com/filecoin-project/go-state-types/cbor" "github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/dline"
"github.com/filecoin-project/go-state-types/network" "github.com/filecoin-project/go-state-types/network"
@ -130,8 +130,8 @@ type State interface {
GetSector(abi.SectorNumber) (*SectorOnChainInfo, error) GetSector(abi.SectorNumber) (*SectorOnChainInfo, error)
FindSector(abi.SectorNumber) (*SectorLocation, error) FindSector(abi.SectorNumber) (*SectorLocation, error)
GetSectorExpiration(abi.SectorNumber) (*SectorExpiration, error) GetSectorExpiration(abi.SectorNumber) (*SectorExpiration, error)
GetPrecommittedSector(abi.SectorNumber) (*miner10.SectorPreCommitOnChainInfo, error) GetPrecommittedSector(abi.SectorNumber) (*SectorPreCommitOnChainInfo, error)
ForEachPrecommittedSector(func(miner10.SectorPreCommitOnChainInfo) error) error ForEachPrecommittedSector(func(SectorPreCommitOnChainInfo) error) error
LoadSectors(sectorNos *bitfield.BitField) ([]*SectorOnChainInfo, error) LoadSectors(sectorNos *bitfield.BitField) ([]*SectorOnChainInfo, error)
NumLiveSectors() (uint64, error) NumLiveSectors() (uint64, error)
IsAllocated(abi.SectorNumber) (bool, error) IsAllocated(abi.SectorNumber) (bool, error)
@ -160,7 +160,7 @@ type State interface {
sectors() (adt.Array, error) sectors() (adt.Array, error)
decodeSectorOnChainInfo(*cbg.Deferred) (SectorOnChainInfo, error) decodeSectorOnChainInfo(*cbg.Deferred) (SectorOnChainInfo, error)
precommits() (adt.Map, error) precommits() (adt.Map, error)
decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (miner10.SectorPreCommitOnChainInfo, error) decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (SectorPreCommitOnChainInfo, error)
GetState() interface{} GetState() interface{}
} }
@ -198,7 +198,7 @@ type Partition interface {
UnprovenSectors() (bitfield.BitField, error) UnprovenSectors() (bitfield.BitField, error)
} }
type SectorOnChainInfo = miner10.SectorOnChainInfo type SectorOnChainInfo = minertypes.SectorOnChainInfo
func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.RegisteredPoStProof) (abi.RegisteredSealProof, error) { func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.RegisteredPoStProof) (abi.RegisteredSealProof, error) {
// We added support for the new proofs in network version 7, and removed support for the old // We added support for the new proofs in network version 7, and removed support for the old
@ -253,9 +253,12 @@ func WinningPoStProofTypeFromWindowPoStProofType(nver network.Version, proof abi
} }
} }
type MinerInfo = miner10.MinerInfo type MinerInfo = minertypes.MinerInfo
type WorkerKeyChange = miner10.WorkerKeyChange type BeneficiaryTerm = minertypes.BeneficiaryTerm
type SectorPreCommitOnChainInfo = miner10.SectorPreCommitOnChainInfo type PendingBeneficiaryChange = minertypes.PendingBeneficiaryChange
type WorkerKeyChange = minertypes.WorkerKeyChange
type SectorPreCommitOnChainInfo = minertypes.SectorPreCommitOnChainInfo
type SectorPreCommitInfo = minertypes.SectorPreCommitInfo
type WindowPostVerifyInfo = proof.WindowPoStVerifyInfo type WindowPostVerifyInfo = proof.WindowPoStVerifyInfo
type SectorExpiration struct { type SectorExpiration struct {
@ -283,8 +286,8 @@ type SectorExtensions struct {
} }
type PreCommitChanges struct { type PreCommitChanges struct {
Added []miner10.SectorPreCommitOnChainInfo Added []SectorPreCommitOnChainInfo
Removed []miner10.SectorPreCommitOnChainInfo Removed []SectorPreCommitOnChainInfo
} }
type LockedFunds struct { type LockedFunds struct {

View File

@ -18,7 +18,6 @@ import (
"github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors"
actorstypes "github.com/filecoin-project/go-state-types/actors" actorstypes "github.com/filecoin-project/go-state-types/actors"
minertypes "github.com/filecoin-project/go-state-types/builtin/v{{.latestVersion}}/miner"
{{if (le .v 7)}} {{if (le .v 7)}}
{{if (ge .v 3)}} {{if (ge .v 3)}}
@ -218,7 +217,7 @@ func (s *state{{.v}}) GetSectorExpiration(num abi.SectorNumber) (*SectorExpirati
return &out, nil return &out, nil
} }
func (s *state{{.v}}) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) { func (s *state{{.v}}) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
info, ok, err := s.State.GetPrecommittedSector(s.store, num) info, ok, err := s.State.GetPrecommittedSector(s.store, num)
if !ok || err != nil { if !ok || err != nil {
return nil, err return nil, err
@ -229,7 +228,7 @@ func (s *state{{.v}}) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.S
return &ret, nil return &ret, nil
} }
func (s *state{{.v}}) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error { func (s *state{{.v}}) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
{{if (ge .v 3) -}} {{if (ge .v 3) -}}
precommitted, err := adt{{.v}}.AsMap(s.store, s.State.PreCommittedSectors, builtin{{.v}}.DefaultHamtBitwidth) precommitted, err := adt{{.v}}.AsMap(s.store, s.State.PreCommittedSectors, builtin{{.v}}.DefaultHamtBitwidth)
{{- else -}} {{- else -}}
@ -417,9 +416,10 @@ func (s *state{{.v}}) Info() (MinerInfo, error) {
WindowPoStPartitionSectors: info.WindowPoStPartitionSectors, WindowPoStPartitionSectors: info.WindowPoStPartitionSectors,
ConsensusFaultElapsed: {{if (ge .v 2)}}info.ConsensusFaultElapsed{{else}}-1{{end}}, ConsensusFaultElapsed: {{if (ge .v 2)}}info.ConsensusFaultElapsed{{else}}-1{{end}},
{{if (ge .v 9)}} {{if (ge .v 9)}}
Beneficiary: info.Beneficiary, Beneficiary: info.Beneficiary,
BeneficiaryTerm: info.BeneficiaryTerm, BeneficiaryTerm: BeneficiaryTerm(info.BeneficiaryTerm),
PendingBeneficiaryTerm: info.PendingBeneficiaryTerm,{{end}} PendingBeneficiaryTerm: (*PendingBeneficiaryChange)(info.PendingBeneficiaryTerm),
{{end}}
} }
return mi, nil return mi, nil
@ -451,11 +451,11 @@ func (s *state{{.v}}) precommits() (adt.Map, error) {
return adt{{.v}}.AsMap(s.store, s.PreCommittedSectors{{if (ge .v 3)}}, builtin{{.v}}.DefaultHamtBitwidth{{end}}) return adt{{.v}}.AsMap(s.store, s.PreCommittedSectors{{if (ge .v 3)}}, builtin{{.v}}.DefaultHamtBitwidth{{end}})
} }
func (s *state{{.v}}) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) { func (s *state{{.v}}) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
var sp miner{{.v}}.SectorPreCommitOnChainInfo var sp miner{{.v}}.SectorPreCommitOnChainInfo
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw)) err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil { if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err return SectorPreCommitOnChainInfo{}, err
} }
return fromV{{.v}}SectorPreCommitOnChainInfo(sp), nil return fromV{{.v}}SectorPreCommitOnChainInfo(sp), nil
@ -586,9 +586,9 @@ func fromV{{.v}}SectorOnChainInfo(v{{.v}} miner{{.v}}.SectorOnChainInfo) SectorO
return info return info
} }
func fromV{{.v}}SectorPreCommitOnChainInfo(v{{.v}} miner{{.v}}.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo { func fromV{{.v}}SectorPreCommitOnChainInfo(v{{.v}} miner{{.v}}.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
{{if (le .v 8)}}return minertypes.SectorPreCommitOnChainInfo{ ret := SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{ Info: SectorPreCommitInfo{
SealProof: v{{.v}}.Info.SealProof, SealProof: v{{.v}}.Info.SealProof,
SectorNumber: v{{.v}}.Info.SectorNumber, SectorNumber: v{{.v}}.Info.SectorNumber,
SealedCID: v{{.v}}.Info.SealedCID, SealedCID: v{{.v}}.Info.SealedCID,
@ -599,7 +599,13 @@ func fromV{{.v}}SectorPreCommitOnChainInfo(v{{.v}} miner{{.v}}.SectorPreCommitOn
}, },
PreCommitDeposit: v{{.v}}.PreCommitDeposit, PreCommitDeposit: v{{.v}}.PreCommitDeposit,
PreCommitEpoch: v{{.v}}.PreCommitEpoch, PreCommitEpoch: v{{.v}}.PreCommitEpoch,
}{{else}}return v{{.v}}{{end}} }
{{if (ge .v 9)}}
ret.Info.UnsealedCid = v{{.v}}.Info.UnsealedCid
{{end}}
return ret
} }
func (s *state{{.v}}) GetState() interface{} { func (s *state{{.v}}) GetState() interface{} {

View File

@ -14,7 +14,6 @@ import (
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors" actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/big"
minertypes "github.com/filecoin-project/go-state-types/builtin/v10/miner"
"github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/dline"
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner" miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
adt0 "github.com/filecoin-project/specs-actors/actors/util/adt" adt0 "github.com/filecoin-project/specs-actors/actors/util/adt"
@ -198,7 +197,7 @@ func (s *state0) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
return &out, nil return &out, nil
} }
func (s *state0) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) { func (s *state0) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
info, ok, err := s.State.GetPrecommittedSector(s.store, num) info, ok, err := s.State.GetPrecommittedSector(s.store, num)
if !ok || err != nil { if !ok || err != nil {
return nil, err return nil, err
@ -209,7 +208,7 @@ func (s *state0) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
return &ret, nil return &ret, nil
} }
func (s *state0) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error { func (s *state0) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
precommitted, err := adt0.AsMap(s.store, s.State.PreCommittedSectors) precommitted, err := adt0.AsMap(s.store, s.State.PreCommittedSectors)
if err != nil { if err != nil {
return err return err
@ -422,11 +421,11 @@ func (s *state0) precommits() (adt.Map, error) {
return adt0.AsMap(s.store, s.PreCommittedSectors) return adt0.AsMap(s.store, s.PreCommittedSectors)
} }
func (s *state0) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) { func (s *state0) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
var sp miner0.SectorPreCommitOnChainInfo var sp miner0.SectorPreCommitOnChainInfo
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw)) err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil { if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err return SectorPreCommitOnChainInfo{}, err
} }
return fromV0SectorPreCommitOnChainInfo(sp), nil return fromV0SectorPreCommitOnChainInfo(sp), nil
@ -512,9 +511,9 @@ func fromV0SectorOnChainInfo(v0 miner0.SectorOnChainInfo) SectorOnChainInfo {
return info return info
} }
func fromV0SectorPreCommitOnChainInfo(v0 miner0.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo { func fromV0SectorPreCommitOnChainInfo(v0 miner0.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{ ret := SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{ Info: SectorPreCommitInfo{
SealProof: v0.Info.SealProof, SealProof: v0.Info.SealProof,
SectorNumber: v0.Info.SectorNumber, SectorNumber: v0.Info.SectorNumber,
SealedCID: v0.Info.SealedCID, SealedCID: v0.Info.SealedCID,
@ -526,6 +525,8 @@ func fromV0SectorPreCommitOnChainInfo(v0 miner0.SectorPreCommitOnChainInfo) mine
PreCommitDeposit: v0.PreCommitDeposit, PreCommitDeposit: v0.PreCommitDeposit,
PreCommitEpoch: v0.PreCommitEpoch, PreCommitEpoch: v0.PreCommitEpoch,
} }
return ret
} }
func (s *state0) GetState() interface{} { func (s *state0) GetState() interface{} {

View File

@ -15,7 +15,6 @@ import (
actorstypes "github.com/filecoin-project/go-state-types/actors" actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin10 "github.com/filecoin-project/go-state-types/builtin" builtin10 "github.com/filecoin-project/go-state-types/builtin"
miner10 "github.com/filecoin-project/go-state-types/builtin/v10/miner" miner10 "github.com/filecoin-project/go-state-types/builtin/v10/miner"
minertypes "github.com/filecoin-project/go-state-types/builtin/v10/miner"
adt10 "github.com/filecoin-project/go-state-types/builtin/v10/util/adt" adt10 "github.com/filecoin-project/go-state-types/builtin/v10/util/adt"
"github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/dline"
@ -197,7 +196,7 @@ func (s *state10) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration,
return &out, nil return &out, nil
} }
func (s *state10) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) { func (s *state10) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
info, ok, err := s.State.GetPrecommittedSector(s.store, num) info, ok, err := s.State.GetPrecommittedSector(s.store, num)
if !ok || err != nil { if !ok || err != nil {
return nil, err return nil, err
@ -208,7 +207,7 @@ func (s *state10) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Secto
return &ret, nil return &ret, nil
} }
func (s *state10) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error { func (s *state10) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
precommitted, err := adt10.AsMap(s.store, s.State.PreCommittedSectors, builtin10.DefaultHamtBitwidth) precommitted, err := adt10.AsMap(s.store, s.State.PreCommittedSectors, builtin10.DefaultHamtBitwidth)
if err != nil { if err != nil {
return err return err
@ -387,8 +386,8 @@ func (s *state10) Info() (MinerInfo, error) {
ConsensusFaultElapsed: info.ConsensusFaultElapsed, ConsensusFaultElapsed: info.ConsensusFaultElapsed,
Beneficiary: info.Beneficiary, Beneficiary: info.Beneficiary,
BeneficiaryTerm: info.BeneficiaryTerm, BeneficiaryTerm: BeneficiaryTerm(info.BeneficiaryTerm),
PendingBeneficiaryTerm: info.PendingBeneficiaryTerm, PendingBeneficiaryTerm: (*PendingBeneficiaryChange)(info.PendingBeneficiaryTerm),
} }
return mi, nil return mi, nil
@ -420,11 +419,11 @@ func (s *state10) precommits() (adt.Map, error) {
return adt10.AsMap(s.store, s.PreCommittedSectors, builtin10.DefaultHamtBitwidth) return adt10.AsMap(s.store, s.PreCommittedSectors, builtin10.DefaultHamtBitwidth)
} }
func (s *state10) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) { func (s *state10) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
var sp miner10.SectorPreCommitOnChainInfo var sp miner10.SectorPreCommitOnChainInfo
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw)) err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil { if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err return SectorPreCommitOnChainInfo{}, err
} }
return fromV10SectorPreCommitOnChainInfo(sp), nil return fromV10SectorPreCommitOnChainInfo(sp), nil
@ -548,8 +547,24 @@ func fromV10SectorOnChainInfo(v10 miner10.SectorOnChainInfo) SectorOnChainInfo {
return info return info
} }
func fromV10SectorPreCommitOnChainInfo(v10 miner10.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo { func fromV10SectorPreCommitOnChainInfo(v10 miner10.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
return v10 ret := SectorPreCommitOnChainInfo{
Info: SectorPreCommitInfo{
SealProof: v10.Info.SealProof,
SectorNumber: v10.Info.SectorNumber,
SealedCID: v10.Info.SealedCID,
SealRandEpoch: v10.Info.SealRandEpoch,
DealIDs: v10.Info.DealIDs,
Expiration: v10.Info.Expiration,
UnsealedCid: nil,
},
PreCommitDeposit: v10.PreCommitDeposit,
PreCommitEpoch: v10.PreCommitEpoch,
}
ret.Info.UnsealedCid = v10.Info.UnsealedCid
return ret
} }
func (s *state10) GetState() interface{} { func (s *state10) GetState() interface{} {

View File

@ -13,7 +13,6 @@ import (
rle "github.com/filecoin-project/go-bitfield/rle" rle "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors" actorstypes "github.com/filecoin-project/go-state-types/actors"
minertypes "github.com/filecoin-project/go-state-types/builtin/v10/miner"
"github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/dline"
miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner" miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner"
adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt" adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt"
@ -197,7 +196,7 @@ func (s *state2) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
return &out, nil return &out, nil
} }
func (s *state2) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) { func (s *state2) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
info, ok, err := s.State.GetPrecommittedSector(s.store, num) info, ok, err := s.State.GetPrecommittedSector(s.store, num)
if !ok || err != nil { if !ok || err != nil {
return nil, err return nil, err
@ -208,7 +207,7 @@ func (s *state2) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
return &ret, nil return &ret, nil
} }
func (s *state2) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error { func (s *state2) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
precommitted, err := adt2.AsMap(s.store, s.State.PreCommittedSectors) precommitted, err := adt2.AsMap(s.store, s.State.PreCommittedSectors)
if err != nil { if err != nil {
return err return err
@ -421,11 +420,11 @@ func (s *state2) precommits() (adt.Map, error) {
return adt2.AsMap(s.store, s.PreCommittedSectors) return adt2.AsMap(s.store, s.PreCommittedSectors)
} }
func (s *state2) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) { func (s *state2) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
var sp miner2.SectorPreCommitOnChainInfo var sp miner2.SectorPreCommitOnChainInfo
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw)) err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil { if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err return SectorPreCommitOnChainInfo{}, err
} }
return fromV2SectorPreCommitOnChainInfo(sp), nil return fromV2SectorPreCommitOnChainInfo(sp), nil
@ -543,9 +542,9 @@ func fromV2SectorOnChainInfo(v2 miner2.SectorOnChainInfo) SectorOnChainInfo {
return info return info
} }
func fromV2SectorPreCommitOnChainInfo(v2 miner2.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo { func fromV2SectorPreCommitOnChainInfo(v2 miner2.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{ ret := SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{ Info: SectorPreCommitInfo{
SealProof: v2.Info.SealProof, SealProof: v2.Info.SealProof,
SectorNumber: v2.Info.SectorNumber, SectorNumber: v2.Info.SectorNumber,
SealedCID: v2.Info.SealedCID, SealedCID: v2.Info.SealedCID,
@ -557,6 +556,8 @@ func fromV2SectorPreCommitOnChainInfo(v2 miner2.SectorPreCommitOnChainInfo) mine
PreCommitDeposit: v2.PreCommitDeposit, PreCommitDeposit: v2.PreCommitDeposit,
PreCommitEpoch: v2.PreCommitEpoch, PreCommitEpoch: v2.PreCommitEpoch,
} }
return ret
} }
func (s *state2) GetState() interface{} { func (s *state2) GetState() interface{} {

View File

@ -13,7 +13,6 @@ import (
rle "github.com/filecoin-project/go-bitfield/rle" rle "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors" actorstypes "github.com/filecoin-project/go-state-types/actors"
minertypes "github.com/filecoin-project/go-state-types/builtin/v10/miner"
"github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/dline"
builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
miner3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/miner" miner3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/miner"
@ -198,7 +197,7 @@ func (s *state3) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
return &out, nil return &out, nil
} }
func (s *state3) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) { func (s *state3) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
info, ok, err := s.State.GetPrecommittedSector(s.store, num) info, ok, err := s.State.GetPrecommittedSector(s.store, num)
if !ok || err != nil { if !ok || err != nil {
return nil, err return nil, err
@ -209,7 +208,7 @@ func (s *state3) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
return &ret, nil return &ret, nil
} }
func (s *state3) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error { func (s *state3) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
precommitted, err := adt3.AsMap(s.store, s.State.PreCommittedSectors, builtin3.DefaultHamtBitwidth) precommitted, err := adt3.AsMap(s.store, s.State.PreCommittedSectors, builtin3.DefaultHamtBitwidth)
if err != nil { if err != nil {
return err return err
@ -417,11 +416,11 @@ func (s *state3) precommits() (adt.Map, error) {
return adt3.AsMap(s.store, s.PreCommittedSectors, builtin3.DefaultHamtBitwidth) return adt3.AsMap(s.store, s.PreCommittedSectors, builtin3.DefaultHamtBitwidth)
} }
func (s *state3) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) { func (s *state3) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
var sp miner3.SectorPreCommitOnChainInfo var sp miner3.SectorPreCommitOnChainInfo
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw)) err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil { if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err return SectorPreCommitOnChainInfo{}, err
} }
return fromV3SectorPreCommitOnChainInfo(sp), nil return fromV3SectorPreCommitOnChainInfo(sp), nil
@ -543,9 +542,9 @@ func fromV3SectorOnChainInfo(v3 miner3.SectorOnChainInfo) SectorOnChainInfo {
return info return info
} }
func fromV3SectorPreCommitOnChainInfo(v3 miner3.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo { func fromV3SectorPreCommitOnChainInfo(v3 miner3.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{ ret := SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{ Info: SectorPreCommitInfo{
SealProof: v3.Info.SealProof, SealProof: v3.Info.SealProof,
SectorNumber: v3.Info.SectorNumber, SectorNumber: v3.Info.SectorNumber,
SealedCID: v3.Info.SealedCID, SealedCID: v3.Info.SealedCID,
@ -557,6 +556,8 @@ func fromV3SectorPreCommitOnChainInfo(v3 miner3.SectorPreCommitOnChainInfo) mine
PreCommitDeposit: v3.PreCommitDeposit, PreCommitDeposit: v3.PreCommitDeposit,
PreCommitEpoch: v3.PreCommitEpoch, PreCommitEpoch: v3.PreCommitEpoch,
} }
return ret
} }
func (s *state3) GetState() interface{} { func (s *state3) GetState() interface{} {

View File

@ -13,7 +13,6 @@ import (
rle "github.com/filecoin-project/go-bitfield/rle" rle "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors" actorstypes "github.com/filecoin-project/go-state-types/actors"
minertypes "github.com/filecoin-project/go-state-types/builtin/v10/miner"
"github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/dline"
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
miner4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/miner" miner4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/miner"
@ -198,7 +197,7 @@ func (s *state4) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
return &out, nil return &out, nil
} }
func (s *state4) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) { func (s *state4) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
info, ok, err := s.State.GetPrecommittedSector(s.store, num) info, ok, err := s.State.GetPrecommittedSector(s.store, num)
if !ok || err != nil { if !ok || err != nil {
return nil, err return nil, err
@ -209,7 +208,7 @@ func (s *state4) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
return &ret, nil return &ret, nil
} }
func (s *state4) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error { func (s *state4) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
precommitted, err := adt4.AsMap(s.store, s.State.PreCommittedSectors, builtin4.DefaultHamtBitwidth) precommitted, err := adt4.AsMap(s.store, s.State.PreCommittedSectors, builtin4.DefaultHamtBitwidth)
if err != nil { if err != nil {
return err return err
@ -417,11 +416,11 @@ func (s *state4) precommits() (adt.Map, error) {
return adt4.AsMap(s.store, s.PreCommittedSectors, builtin4.DefaultHamtBitwidth) return adt4.AsMap(s.store, s.PreCommittedSectors, builtin4.DefaultHamtBitwidth)
} }
func (s *state4) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) { func (s *state4) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
var sp miner4.SectorPreCommitOnChainInfo var sp miner4.SectorPreCommitOnChainInfo
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw)) err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil { if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err return SectorPreCommitOnChainInfo{}, err
} }
return fromV4SectorPreCommitOnChainInfo(sp), nil return fromV4SectorPreCommitOnChainInfo(sp), nil
@ -543,9 +542,9 @@ func fromV4SectorOnChainInfo(v4 miner4.SectorOnChainInfo) SectorOnChainInfo {
return info return info
} }
func fromV4SectorPreCommitOnChainInfo(v4 miner4.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo { func fromV4SectorPreCommitOnChainInfo(v4 miner4.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{ ret := SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{ Info: SectorPreCommitInfo{
SealProof: v4.Info.SealProof, SealProof: v4.Info.SealProof,
SectorNumber: v4.Info.SectorNumber, SectorNumber: v4.Info.SectorNumber,
SealedCID: v4.Info.SealedCID, SealedCID: v4.Info.SealedCID,
@ -557,6 +556,8 @@ func fromV4SectorPreCommitOnChainInfo(v4 miner4.SectorPreCommitOnChainInfo) mine
PreCommitDeposit: v4.PreCommitDeposit, PreCommitDeposit: v4.PreCommitDeposit,
PreCommitEpoch: v4.PreCommitEpoch, PreCommitEpoch: v4.PreCommitEpoch,
} }
return ret
} }
func (s *state4) GetState() interface{} { func (s *state4) GetState() interface{} {

View File

@ -13,7 +13,6 @@ import (
rle "github.com/filecoin-project/go-bitfield/rle" rle "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors" actorstypes "github.com/filecoin-project/go-state-types/actors"
minertypes "github.com/filecoin-project/go-state-types/builtin/v10/miner"
"github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/dline"
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
miner5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/miner" miner5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/miner"
@ -198,7 +197,7 @@ func (s *state5) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
return &out, nil return &out, nil
} }
func (s *state5) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) { func (s *state5) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
info, ok, err := s.State.GetPrecommittedSector(s.store, num) info, ok, err := s.State.GetPrecommittedSector(s.store, num)
if !ok || err != nil { if !ok || err != nil {
return nil, err return nil, err
@ -209,7 +208,7 @@ func (s *state5) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
return &ret, nil return &ret, nil
} }
func (s *state5) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error { func (s *state5) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
precommitted, err := adt5.AsMap(s.store, s.State.PreCommittedSectors, builtin5.DefaultHamtBitwidth) precommitted, err := adt5.AsMap(s.store, s.State.PreCommittedSectors, builtin5.DefaultHamtBitwidth)
if err != nil { if err != nil {
return err return err
@ -417,11 +416,11 @@ func (s *state5) precommits() (adt.Map, error) {
return adt5.AsMap(s.store, s.PreCommittedSectors, builtin5.DefaultHamtBitwidth) return adt5.AsMap(s.store, s.PreCommittedSectors, builtin5.DefaultHamtBitwidth)
} }
func (s *state5) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) { func (s *state5) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
var sp miner5.SectorPreCommitOnChainInfo var sp miner5.SectorPreCommitOnChainInfo
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw)) err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil { if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err return SectorPreCommitOnChainInfo{}, err
} }
return fromV5SectorPreCommitOnChainInfo(sp), nil return fromV5SectorPreCommitOnChainInfo(sp), nil
@ -543,9 +542,9 @@ func fromV5SectorOnChainInfo(v5 miner5.SectorOnChainInfo) SectorOnChainInfo {
return info return info
} }
func fromV5SectorPreCommitOnChainInfo(v5 miner5.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo { func fromV5SectorPreCommitOnChainInfo(v5 miner5.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{ ret := SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{ Info: SectorPreCommitInfo{
SealProof: v5.Info.SealProof, SealProof: v5.Info.SealProof,
SectorNumber: v5.Info.SectorNumber, SectorNumber: v5.Info.SectorNumber,
SealedCID: v5.Info.SealedCID, SealedCID: v5.Info.SealedCID,
@ -557,6 +556,8 @@ func fromV5SectorPreCommitOnChainInfo(v5 miner5.SectorPreCommitOnChainInfo) mine
PreCommitDeposit: v5.PreCommitDeposit, PreCommitDeposit: v5.PreCommitDeposit,
PreCommitEpoch: v5.PreCommitEpoch, PreCommitEpoch: v5.PreCommitEpoch,
} }
return ret
} }
func (s *state5) GetState() interface{} { func (s *state5) GetState() interface{} {

View File

@ -13,7 +13,6 @@ import (
rle "github.com/filecoin-project/go-bitfield/rle" rle "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors" actorstypes "github.com/filecoin-project/go-state-types/actors"
minertypes "github.com/filecoin-project/go-state-types/builtin/v10/miner"
"github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/dline"
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
miner6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/miner" miner6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/miner"
@ -198,7 +197,7 @@ func (s *state6) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
return &out, nil return &out, nil
} }
func (s *state6) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) { func (s *state6) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
info, ok, err := s.State.GetPrecommittedSector(s.store, num) info, ok, err := s.State.GetPrecommittedSector(s.store, num)
if !ok || err != nil { if !ok || err != nil {
return nil, err return nil, err
@ -209,7 +208,7 @@ func (s *state6) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
return &ret, nil return &ret, nil
} }
func (s *state6) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error { func (s *state6) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
precommitted, err := adt6.AsMap(s.store, s.State.PreCommittedSectors, builtin6.DefaultHamtBitwidth) precommitted, err := adt6.AsMap(s.store, s.State.PreCommittedSectors, builtin6.DefaultHamtBitwidth)
if err != nil { if err != nil {
return err return err
@ -417,11 +416,11 @@ func (s *state6) precommits() (adt.Map, error) {
return adt6.AsMap(s.store, s.PreCommittedSectors, builtin6.DefaultHamtBitwidth) return adt6.AsMap(s.store, s.PreCommittedSectors, builtin6.DefaultHamtBitwidth)
} }
func (s *state6) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) { func (s *state6) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
var sp miner6.SectorPreCommitOnChainInfo var sp miner6.SectorPreCommitOnChainInfo
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw)) err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil { if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err return SectorPreCommitOnChainInfo{}, err
} }
return fromV6SectorPreCommitOnChainInfo(sp), nil return fromV6SectorPreCommitOnChainInfo(sp), nil
@ -543,9 +542,9 @@ func fromV6SectorOnChainInfo(v6 miner6.SectorOnChainInfo) SectorOnChainInfo {
return info return info
} }
func fromV6SectorPreCommitOnChainInfo(v6 miner6.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo { func fromV6SectorPreCommitOnChainInfo(v6 miner6.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{ ret := SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{ Info: SectorPreCommitInfo{
SealProof: v6.Info.SealProof, SealProof: v6.Info.SealProof,
SectorNumber: v6.Info.SectorNumber, SectorNumber: v6.Info.SectorNumber,
SealedCID: v6.Info.SealedCID, SealedCID: v6.Info.SealedCID,
@ -557,6 +556,8 @@ func fromV6SectorPreCommitOnChainInfo(v6 miner6.SectorPreCommitOnChainInfo) mine
PreCommitDeposit: v6.PreCommitDeposit, PreCommitDeposit: v6.PreCommitDeposit,
PreCommitEpoch: v6.PreCommitEpoch, PreCommitEpoch: v6.PreCommitEpoch,
} }
return ret
} }
func (s *state6) GetState() interface{} { func (s *state6) GetState() interface{} {

View File

@ -13,7 +13,6 @@ import (
rle "github.com/filecoin-project/go-bitfield/rle" rle "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors" actorstypes "github.com/filecoin-project/go-state-types/actors"
minertypes "github.com/filecoin-project/go-state-types/builtin/v10/miner"
"github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/dline"
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
miner7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/miner" miner7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/miner"
@ -197,7 +196,7 @@ func (s *state7) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
return &out, nil return &out, nil
} }
func (s *state7) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) { func (s *state7) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
info, ok, err := s.State.GetPrecommittedSector(s.store, num) info, ok, err := s.State.GetPrecommittedSector(s.store, num)
if !ok || err != nil { if !ok || err != nil {
return nil, err return nil, err
@ -208,7 +207,7 @@ func (s *state7) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
return &ret, nil return &ret, nil
} }
func (s *state7) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error { func (s *state7) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
precommitted, err := adt7.AsMap(s.store, s.State.PreCommittedSectors, builtin7.DefaultHamtBitwidth) precommitted, err := adt7.AsMap(s.store, s.State.PreCommittedSectors, builtin7.DefaultHamtBitwidth)
if err != nil { if err != nil {
return err return err
@ -416,11 +415,11 @@ func (s *state7) precommits() (adt.Map, error) {
return adt7.AsMap(s.store, s.PreCommittedSectors, builtin7.DefaultHamtBitwidth) return adt7.AsMap(s.store, s.PreCommittedSectors, builtin7.DefaultHamtBitwidth)
} }
func (s *state7) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) { func (s *state7) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
var sp miner7.SectorPreCommitOnChainInfo var sp miner7.SectorPreCommitOnChainInfo
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw)) err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil { if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err return SectorPreCommitOnChainInfo{}, err
} }
return fromV7SectorPreCommitOnChainInfo(sp), nil return fromV7SectorPreCommitOnChainInfo(sp), nil
@ -544,9 +543,9 @@ func fromV7SectorOnChainInfo(v7 miner7.SectorOnChainInfo) SectorOnChainInfo {
return info return info
} }
func fromV7SectorPreCommitOnChainInfo(v7 miner7.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo { func fromV7SectorPreCommitOnChainInfo(v7 miner7.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{ ret := SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{ Info: SectorPreCommitInfo{
SealProof: v7.Info.SealProof, SealProof: v7.Info.SealProof,
SectorNumber: v7.Info.SectorNumber, SectorNumber: v7.Info.SectorNumber,
SealedCID: v7.Info.SealedCID, SealedCID: v7.Info.SealedCID,
@ -558,6 +557,8 @@ func fromV7SectorPreCommitOnChainInfo(v7 miner7.SectorPreCommitOnChainInfo) mine
PreCommitDeposit: v7.PreCommitDeposit, PreCommitDeposit: v7.PreCommitDeposit,
PreCommitEpoch: v7.PreCommitEpoch, PreCommitEpoch: v7.PreCommitEpoch,
} }
return ret
} }
func (s *state7) GetState() interface{} { func (s *state7) GetState() interface{} {

View File

@ -14,7 +14,6 @@ import (
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors" actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin8 "github.com/filecoin-project/go-state-types/builtin" builtin8 "github.com/filecoin-project/go-state-types/builtin"
minertypes "github.com/filecoin-project/go-state-types/builtin/v10/miner"
miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner" miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner"
adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt" adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt"
"github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/dline"
@ -197,7 +196,7 @@ func (s *state8) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
return &out, nil return &out, nil
} }
func (s *state8) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) { func (s *state8) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
info, ok, err := s.State.GetPrecommittedSector(s.store, num) info, ok, err := s.State.GetPrecommittedSector(s.store, num)
if !ok || err != nil { if !ok || err != nil {
return nil, err return nil, err
@ -208,7 +207,7 @@ func (s *state8) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
return &ret, nil return &ret, nil
} }
func (s *state8) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error { func (s *state8) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
precommitted, err := adt8.AsMap(s.store, s.State.PreCommittedSectors, builtin8.DefaultHamtBitwidth) precommitted, err := adt8.AsMap(s.store, s.State.PreCommittedSectors, builtin8.DefaultHamtBitwidth)
if err != nil { if err != nil {
return err return err
@ -416,11 +415,11 @@ func (s *state8) precommits() (adt.Map, error) {
return adt8.AsMap(s.store, s.PreCommittedSectors, builtin8.DefaultHamtBitwidth) return adt8.AsMap(s.store, s.PreCommittedSectors, builtin8.DefaultHamtBitwidth)
} }
func (s *state8) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) { func (s *state8) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
var sp miner8.SectorPreCommitOnChainInfo var sp miner8.SectorPreCommitOnChainInfo
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw)) err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil { if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err return SectorPreCommitOnChainInfo{}, err
} }
return fromV8SectorPreCommitOnChainInfo(sp), nil return fromV8SectorPreCommitOnChainInfo(sp), nil
@ -544,9 +543,9 @@ func fromV8SectorOnChainInfo(v8 miner8.SectorOnChainInfo) SectorOnChainInfo {
return info return info
} }
func fromV8SectorPreCommitOnChainInfo(v8 miner8.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo { func fromV8SectorPreCommitOnChainInfo(v8 miner8.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{ ret := SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{ Info: SectorPreCommitInfo{
SealProof: v8.Info.SealProof, SealProof: v8.Info.SealProof,
SectorNumber: v8.Info.SectorNumber, SectorNumber: v8.Info.SectorNumber,
SealedCID: v8.Info.SealedCID, SealedCID: v8.Info.SealedCID,
@ -558,6 +557,8 @@ func fromV8SectorPreCommitOnChainInfo(v8 miner8.SectorPreCommitOnChainInfo) mine
PreCommitDeposit: v8.PreCommitDeposit, PreCommitDeposit: v8.PreCommitDeposit,
PreCommitEpoch: v8.PreCommitEpoch, PreCommitEpoch: v8.PreCommitEpoch,
} }
return ret
} }
func (s *state8) GetState() interface{} { func (s *state8) GetState() interface{} {

View File

@ -14,7 +14,6 @@ import (
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors" actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin9 "github.com/filecoin-project/go-state-types/builtin" builtin9 "github.com/filecoin-project/go-state-types/builtin"
minertypes "github.com/filecoin-project/go-state-types/builtin/v10/miner"
miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner" miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner"
adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt" adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt"
"github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/dline"
@ -197,7 +196,7 @@ func (s *state9) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
return &out, nil return &out, nil
} }
func (s *state9) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) { func (s *state9) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
info, ok, err := s.State.GetPrecommittedSector(s.store, num) info, ok, err := s.State.GetPrecommittedSector(s.store, num)
if !ok || err != nil { if !ok || err != nil {
return nil, err return nil, err
@ -208,7 +207,7 @@ func (s *state9) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
return &ret, nil return &ret, nil
} }
func (s *state9) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error { func (s *state9) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
precommitted, err := adt9.AsMap(s.store, s.State.PreCommittedSectors, builtin9.DefaultHamtBitwidth) precommitted, err := adt9.AsMap(s.store, s.State.PreCommittedSectors, builtin9.DefaultHamtBitwidth)
if err != nil { if err != nil {
return err return err
@ -387,8 +386,8 @@ func (s *state9) Info() (MinerInfo, error) {
ConsensusFaultElapsed: info.ConsensusFaultElapsed, ConsensusFaultElapsed: info.ConsensusFaultElapsed,
Beneficiary: info.Beneficiary, Beneficiary: info.Beneficiary,
BeneficiaryTerm: info.BeneficiaryTerm, BeneficiaryTerm: BeneficiaryTerm(info.BeneficiaryTerm),
PendingBeneficiaryTerm: info.PendingBeneficiaryTerm, PendingBeneficiaryTerm: (*PendingBeneficiaryChange)(info.PendingBeneficiaryTerm),
} }
return mi, nil return mi, nil
@ -420,11 +419,11 @@ func (s *state9) precommits() (adt.Map, error) {
return adt9.AsMap(s.store, s.PreCommittedSectors, builtin9.DefaultHamtBitwidth) return adt9.AsMap(s.store, s.PreCommittedSectors, builtin9.DefaultHamtBitwidth)
} }
func (s *state9) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) { func (s *state9) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
var sp miner9.SectorPreCommitOnChainInfo var sp miner9.SectorPreCommitOnChainInfo
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw)) err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil { if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err return SectorPreCommitOnChainInfo{}, err
} }
return fromV9SectorPreCommitOnChainInfo(sp), nil return fromV9SectorPreCommitOnChainInfo(sp), nil
@ -548,8 +547,24 @@ func fromV9SectorOnChainInfo(v9 miner9.SectorOnChainInfo) SectorOnChainInfo {
return info return info
} }
func fromV9SectorPreCommitOnChainInfo(v9 miner9.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo { func fromV9SectorPreCommitOnChainInfo(v9 miner9.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
return v9 ret := SectorPreCommitOnChainInfo{
Info: SectorPreCommitInfo{
SealProof: v9.Info.SealProof,
SectorNumber: v9.Info.SectorNumber,
SealedCID: v9.Info.SealedCID,
SealRandEpoch: v9.Info.SealRandEpoch,
DealIDs: v9.Info.DealIDs,
Expiration: v9.Info.Expiration,
UnsealedCid: nil,
},
PreCommitDeposit: v9.PreCommitDeposit,
PreCommitEpoch: v9.PreCommitEpoch,
}
ret.Info.UnsealedCid = v9.Info.UnsealedCid
return ret
} }
func (s *state9) GetState() interface{} { func (s *state9) GetState() interface{} {

View File

@ -78,10 +78,10 @@ type State interface {
RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error) RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error)
ForEachVerifier(func(addr address.Address, dcap abi.StoragePower) error) error ForEachVerifier(func(addr address.Address, dcap abi.StoragePower) error) error
ForEachClient(func(addr address.Address, dcap abi.StoragePower) error) error ForEachClient(func(addr address.Address, dcap abi.StoragePower) error) error
GetAllocation(clientIdAddr address.Address, allocationId verifregtypes.AllocationId) (*verifregtypes.Allocation, bool, error) GetAllocation(clientIdAddr address.Address, allocationId AllocationId) (*Allocation, bool, error)
GetAllocations(clientIdAddr address.Address) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error)
GetClaim(providerIdAddr address.Address, claimId verifregtypes.ClaimId) (*verifregtypes.Claim, bool, error) GetClaim(providerIdAddr address.Address, claimId ClaimId) (*Claim, bool, error)
GetClaims(providerIdAddr address.Address) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error)
GetState() interface{} GetState() interface{}
} }
@ -91,3 +91,8 @@ func AllCodes() []cid.Cid {
{{- end}} {{- end}}
} }
} }
type Allocation = verifregtypes.Allocation
type AllocationId = verifregtypes.AllocationId
type Claim = verifregtypes.Claim
type ClaimId = verifregtypes.ClaimId

View File

@ -121,35 +121,51 @@ func (s *state{{.v}}) GetState() interface{} {
return &s.State return &s.State
} }
func (s *state{{.v}}) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*verifreg9.Allocation, bool, error) { func (s *state{{.v}}) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*Allocation, bool, error) {
{{if (le .v 8)}} {{if (le .v 8)}}
return nil, false, xerrors.Errorf("unsupported in actors v{{.v}}") return nil, false, xerrors.Errorf("unsupported in actors v{{.v}}")
{{else}} {{else}}
return s.FindAllocation(s.store, clientIdAddr, allocationId) alloc, ok, err := s.FindAllocation(s.store, clientIdAddr, verifreg{{.v}}.AllocationId(allocationId))
{{end}} return (*Allocation)(alloc), ok, err{{end}}
} }
func (s *state{{.v}}) GetAllocations(clientIdAddr address.Address) (map[verifreg9.AllocationId]verifreg9.Allocation, error) { func (s *state{{.v}}) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) {
{{if (le .v 8)}} {{if (le .v 8)}}
return nil, xerrors.Errorf("unsupported in actors v{{.v}}") return nil, xerrors.Errorf("unsupported in actors v{{.v}}")
{{else}} {{else}}
return s.LoadAllocationsToMap(s.store, clientIdAddr) v{{.v}}Map, err := s.LoadAllocationsToMap(s.store, clientIdAddr)
retMap := make(map[AllocationId]Allocation, len(v{{.v}}Map))
for k, v := range v{{.v}}Map {
retMap[AllocationId(k)] = Allocation(v)
}
return retMap, err
{{end}} {{end}}
} }
func (s *state{{.v}}) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*verifreg9.Claim, bool, error) { func (s *state{{.v}}) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
{{if (le .v 8)}} {{if (le .v 8)}}
return nil, false, xerrors.Errorf("unsupported in actors v{{.v}}") return nil, false, xerrors.Errorf("unsupported in actors v{{.v}}")
{{else}} {{else}}
return s.FindClaim(s.store, providerIdAddr, claimId) claim, ok, err := s.FindClaim(s.store, providerIdAddr, verifreg{{.v}}.ClaimId(claimId))
return (*Claim)(claim), ok, err
{{end}} {{end}}
} }
func (s *state{{.v}}) GetClaims(providerIdAddr address.Address) (map[verifreg9.ClaimId]verifreg9.Claim, error) { func (s *state{{.v}}) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) {
{{if (le .v 8)}} {{if (le .v 8)}}
return nil, xerrors.Errorf("unsupported in actors v{{.v}}") return nil, xerrors.Errorf("unsupported in actors v{{.v}}")
{{else}} {{else}}
return s.LoadClaimsToMap(s.store, providerIdAddr) v{{.v}}Map, err := s.LoadClaimsToMap(s.store, providerIdAddr)
retMap := make(map[ClaimId]Claim, len(v{{.v}}Map))
for k, v := range v{{.v}}Map {
retMap[ClaimId(k)] = Claim(v)
}
return retMap, err
{{end}} {{end}}
} }

View File

@ -93,25 +93,25 @@ func (s *state0) GetState() interface{} {
return &s.State return &s.State
} }
func (s *state0) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*verifreg9.Allocation, bool, error) { func (s *state0) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*Allocation, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v0") return nil, false, xerrors.Errorf("unsupported in actors v0")
} }
func (s *state0) GetAllocations(clientIdAddr address.Address) (map[verifreg9.AllocationId]verifreg9.Allocation, error) { func (s *state0) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) {
return nil, xerrors.Errorf("unsupported in actors v0") return nil, xerrors.Errorf("unsupported in actors v0")
} }
func (s *state0) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*verifreg9.Claim, bool, error) { func (s *state0) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v0") return nil, false, xerrors.Errorf("unsupported in actors v0")
} }
func (s *state0) GetClaims(providerIdAddr address.Address) (map[verifreg9.ClaimId]verifreg9.Claim, error) { func (s *state0) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) {
return nil, xerrors.Errorf("unsupported in actors v0") return nil, xerrors.Errorf("unsupported in actors v0")

View File

@ -94,27 +94,42 @@ func (s *state10) GetState() interface{} {
return &s.State return &s.State
} }
func (s *state10) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*verifreg9.Allocation, bool, error) { func (s *state10) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*Allocation, bool, error) {
return s.FindAllocation(s.store, clientIdAddr, allocationId) alloc, ok, err := s.FindAllocation(s.store, clientIdAddr, verifreg10.AllocationId(allocationId))
return (*Allocation)(alloc), ok, err
}
func (s *state10) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) {
v10Map, err := s.LoadAllocationsToMap(s.store, clientIdAddr)
retMap := make(map[AllocationId]Allocation, len(v10Map))
for k, v := range v10Map {
retMap[AllocationId(k)] = Allocation(v)
}
return retMap, err
} }
func (s *state10) GetAllocations(clientIdAddr address.Address) (map[verifreg9.AllocationId]verifreg9.Allocation, error) { func (s *state10) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
return s.LoadAllocationsToMap(s.store, clientIdAddr) claim, ok, err := s.FindClaim(s.store, providerIdAddr, verifreg10.ClaimId(claimId))
return (*Claim)(claim), ok, err
} }
func (s *state10) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*verifreg9.Claim, bool, error) { func (s *state10) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) {
return s.FindClaim(s.store, providerIdAddr, claimId) v10Map, err := s.LoadClaimsToMap(s.store, providerIdAddr)
} retMap := make(map[ClaimId]Claim, len(v10Map))
for k, v := range v10Map {
retMap[ClaimId(k)] = Claim(v)
}
func (s *state10) GetClaims(providerIdAddr address.Address) (map[verifreg9.ClaimId]verifreg9.Claim, error) { return retMap, err
return s.LoadClaimsToMap(s.store, providerIdAddr)
} }

View File

@ -93,25 +93,25 @@ func (s *state2) GetState() interface{} {
return &s.State return &s.State
} }
func (s *state2) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*verifreg9.Allocation, bool, error) { func (s *state2) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*Allocation, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v2") return nil, false, xerrors.Errorf("unsupported in actors v2")
} }
func (s *state2) GetAllocations(clientIdAddr address.Address) (map[verifreg9.AllocationId]verifreg9.Allocation, error) { func (s *state2) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) {
return nil, xerrors.Errorf("unsupported in actors v2") return nil, xerrors.Errorf("unsupported in actors v2")
} }
func (s *state2) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*verifreg9.Claim, bool, error) { func (s *state2) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v2") return nil, false, xerrors.Errorf("unsupported in actors v2")
} }
func (s *state2) GetClaims(providerIdAddr address.Address) (map[verifreg9.ClaimId]verifreg9.Claim, error) { func (s *state2) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) {
return nil, xerrors.Errorf("unsupported in actors v2") return nil, xerrors.Errorf("unsupported in actors v2")

View File

@ -94,25 +94,25 @@ func (s *state3) GetState() interface{} {
return &s.State return &s.State
} }
func (s *state3) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*verifreg9.Allocation, bool, error) { func (s *state3) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*Allocation, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v3") return nil, false, xerrors.Errorf("unsupported in actors v3")
} }
func (s *state3) GetAllocations(clientIdAddr address.Address) (map[verifreg9.AllocationId]verifreg9.Allocation, error) { func (s *state3) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) {
return nil, xerrors.Errorf("unsupported in actors v3") return nil, xerrors.Errorf("unsupported in actors v3")
} }
func (s *state3) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*verifreg9.Claim, bool, error) { func (s *state3) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v3") return nil, false, xerrors.Errorf("unsupported in actors v3")
} }
func (s *state3) GetClaims(providerIdAddr address.Address) (map[verifreg9.ClaimId]verifreg9.Claim, error) { func (s *state3) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) {
return nil, xerrors.Errorf("unsupported in actors v3") return nil, xerrors.Errorf("unsupported in actors v3")

View File

@ -94,25 +94,25 @@ func (s *state4) GetState() interface{} {
return &s.State return &s.State
} }
func (s *state4) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*verifreg9.Allocation, bool, error) { func (s *state4) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*Allocation, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v4") return nil, false, xerrors.Errorf("unsupported in actors v4")
} }
func (s *state4) GetAllocations(clientIdAddr address.Address) (map[verifreg9.AllocationId]verifreg9.Allocation, error) { func (s *state4) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) {
return nil, xerrors.Errorf("unsupported in actors v4") return nil, xerrors.Errorf("unsupported in actors v4")
} }
func (s *state4) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*verifreg9.Claim, bool, error) { func (s *state4) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v4") return nil, false, xerrors.Errorf("unsupported in actors v4")
} }
func (s *state4) GetClaims(providerIdAddr address.Address) (map[verifreg9.ClaimId]verifreg9.Claim, error) { func (s *state4) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) {
return nil, xerrors.Errorf("unsupported in actors v4") return nil, xerrors.Errorf("unsupported in actors v4")

View File

@ -94,25 +94,25 @@ func (s *state5) GetState() interface{} {
return &s.State return &s.State
} }
func (s *state5) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*verifreg9.Allocation, bool, error) { func (s *state5) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*Allocation, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v5") return nil, false, xerrors.Errorf("unsupported in actors v5")
} }
func (s *state5) GetAllocations(clientIdAddr address.Address) (map[verifreg9.AllocationId]verifreg9.Allocation, error) { func (s *state5) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) {
return nil, xerrors.Errorf("unsupported in actors v5") return nil, xerrors.Errorf("unsupported in actors v5")
} }
func (s *state5) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*verifreg9.Claim, bool, error) { func (s *state5) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v5") return nil, false, xerrors.Errorf("unsupported in actors v5")
} }
func (s *state5) GetClaims(providerIdAddr address.Address) (map[verifreg9.ClaimId]verifreg9.Claim, error) { func (s *state5) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) {
return nil, xerrors.Errorf("unsupported in actors v5") return nil, xerrors.Errorf("unsupported in actors v5")

View File

@ -94,25 +94,25 @@ func (s *state6) GetState() interface{} {
return &s.State return &s.State
} }
func (s *state6) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*verifreg9.Allocation, bool, error) { func (s *state6) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*Allocation, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v6") return nil, false, xerrors.Errorf("unsupported in actors v6")
} }
func (s *state6) GetAllocations(clientIdAddr address.Address) (map[verifreg9.AllocationId]verifreg9.Allocation, error) { func (s *state6) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) {
return nil, xerrors.Errorf("unsupported in actors v6") return nil, xerrors.Errorf("unsupported in actors v6")
} }
func (s *state6) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*verifreg9.Claim, bool, error) { func (s *state6) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v6") return nil, false, xerrors.Errorf("unsupported in actors v6")
} }
func (s *state6) GetClaims(providerIdAddr address.Address) (map[verifreg9.ClaimId]verifreg9.Claim, error) { func (s *state6) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) {
return nil, xerrors.Errorf("unsupported in actors v6") return nil, xerrors.Errorf("unsupported in actors v6")

View File

@ -93,25 +93,25 @@ func (s *state7) GetState() interface{} {
return &s.State return &s.State
} }
func (s *state7) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*verifreg9.Allocation, bool, error) { func (s *state7) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*Allocation, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v7") return nil, false, xerrors.Errorf("unsupported in actors v7")
} }
func (s *state7) GetAllocations(clientIdAddr address.Address) (map[verifreg9.AllocationId]verifreg9.Allocation, error) { func (s *state7) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) {
return nil, xerrors.Errorf("unsupported in actors v7") return nil, xerrors.Errorf("unsupported in actors v7")
} }
func (s *state7) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*verifreg9.Claim, bool, error) { func (s *state7) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v7") return nil, false, xerrors.Errorf("unsupported in actors v7")
} }
func (s *state7) GetClaims(providerIdAddr address.Address) (map[verifreg9.ClaimId]verifreg9.Claim, error) { func (s *state7) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) {
return nil, xerrors.Errorf("unsupported in actors v7") return nil, xerrors.Errorf("unsupported in actors v7")

View File

@ -93,25 +93,25 @@ func (s *state8) GetState() interface{} {
return &s.State return &s.State
} }
func (s *state8) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*verifreg9.Allocation, bool, error) { func (s *state8) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*Allocation, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v8") return nil, false, xerrors.Errorf("unsupported in actors v8")
} }
func (s *state8) GetAllocations(clientIdAddr address.Address) (map[verifreg9.AllocationId]verifreg9.Allocation, error) { func (s *state8) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) {
return nil, xerrors.Errorf("unsupported in actors v8") return nil, xerrors.Errorf("unsupported in actors v8")
} }
func (s *state8) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*verifreg9.Claim, bool, error) { func (s *state8) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
return nil, false, xerrors.Errorf("unsupported in actors v8") return nil, false, xerrors.Errorf("unsupported in actors v8")
} }
func (s *state8) GetClaims(providerIdAddr address.Address) (map[verifreg9.ClaimId]verifreg9.Claim, error) { func (s *state8) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) {
return nil, xerrors.Errorf("unsupported in actors v8") return nil, xerrors.Errorf("unsupported in actors v8")

View File

@ -93,27 +93,42 @@ func (s *state9) GetState() interface{} {
return &s.State return &s.State
} }
func (s *state9) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*verifreg9.Allocation, bool, error) { func (s *state9) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*Allocation, bool, error) {
return s.FindAllocation(s.store, clientIdAddr, allocationId) alloc, ok, err := s.FindAllocation(s.store, clientIdAddr, verifreg9.AllocationId(allocationId))
return (*Allocation)(alloc), ok, err
}
func (s *state9) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) {
v9Map, err := s.LoadAllocationsToMap(s.store, clientIdAddr)
retMap := make(map[AllocationId]Allocation, len(v9Map))
for k, v := range v9Map {
retMap[AllocationId(k)] = Allocation(v)
}
return retMap, err
} }
func (s *state9) GetAllocations(clientIdAddr address.Address) (map[verifreg9.AllocationId]verifreg9.Allocation, error) { func (s *state9) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
return s.LoadAllocationsToMap(s.store, clientIdAddr) claim, ok, err := s.FindClaim(s.store, providerIdAddr, verifreg9.ClaimId(claimId))
return (*Claim)(claim), ok, err
} }
func (s *state9) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*verifreg9.Claim, bool, error) { func (s *state9) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) {
return s.FindClaim(s.store, providerIdAddr, claimId) v9Map, err := s.LoadClaimsToMap(s.store, providerIdAddr)
} retMap := make(map[ClaimId]Claim, len(v9Map))
for k, v := range v9Map {
retMap[ClaimId(k)] = Claim(v)
}
func (s *state9) GetClaims(providerIdAddr address.Address) (map[verifreg9.ClaimId]verifreg9.Claim, error) { return retMap, err
return s.LoadClaimsToMap(s.store, providerIdAddr)
} }

View File

@ -126,10 +126,10 @@ type State interface {
RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error) RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error)
ForEachVerifier(func(addr address.Address, dcap abi.StoragePower) error) error ForEachVerifier(func(addr address.Address, dcap abi.StoragePower) error) error
ForEachClient(func(addr address.Address, dcap abi.StoragePower) error) error ForEachClient(func(addr address.Address, dcap abi.StoragePower) error) error
GetAllocation(clientIdAddr address.Address, allocationId verifregtypes.AllocationId) (*verifregtypes.Allocation, bool, error) GetAllocation(clientIdAddr address.Address, allocationId AllocationId) (*Allocation, bool, error)
GetAllocations(clientIdAddr address.Address) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error)
GetClaim(providerIdAddr address.Address, claimId verifregtypes.ClaimId) (*verifregtypes.Claim, bool, error) GetClaim(providerIdAddr address.Address, claimId ClaimId) (*Claim, bool, error)
GetClaims(providerIdAddr address.Address) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error)
GetState() interface{} GetState() interface{}
} }
@ -147,3 +147,8 @@ func AllCodes() []cid.Cid {
(&state10{}).Code(), (&state10{}).Code(),
} }
} }
type Allocation = verifregtypes.Allocation
type AllocationId = verifregtypes.AllocationId
type Claim = verifregtypes.Claim
type ClaimId = verifregtypes.ClaimId

2
go.mod
View File

@ -42,7 +42,7 @@ require (
github.com/filecoin-project/go-legs v0.4.4 github.com/filecoin-project/go-legs v0.4.4
github.com/filecoin-project/go-padreader v0.0.1 github.com/filecoin-project/go-padreader v0.0.1
github.com/filecoin-project/go-paramfetch v0.0.4 github.com/filecoin-project/go-paramfetch v0.0.4
github.com/filecoin-project/go-state-types v0.9.10-0.20221116233942-e49c83ccf23b github.com/filecoin-project/go-state-types v0.10.0-alpha-2
github.com/filecoin-project/go-statemachine v1.0.2 github.com/filecoin-project/go-statemachine v1.0.2
github.com/filecoin-project/go-statestore v0.2.0 github.com/filecoin-project/go-statestore v0.2.0
github.com/filecoin-project/go-storedcounter v0.1.0 github.com/filecoin-project/go-storedcounter v0.1.0

4
go.sum
View File

@ -352,8 +352,8 @@ github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psS
github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.8/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= github.com/filecoin-project/go-state-types v0.1.8/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.9.10-0.20221116233942-e49c83ccf23b h1:seLs+8DkIOu5k01y2RLygOqH8F/NWjXSkzhlVK6tZaA= github.com/filecoin-project/go-state-types v0.10.0-alpha-2 h1:xz8+sXAuCMane7SkEYCtQjD/zYJ4n1d5bxwYNL8Thf0=
github.com/filecoin-project/go-state-types v0.9.10-0.20221116233942-e49c83ccf23b/go.mod h1:7ty480tvttEAqWKywhAaDCElk7ksTqEXtXWAzTSdEKo= github.com/filecoin-project/go-state-types v0.10.0-alpha-2/go.mod h1:7ty480tvttEAqWKywhAaDCElk7ksTqEXtXWAzTSdEKo=
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig=
github.com/filecoin-project/go-statemachine v1.0.2 h1:421SSWBk8GIoCoWYYTE/d+qCWccgmRH0uXotXRDjUbc= github.com/filecoin-project/go-statemachine v1.0.2 h1:421SSWBk8GIoCoWYYTE/d+qCWccgmRH0uXotXRDjUbc=
github.com/filecoin-project/go-statemachine v1.0.2/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= github.com/filecoin-project/go-statemachine v1.0.2/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54=

View File

@ -771,7 +771,7 @@ func (m *StateModule) StateMarketStorageDeal(ctx context.Context, dealId abi.Dea
return stmgr.GetStorageDeal(ctx, m.StateManager, dealId, ts) return stmgr.GetStorageDeal(ctx, m.StateManager, dealId, ts)
} }
func (a *StateAPI) StateGetAllocationForPendingDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*verifregtypes.Allocation, error) { func (a *StateAPI) StateGetAllocationForPendingDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*verifreg.Allocation, error) {
ts, err := a.Chain.GetTipSetFromKey(ctx, tsk) ts, err := a.Chain.GetTipSetFromKey(ctx, tsk)
if err != nil { if err != nil {
return nil, xerrors.Errorf("loading tipset %s: %w", tsk, err) return nil, xerrors.Errorf("loading tipset %s: %w", tsk, err)
@ -798,7 +798,7 @@ func (a *StateAPI) StateGetAllocationForPendingDeal(ctx context.Context, dealId
return a.StateGetAllocation(ctx, dealState.Proposal.Client, allocationId, tsk) return a.StateGetAllocation(ctx, dealState.Proposal.Client, allocationId, tsk)
} }
func (a *StateAPI) StateGetAllocation(ctx context.Context, clientAddr address.Address, allocationId verifregtypes.AllocationId, tsk types.TipSetKey) (*verifregtypes.Allocation, error) { func (a *StateAPI) StateGetAllocation(ctx context.Context, clientAddr address.Address, allocationId verifreg.AllocationId, tsk types.TipSetKey) (*verifreg.Allocation, error) {
idAddr, err := a.StateLookupID(ctx, clientAddr, tsk) idAddr, err := a.StateLookupID(ctx, clientAddr, tsk)
if err != nil { if err != nil {
return nil, err return nil, err
@ -825,7 +825,7 @@ func (a *StateAPI) StateGetAllocation(ctx context.Context, clientAddr address.Ad
return allocation, nil return allocation, nil
} }
func (a *StateAPI) StateGetAllocations(ctx context.Context, clientAddr address.Address, tsk types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) { func (a *StateAPI) StateGetAllocations(ctx context.Context, clientAddr address.Address, tsk types.TipSetKey) (map[verifreg.AllocationId]verifreg.Allocation, error) {
idAddr, err := a.StateLookupID(ctx, clientAddr, tsk) idAddr, err := a.StateLookupID(ctx, clientAddr, tsk)
if err != nil { if err != nil {
return nil, err return nil, err
@ -849,7 +849,7 @@ func (a *StateAPI) StateGetAllocations(ctx context.Context, clientAddr address.A
return allocations, nil return allocations, nil
} }
func (a *StateAPI) StateGetClaim(ctx context.Context, providerAddr address.Address, claimId verifregtypes.ClaimId, tsk types.TipSetKey) (*verifregtypes.Claim, error) { func (a *StateAPI) StateGetClaim(ctx context.Context, providerAddr address.Address, claimId verifreg.ClaimId, tsk types.TipSetKey) (*verifreg.Claim, error) {
idAddr, err := a.StateLookupID(ctx, providerAddr, tsk) idAddr, err := a.StateLookupID(ctx, providerAddr, tsk)
if err != nil { if err != nil {
return nil, err return nil, err
@ -876,7 +876,7 @@ func (a *StateAPI) StateGetClaim(ctx context.Context, providerAddr address.Addre
return claim, nil return claim, nil
} }
func (a *StateAPI) StateGetClaims(ctx context.Context, providerAddr address.Address, tsk types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) { func (a *StateAPI) StateGetClaims(ctx context.Context, providerAddr address.Address, tsk types.TipSetKey) (map[verifreg.ClaimId]verifreg.Claim, error) {
idAddr, err := a.StateLookupID(ctx, providerAddr, tsk) idAddr, err := a.StateLookupID(ctx, providerAddr, tsk)
if err != nil { if err != nil {
return nil, err return nil, err