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 {
{{if (le .v 8)}}
return DealState{
ret := DealState{
SectorStartEpoch: v{{.v}}.SectorStartEpoch,
LastUpdatedEpoch: v{{.v}}.LastUpdatedEpoch,
SlashEpoch: v{{.v}}.SlashEpoch,
VerifiedClaim: 0,
}
{{else}}
return (DealState)(v{{.v}})
{{if (ge .v 9)}}
ret.VerifiedClaim = verifregtypes.AllocationId(v{{.v}}.VerifiedClaim)
{{end}}
return ret
}
type dealProposals{{.v}} struct {

View File

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

View File

@ -186,9 +186,16 @@ func (s *dealStates10) array() adt.Array {
}
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 {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -186,9 +186,16 @@ func (s *dealStates9) array() adt.Array {
}
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 {

View File

@ -17,7 +17,7 @@ import (
"github.com/filecoin-project/lotus/chain/actors/adt"
"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}}
{{if (le . 7)}}
@ -82,8 +82,8 @@ type State interface {
GetSector(abi.SectorNumber) (*SectorOnChainInfo, error)
FindSector(abi.SectorNumber) (*SectorLocation, error)
GetSectorExpiration(abi.SectorNumber) (*SectorExpiration, error)
GetPrecommittedSector(abi.SectorNumber) (*miner{{.latestVersion}}.SectorPreCommitOnChainInfo, error)
ForEachPrecommittedSector(func(miner{{.latestVersion}}.SectorPreCommitOnChainInfo) error) error
GetPrecommittedSector(abi.SectorNumber) (*SectorPreCommitOnChainInfo, error)
ForEachPrecommittedSector(func(SectorPreCommitOnChainInfo) error) error
LoadSectors(sectorNos *bitfield.BitField) ([]*SectorOnChainInfo, error)
NumLiveSectors() (uint64, error)
IsAllocated(abi.SectorNumber) (bool, error)
@ -112,7 +112,7 @@ type State interface {
sectors() (adt.Array, error)
decodeSectorOnChainInfo(*cbg.Deferred) (SectorOnChainInfo, error)
precommits() (adt.Map, error)
decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (miner{{.latestVersion}}.SectorPreCommitOnChainInfo, error)
decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (SectorPreCommitOnChainInfo, error)
GetState() interface{}
}
@ -150,7 +150,7 @@ type Partition interface {
UnprovenSectors() (bitfield.BitField, error)
}
type SectorOnChainInfo = miner{{.latestVersion}}.SectorOnChainInfo
type SectorOnChainInfo = minertypes.SectorOnChainInfo
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
@ -205,9 +205,12 @@ func WinningPoStProofTypeFromWindowPoStProofType(nver network.Version, proof abi
}
}
type MinerInfo = miner{{.latestVersion}}.MinerInfo
type WorkerKeyChange = miner{{.latestVersion}}.WorkerKeyChange
type SectorPreCommitOnChainInfo = miner{{.latestVersion}}.SectorPreCommitOnChainInfo
type MinerInfo = minertypes.MinerInfo
type BeneficiaryTerm = minertypes.BeneficiaryTerm
type PendingBeneficiaryChange = minertypes.PendingBeneficiaryChange
type WorkerKeyChange = minertypes.WorkerKeyChange
type SectorPreCommitOnChainInfo = minertypes.SectorPreCommitOnChainInfo
type SectorPreCommitInfo = minertypes.SectorPreCommitInfo
type WindowPostVerifyInfo = proof.WindowPoStVerifyInfo
type SectorExpiration struct {
@ -235,8 +238,8 @@ type SectorExtensions struct {
}
type PreCommitChanges struct {
Added []miner{{.latestVersion}}.SectorPreCommitOnChainInfo
Removed []miner{{.latestVersion}}.SectorPreCommitOnChainInfo
Added []SectorPreCommitOnChainInfo
Removed []SectorPreCommitOnChainInfo
}
type LockedFunds struct {

View File

@ -9,7 +9,7 @@ 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"
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/dline"
"github.com/filecoin-project/go-state-types/network"
@ -130,8 +130,8 @@ type State interface {
GetSector(abi.SectorNumber) (*SectorOnChainInfo, error)
FindSector(abi.SectorNumber) (*SectorLocation, error)
GetSectorExpiration(abi.SectorNumber) (*SectorExpiration, error)
GetPrecommittedSector(abi.SectorNumber) (*miner10.SectorPreCommitOnChainInfo, error)
ForEachPrecommittedSector(func(miner10.SectorPreCommitOnChainInfo) error) error
GetPrecommittedSector(abi.SectorNumber) (*SectorPreCommitOnChainInfo, error)
ForEachPrecommittedSector(func(SectorPreCommitOnChainInfo) error) error
LoadSectors(sectorNos *bitfield.BitField) ([]*SectorOnChainInfo, error)
NumLiveSectors() (uint64, error)
IsAllocated(abi.SectorNumber) (bool, error)
@ -160,7 +160,7 @@ type State interface {
sectors() (adt.Array, error)
decodeSectorOnChainInfo(*cbg.Deferred) (SectorOnChainInfo, error)
precommits() (adt.Map, error)
decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (miner10.SectorPreCommitOnChainInfo, error)
decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (SectorPreCommitOnChainInfo, error)
GetState() interface{}
}
@ -198,7 +198,7 @@ type Partition interface {
UnprovenSectors() (bitfield.BitField, error)
}
type SectorOnChainInfo = miner10.SectorOnChainInfo
type SectorOnChainInfo = minertypes.SectorOnChainInfo
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
@ -253,9 +253,12 @@ func WinningPoStProofTypeFromWindowPoStProofType(nver network.Version, proof abi
}
}
type MinerInfo = miner10.MinerInfo
type WorkerKeyChange = miner10.WorkerKeyChange
type SectorPreCommitOnChainInfo = miner10.SectorPreCommitOnChainInfo
type MinerInfo = minertypes.MinerInfo
type BeneficiaryTerm = minertypes.BeneficiaryTerm
type PendingBeneficiaryChange = minertypes.PendingBeneficiaryChange
type WorkerKeyChange = minertypes.WorkerKeyChange
type SectorPreCommitOnChainInfo = minertypes.SectorPreCommitOnChainInfo
type SectorPreCommitInfo = minertypes.SectorPreCommitInfo
type WindowPostVerifyInfo = proof.WindowPoStVerifyInfo
type SectorExpiration struct {
@ -283,8 +286,8 @@ type SectorExtensions struct {
}
type PreCommitChanges struct {
Added []miner10.SectorPreCommitOnChainInfo
Removed []miner10.SectorPreCommitOnChainInfo
Added []SectorPreCommitOnChainInfo
Removed []SectorPreCommitOnChainInfo
}
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"
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 (ge .v 3)}}
@ -218,7 +217,7 @@ func (s *state{{.v}}) GetSectorExpiration(num abi.SectorNumber) (*SectorExpirati
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)
if !ok || err != nil {
return nil, err
@ -229,7 +228,7 @@ func (s *state{{.v}}) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.S
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) -}}
precommitted, err := adt{{.v}}.AsMap(s.store, s.State.PreCommittedSectors, builtin{{.v}}.DefaultHamtBitwidth)
{{- else -}}
@ -417,9 +416,10 @@ func (s *state{{.v}}) Info() (MinerInfo, error) {
WindowPoStPartitionSectors: info.WindowPoStPartitionSectors,
ConsensusFaultElapsed: {{if (ge .v 2)}}info.ConsensusFaultElapsed{{else}}-1{{end}},
{{if (ge .v 9)}}
Beneficiary: info.Beneficiary,
BeneficiaryTerm: info.BeneficiaryTerm,
PendingBeneficiaryTerm: info.PendingBeneficiaryTerm,{{end}}
Beneficiary: info.Beneficiary,
BeneficiaryTerm: BeneficiaryTerm(info.BeneficiaryTerm),
PendingBeneficiaryTerm: (*PendingBeneficiaryChange)(info.PendingBeneficiaryTerm),
{{end}}
}
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}})
}
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
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err
return SectorPreCommitOnChainInfo{}, err
}
return fromV{{.v}}SectorPreCommitOnChainInfo(sp), nil
@ -586,9 +586,9 @@ func fromV{{.v}}SectorOnChainInfo(v{{.v}} miner{{.v}}.SectorOnChainInfo) SectorO
return info
}
func fromV{{.v}}SectorPreCommitOnChainInfo(v{{.v}} miner{{.v}}.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
{{if (le .v 8)}}return minertypes.SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{
func fromV{{.v}}SectorPreCommitOnChainInfo(v{{.v}} miner{{.v}}.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
ret := SectorPreCommitOnChainInfo{
Info: SectorPreCommitInfo{
SealProof: v{{.v}}.Info.SealProof,
SectorNumber: v{{.v}}.Info.SectorNumber,
SealedCID: v{{.v}}.Info.SealedCID,
@ -599,7 +599,13 @@ func fromV{{.v}}SectorPreCommitOnChainInfo(v{{.v}} miner{{.v}}.SectorPreCommitOn
},
PreCommitDeposit: v{{.v}}.PreCommitDeposit,
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{} {

View File

@ -14,7 +14,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/v10/miner"
"github.com/filecoin-project/go-state-types/dline"
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
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
}
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)
if !ok || err != nil {
return nil, err
@ -209,7 +208,7 @@ func (s *state0) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
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)
if err != nil {
return err
@ -422,11 +421,11 @@ func (s *state0) precommits() (adt.Map, error) {
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
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err
return SectorPreCommitOnChainInfo{}, err
}
return fromV0SectorPreCommitOnChainInfo(sp), nil
@ -512,9 +511,9 @@ func fromV0SectorOnChainInfo(v0 miner0.SectorOnChainInfo) SectorOnChainInfo {
return info
}
func fromV0SectorPreCommitOnChainInfo(v0 miner0.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{
func fromV0SectorPreCommitOnChainInfo(v0 miner0.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
ret := SectorPreCommitOnChainInfo{
Info: SectorPreCommitInfo{
SealProof: v0.Info.SealProof,
SectorNumber: v0.Info.SectorNumber,
SealedCID: v0.Info.SealedCID,
@ -526,6 +525,8 @@ func fromV0SectorPreCommitOnChainInfo(v0 miner0.SectorPreCommitOnChainInfo) mine
PreCommitDeposit: v0.PreCommitDeposit,
PreCommitEpoch: v0.PreCommitEpoch,
}
return ret
}
func (s *state0) GetState() interface{} {

View File

@ -15,7 +15,6 @@ import (
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin10 "github.com/filecoin-project/go-state-types/builtin"
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"
"github.com/filecoin-project/go-state-types/dline"
@ -197,7 +196,7 @@ func (s *state10) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration,
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)
if !ok || err != nil {
return nil, err
@ -208,7 +207,7 @@ func (s *state10) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Secto
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)
if err != nil {
return err
@ -387,8 +386,8 @@ func (s *state10) Info() (MinerInfo, error) {
ConsensusFaultElapsed: info.ConsensusFaultElapsed,
Beneficiary: info.Beneficiary,
BeneficiaryTerm: info.BeneficiaryTerm,
PendingBeneficiaryTerm: info.PendingBeneficiaryTerm,
BeneficiaryTerm: BeneficiaryTerm(info.BeneficiaryTerm),
PendingBeneficiaryTerm: (*PendingBeneficiaryChange)(info.PendingBeneficiaryTerm),
}
return mi, nil
@ -420,11 +419,11 @@ func (s *state10) precommits() (adt.Map, error) {
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
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err
return SectorPreCommitOnChainInfo{}, err
}
return fromV10SectorPreCommitOnChainInfo(sp), nil
@ -548,8 +547,24 @@ func fromV10SectorOnChainInfo(v10 miner10.SectorOnChainInfo) SectorOnChainInfo {
return info
}
func fromV10SectorPreCommitOnChainInfo(v10 miner10.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
return v10
func fromV10SectorPreCommitOnChainInfo(v10 miner10.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
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{} {

View File

@ -13,7 +13,6 @@ import (
rle "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi"
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"
miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner"
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
}
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)
if !ok || err != nil {
return nil, err
@ -208,7 +207,7 @@ func (s *state2) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
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)
if err != nil {
return err
@ -421,11 +420,11 @@ func (s *state2) precommits() (adt.Map, error) {
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
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err
return SectorPreCommitOnChainInfo{}, err
}
return fromV2SectorPreCommitOnChainInfo(sp), nil
@ -543,9 +542,9 @@ func fromV2SectorOnChainInfo(v2 miner2.SectorOnChainInfo) SectorOnChainInfo {
return info
}
func fromV2SectorPreCommitOnChainInfo(v2 miner2.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{
func fromV2SectorPreCommitOnChainInfo(v2 miner2.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
ret := SectorPreCommitOnChainInfo{
Info: SectorPreCommitInfo{
SealProof: v2.Info.SealProof,
SectorNumber: v2.Info.SectorNumber,
SealedCID: v2.Info.SealedCID,
@ -557,6 +556,8 @@ func fromV2SectorPreCommitOnChainInfo(v2 miner2.SectorPreCommitOnChainInfo) mine
PreCommitDeposit: v2.PreCommitDeposit,
PreCommitEpoch: v2.PreCommitEpoch,
}
return ret
}
func (s *state2) GetState() interface{} {

View File

@ -13,7 +13,6 @@ import (
rle "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi"
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"
builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
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
}
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)
if !ok || err != nil {
return nil, err
@ -209,7 +208,7 @@ func (s *state3) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
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)
if err != nil {
return err
@ -417,11 +416,11 @@ func (s *state3) precommits() (adt.Map, error) {
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
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err
return SectorPreCommitOnChainInfo{}, err
}
return fromV3SectorPreCommitOnChainInfo(sp), nil
@ -543,9 +542,9 @@ func fromV3SectorOnChainInfo(v3 miner3.SectorOnChainInfo) SectorOnChainInfo {
return info
}
func fromV3SectorPreCommitOnChainInfo(v3 miner3.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{
func fromV3SectorPreCommitOnChainInfo(v3 miner3.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
ret := SectorPreCommitOnChainInfo{
Info: SectorPreCommitInfo{
SealProof: v3.Info.SealProof,
SectorNumber: v3.Info.SectorNumber,
SealedCID: v3.Info.SealedCID,
@ -557,6 +556,8 @@ func fromV3SectorPreCommitOnChainInfo(v3 miner3.SectorPreCommitOnChainInfo) mine
PreCommitDeposit: v3.PreCommitDeposit,
PreCommitEpoch: v3.PreCommitEpoch,
}
return ret
}
func (s *state3) GetState() interface{} {

View File

@ -13,7 +13,6 @@ import (
rle "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi"
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"
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
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
}
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)
if !ok || err != nil {
return nil, err
@ -209,7 +208,7 @@ func (s *state4) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
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)
if err != nil {
return err
@ -417,11 +416,11 @@ func (s *state4) precommits() (adt.Map, error) {
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
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err
return SectorPreCommitOnChainInfo{}, err
}
return fromV4SectorPreCommitOnChainInfo(sp), nil
@ -543,9 +542,9 @@ func fromV4SectorOnChainInfo(v4 miner4.SectorOnChainInfo) SectorOnChainInfo {
return info
}
func fromV4SectorPreCommitOnChainInfo(v4 miner4.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{
func fromV4SectorPreCommitOnChainInfo(v4 miner4.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
ret := SectorPreCommitOnChainInfo{
Info: SectorPreCommitInfo{
SealProof: v4.Info.SealProof,
SectorNumber: v4.Info.SectorNumber,
SealedCID: v4.Info.SealedCID,
@ -557,6 +556,8 @@ func fromV4SectorPreCommitOnChainInfo(v4 miner4.SectorPreCommitOnChainInfo) mine
PreCommitDeposit: v4.PreCommitDeposit,
PreCommitEpoch: v4.PreCommitEpoch,
}
return ret
}
func (s *state4) GetState() interface{} {

View File

@ -13,7 +13,6 @@ import (
rle "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi"
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"
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
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
}
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)
if !ok || err != nil {
return nil, err
@ -209,7 +208,7 @@ func (s *state5) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
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)
if err != nil {
return err
@ -417,11 +416,11 @@ func (s *state5) precommits() (adt.Map, error) {
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
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err
return SectorPreCommitOnChainInfo{}, err
}
return fromV5SectorPreCommitOnChainInfo(sp), nil
@ -543,9 +542,9 @@ func fromV5SectorOnChainInfo(v5 miner5.SectorOnChainInfo) SectorOnChainInfo {
return info
}
func fromV5SectorPreCommitOnChainInfo(v5 miner5.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{
func fromV5SectorPreCommitOnChainInfo(v5 miner5.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
ret := SectorPreCommitOnChainInfo{
Info: SectorPreCommitInfo{
SealProof: v5.Info.SealProof,
SectorNumber: v5.Info.SectorNumber,
SealedCID: v5.Info.SealedCID,
@ -557,6 +556,8 @@ func fromV5SectorPreCommitOnChainInfo(v5 miner5.SectorPreCommitOnChainInfo) mine
PreCommitDeposit: v5.PreCommitDeposit,
PreCommitEpoch: v5.PreCommitEpoch,
}
return ret
}
func (s *state5) GetState() interface{} {

View File

@ -13,7 +13,6 @@ import (
rle "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi"
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"
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
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
}
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)
if !ok || err != nil {
return nil, err
@ -209,7 +208,7 @@ func (s *state6) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
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)
if err != nil {
return err
@ -417,11 +416,11 @@ func (s *state6) precommits() (adt.Map, error) {
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
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err
return SectorPreCommitOnChainInfo{}, err
}
return fromV6SectorPreCommitOnChainInfo(sp), nil
@ -543,9 +542,9 @@ func fromV6SectorOnChainInfo(v6 miner6.SectorOnChainInfo) SectorOnChainInfo {
return info
}
func fromV6SectorPreCommitOnChainInfo(v6 miner6.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{
func fromV6SectorPreCommitOnChainInfo(v6 miner6.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
ret := SectorPreCommitOnChainInfo{
Info: SectorPreCommitInfo{
SealProof: v6.Info.SealProof,
SectorNumber: v6.Info.SectorNumber,
SealedCID: v6.Info.SealedCID,
@ -557,6 +556,8 @@ func fromV6SectorPreCommitOnChainInfo(v6 miner6.SectorPreCommitOnChainInfo) mine
PreCommitDeposit: v6.PreCommitDeposit,
PreCommitEpoch: v6.PreCommitEpoch,
}
return ret
}
func (s *state6) GetState() interface{} {

View File

@ -13,7 +13,6 @@ import (
rle "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi"
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"
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
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
}
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)
if !ok || err != nil {
return nil, err
@ -208,7 +207,7 @@ func (s *state7) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
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)
if err != nil {
return err
@ -416,11 +415,11 @@ func (s *state7) precommits() (adt.Map, error) {
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
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err
return SectorPreCommitOnChainInfo{}, err
}
return fromV7SectorPreCommitOnChainInfo(sp), nil
@ -544,9 +543,9 @@ func fromV7SectorOnChainInfo(v7 miner7.SectorOnChainInfo) SectorOnChainInfo {
return info
}
func fromV7SectorPreCommitOnChainInfo(v7 miner7.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{
func fromV7SectorPreCommitOnChainInfo(v7 miner7.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
ret := SectorPreCommitOnChainInfo{
Info: SectorPreCommitInfo{
SealProof: v7.Info.SealProof,
SectorNumber: v7.Info.SectorNumber,
SealedCID: v7.Info.SealedCID,
@ -558,6 +557,8 @@ func fromV7SectorPreCommitOnChainInfo(v7 miner7.SectorPreCommitOnChainInfo) mine
PreCommitDeposit: v7.PreCommitDeposit,
PreCommitEpoch: v7.PreCommitEpoch,
}
return ret
}
func (s *state7) GetState() interface{} {

View File

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

View File

@ -14,7 +14,6 @@ import (
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
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"
adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt"
"github.com/filecoin-project/go-state-types/dline"
@ -197,7 +196,7 @@ func (s *state9) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
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)
if !ok || err != nil {
return nil, err
@ -208,7 +207,7 @@ func (s *state9) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.Sector
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)
if err != nil {
return err
@ -387,8 +386,8 @@ func (s *state9) Info() (MinerInfo, error) {
ConsensusFaultElapsed: info.ConsensusFaultElapsed,
Beneficiary: info.Beneficiary,
BeneficiaryTerm: info.BeneficiaryTerm,
PendingBeneficiaryTerm: info.PendingBeneficiaryTerm,
BeneficiaryTerm: BeneficiaryTerm(info.BeneficiaryTerm),
PendingBeneficiaryTerm: (*PendingBeneficiaryChange)(info.PendingBeneficiaryTerm),
}
return mi, nil
@ -420,11 +419,11 @@ func (s *state9) precommits() (adt.Map, error) {
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
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return minertypes.SectorPreCommitOnChainInfo{}, err
return SectorPreCommitOnChainInfo{}, err
}
return fromV9SectorPreCommitOnChainInfo(sp), nil
@ -548,8 +547,24 @@ func fromV9SectorOnChainInfo(v9 miner9.SectorOnChainInfo) SectorOnChainInfo {
return info
}
func fromV9SectorPreCommitOnChainInfo(v9 miner9.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
return v9
func fromV9SectorPreCommitOnChainInfo(v9 miner9.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
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{} {

View File

@ -78,10 +78,10 @@ type State interface {
RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error)
ForEachVerifier(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)
GetAllocations(clientIdAddr address.Address) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error)
GetClaim(providerIdAddr address.Address, claimId verifregtypes.ClaimId) (*verifregtypes.Claim, bool, error)
GetClaims(providerIdAddr address.Address) (map[verifregtypes.ClaimId]verifregtypes.Claim, error)
GetAllocation(clientIdAddr address.Address, allocationId AllocationId) (*Allocation, bool, error)
GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error)
GetClaim(providerIdAddr address.Address, claimId ClaimId) (*Claim, bool, error)
GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error)
GetState() interface{}
}
@ -91,3 +91,8 @@ func AllCodes() []cid.Cid {
{{- 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
}
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)}}
return nil, false, xerrors.Errorf("unsupported in actors v{{.v}}")
{{else}}
return s.FindAllocation(s.store, clientIdAddr, allocationId)
{{end}}
alloc, ok, err := s.FindAllocation(s.store, clientIdAddr, verifreg{{.v}}.AllocationId(allocationId))
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)}}
return nil, xerrors.Errorf("unsupported in actors v{{.v}}")
{{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}}
}
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)}}
return nil, false, xerrors.Errorf("unsupported in actors v{{.v}}")
{{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}}
}
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)}}
return nil, xerrors.Errorf("unsupported in actors v{{.v}}")
{{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}}
}

View File

@ -93,25 +93,25 @@ func (s *state0) GetState() interface{} {
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")
}
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")
}
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")
}
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")

View File

@ -94,27 +94,42 @@ func (s *state10) GetState() interface{} {
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 s.LoadClaimsToMap(s.store, providerIdAddr)
return retMap, err
}

View File

@ -93,25 +93,25 @@ func (s *state2) GetState() interface{} {
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")
}
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")
}
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")
}
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")

View File

@ -94,25 +94,25 @@ func (s *state3) GetState() interface{} {
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")
}
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")
}
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")
}
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")

View File

@ -94,25 +94,25 @@ func (s *state4) GetState() interface{} {
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")
}
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")
}
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")
}
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")

View File

@ -94,25 +94,25 @@ func (s *state5) GetState() interface{} {
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")
}
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")
}
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")
}
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")

View File

@ -94,25 +94,25 @@ func (s *state6) GetState() interface{} {
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")
}
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")
}
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")
}
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")

View File

@ -93,25 +93,25 @@ func (s *state7) GetState() interface{} {
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")
}
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")
}
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")
}
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")

View File

@ -93,25 +93,25 @@ func (s *state8) GetState() interface{} {
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")
}
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")
}
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")
}
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")

View File

@ -93,27 +93,42 @@ func (s *state9) GetState() interface{} {
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 s.LoadClaimsToMap(s.store, providerIdAddr)
return retMap, err
}

View File

@ -126,10 +126,10 @@ type State interface {
RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error)
ForEachVerifier(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)
GetAllocations(clientIdAddr address.Address) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error)
GetClaim(providerIdAddr address.Address, claimId verifregtypes.ClaimId) (*verifregtypes.Claim, bool, error)
GetClaims(providerIdAddr address.Address) (map[verifregtypes.ClaimId]verifregtypes.Claim, error)
GetAllocation(clientIdAddr address.Address, allocationId AllocationId) (*Allocation, bool, error)
GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error)
GetClaim(providerIdAddr address.Address, claimId ClaimId) (*Claim, bool, error)
GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error)
GetState() interface{}
}
@ -147,3 +147,8 @@ func AllCodes() []cid.Cid {
(&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-padreader v0.0.1
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-statestore v0.2.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.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.9.10-0.20221116233942-e49c83ccf23b h1:seLs+8DkIOu5k01y2RLygOqH8F/NWjXSkzhlVK6tZaA=
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 h1:xz8+sXAuCMane7SkEYCtQjD/zYJ4n1d5bxwYNL8Thf0=
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 v1.0.2 h1:421SSWBk8GIoCoWYYTE/d+qCWccgmRH0uXotXRDjUbc=
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)
}
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)
if err != nil {
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)
}
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)
if err != nil {
return nil, err
@ -825,7 +825,7 @@ func (a *StateAPI) StateGetAllocation(ctx context.Context, clientAddr address.Ad
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)
if err != nil {
return nil, err
@ -849,7 +849,7 @@ func (a *StateAPI) StateGetAllocations(ctx context.Context, clientAddr address.A
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)
if err != nil {
return nil, err
@ -876,7 +876,7 @@ func (a *StateAPI) StateGetClaim(ctx context.Context, providerAddr address.Addre
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)
if err != nil {
return nil, err