Skip to content

Commit

Permalink
fix: process actor version 10 tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
frrist committed Mar 16, 2023
1 parent 917b4eb commit 120d439
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 40 deletions.
32 changes: 18 additions & 14 deletions chain/indexer/integrated/processor/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@ func MakeProcessors(api tasks.DataSource, indexerTasks []string) (*IndexerProces
case tasktype.MinerBeneficiary:
out.ActorProcessors[t] = actorstate.NewTask(api, actorstate.NewCustomTypedActorExtractorMap(
map[cid.Cid][]actorstate.ActorStateExtractor{
mineractors.VersionCodes()[actorstypes.Version9]: {minertask.BeneficiaryExtractor{}},
mineractors.VersionCodes()[actorstypes.Version9]: {minertask.BeneficiaryExtractor{}},
mineractors.VersionCodes()[actorstypes.Version10]: {minertask.BeneficiaryExtractor{}},
},
))
case tasktype.MinerCurrentDeadlineInfo:
Expand All @@ -439,15 +440,16 @@ func MakeProcessors(api tasks.DataSource, indexerTasks []string) (*IndexerProces
case tasktype.MinerPreCommitInfo:
out.ActorProcessors[t] = actorstate.NewTask(api, actorstate.NewCustomTypedActorExtractorMap(
map[cid.Cid][]actorstate.ActorStateExtractor{
mineractors.VersionCodes()[actorstypes.Version0]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version2]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version3]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version4]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version5]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version6]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version7]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version8]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version9]: {minertask.PreCommitInfoExtractorV9{}},
mineractors.VersionCodes()[actorstypes.Version0]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version2]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version3]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version4]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version5]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version6]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version7]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version8]: {minertask.PreCommitInfoExtractorV8{}},
mineractors.VersionCodes()[actorstypes.Version9]: {minertask.PreCommitInfoExtractorV9{}},
mineractors.VersionCodes()[actorstypes.Version10]: {minertask.PreCommitInfoExtractorV9{}},
},
))
case tasktype.MinerSectorDeal:
Expand Down Expand Up @@ -476,9 +478,10 @@ func MakeProcessors(api tasks.DataSource, indexerTasks []string) (*IndexerProces
case tasktype.MinerSectorInfoV7:
out.ActorProcessors[t] = actorstate.NewTask(api, actorstate.NewCustomTypedActorExtractorMap(
map[cid.Cid][]actorstate.ActorStateExtractor{
mineractors.VersionCodes()[actorstypes.Version7]: {minertask.V7SectorInfoExtractor{}},
mineractors.VersionCodes()[actorstypes.Version8]: {minertask.V7SectorInfoExtractor{}},
mineractors.VersionCodes()[actorstypes.Version9]: {minertask.V7SectorInfoExtractor{}},
mineractors.VersionCodes()[actorstypes.Version7]: {minertask.V7SectorInfoExtractor{}},
mineractors.VersionCodes()[actorstypes.Version8]: {minertask.V7SectorInfoExtractor{}},
mineractors.VersionCodes()[actorstypes.Version9]: {minertask.V7SectorInfoExtractor{}},
mineractors.VersionCodes()[actorstypes.Version10]: {minertask.V7SectorInfoExtractor{}},
},
))

Expand Down Expand Up @@ -562,7 +565,8 @@ func MakeProcessors(api tasks.DataSource, indexerTasks []string) (*IndexerProces
case tasktype.VerifiedRegistryClaim:
out.ActorProcessors[t] = actorstate.NewTask(api, actorstate.NewCustomTypedActorExtractorMap(
map[cid.Cid][]actorstate.ActorStateExtractor{
verifregactors.VersionCodes()[actorstypes.Version9]: {verifregtask.ClaimExtractor{}},
verifregactors.VersionCodes()[actorstypes.Version9]: {verifregtask.ClaimExtractor{}},
verifregactors.VersionCodes()[actorstypes.Version10]: {verifregtask.ClaimExtractor{}},
},
))

Expand Down
29 changes: 16 additions & 13 deletions chain/indexer/integrated/processor/state_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ func TestNewProcessor(t *testing.T) {
)), proc.actorProcessors[tasktype.MinerSectorInfoV1_6])
require.Equal(t, actorstate.NewTask(nil, actorstate.NewCustomTypedActorExtractorMap(
map[cid.Cid][]actorstate.ActorStateExtractor{
miner.VersionCodes()[actorstypes.Version7]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version8]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version9]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version7]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version8]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version9]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version10]: {minertask.V7SectorInfoExtractor{}},
},
)), proc.actorProcessors[tasktype.MinerSectorInfoV7])
require.Equal(t, actorstate.NewTask(nil, actorstate.NewTypedActorExtractorMap(power.AllCodes(), powertask.ClaimedPowerExtractor{})), proc.actorProcessors[tasktype.PowerActorClaim])
Expand All @@ -112,15 +113,16 @@ func TestNewProcessor(t *testing.T) {

require.Equal(t, actorstate.NewTask(nil, actorstate.NewCustomTypedActorExtractorMap(
map[cid.Cid][]actorstate.ActorStateExtractor{
miner.VersionCodes()[actorstypes.Version0]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version2]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version3]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version4]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version5]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version6]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version7]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version8]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version9]: {minertask.PreCommitInfoExtractorV9{}},
miner.VersionCodes()[actorstypes.Version0]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version2]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version3]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version4]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version5]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version6]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version7]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version8]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version9]: {minertask.PreCommitInfoExtractorV9{}},
miner.VersionCodes()[actorstypes.Version10]: {minertask.PreCommitInfoExtractorV9{}},
},
)), proc.actorProcessors[tasktype.MinerPreCommitInfo])

Expand All @@ -141,7 +143,8 @@ func TestNewProcessor(t *testing.T) {

require.Equal(t, actorstate.NewTask(nil, actorstate.NewCustomTypedActorExtractorMap(
map[cid.Cid][]actorstate.ActorStateExtractor{
verifreg.VersionCodes()[actorstypes.Version9]: {verifregtask.ClaimExtractor{}},
verifreg.VersionCodes()[actorstypes.Version9]: {verifregtask.ClaimExtractor{}},
verifreg.VersionCodes()[actorstypes.Version10]: {verifregtask.ClaimExtractor{}},
},
)), proc.actorProcessors[tasktype.VerifiedRegistryClaim])

Expand Down
29 changes: 16 additions & 13 deletions chain/indexer/integrated/processor/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,16 @@ func TestMakeProcessorsActors(t *testing.T) {
taskName: tasktype.MinerPreCommitInfo,
extractor: actorstate.NewCustomTypedActorExtractorMap(
map[cid.Cid][]actorstate.ActorStateExtractor{
miner.VersionCodes()[actorstypes.Version0]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version2]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version3]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version4]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version5]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version6]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version7]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version8]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version9]: {minertask.PreCommitInfoExtractorV9{}},
miner.VersionCodes()[actorstypes.Version0]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version2]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version3]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version4]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version5]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version6]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version7]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version8]: {minertask.PreCommitInfoExtractorV8{}},
miner.VersionCodes()[actorstypes.Version9]: {minertask.PreCommitInfoExtractorV9{}},
miner.VersionCodes()[actorstypes.Version10]: {minertask.PreCommitInfoExtractorV9{}},
},
),
},
Expand Down Expand Up @@ -111,9 +112,10 @@ func TestMakeProcessorsActors(t *testing.T) {
taskName: tasktype.MinerSectorInfoV7,
extractor: actorstate.NewCustomTypedActorExtractorMap(
map[cid.Cid][]actorstate.ActorStateExtractor{
miner.VersionCodes()[actorstypes.Version7]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version8]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version9]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version7]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version8]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version9]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version10]: {minertask.V7SectorInfoExtractor{}},
},
),
},
Expand Down Expand Up @@ -264,7 +266,8 @@ func TestMakeProcessorsActors(t *testing.T) {
taskName: tasktype.VerifiedRegistryClaim,
extractor: actorstate.NewCustomTypedActorExtractorMap(
map[cid.Cid][]actorstate.ActorStateExtractor{
verifreg.AllCodes()[actorstypes.Version8]: {verifregtask.ClaimExtractor{}},
verifreg.VersionCodes()[actorstypes.Version9]: {verifregtask.ClaimExtractor{}},
verifreg.VersionCodes()[actorstypes.Version10]: {verifregtask.ClaimExtractor{}},
}),
},
}
Expand Down

0 comments on commit 120d439

Please sign in to comment.