Skip to content

Commit

Permalink
fix: Add new actor version for tasks (#1277)
Browse files Browse the repository at this point in the history
* Add new actor version for tasks

* fix the unit test

* Add more unit test for different version
  • Loading branch information
Terryhung authored Dec 13, 2023
1 parent 485c174 commit 5ff8b7f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions chain/indexer/integrated/processor/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ func MakeProcessors(api tasks.DataSource, indexerTasks []string) (*IndexerProces
mineractors.VersionCodes()[actorstypes.Version9]: {minertask.BeneficiaryExtractor{}},
mineractors.VersionCodes()[actorstypes.Version10]: {minertask.BeneficiaryExtractor{}},
mineractors.VersionCodes()[actorstypes.Version11]: {minertask.BeneficiaryExtractor{}},
mineractors.VersionCodes()[actorstypes.Version12]: {minertask.BeneficiaryExtractor{}},
},
))
case tasktype.MinerCurrentDeadlineInfo:
Expand Down Expand Up @@ -591,6 +592,7 @@ func MakeProcessors(api tasks.DataSource, indexerTasks []string) (*IndexerProces
mineractors.VersionCodes()[actorstypes.Version9]: {minertask.PreCommitInfoExtractorV9{}},
mineractors.VersionCodes()[actorstypes.Version10]: {minertask.PreCommitInfoExtractorV9{}},
mineractors.VersionCodes()[actorstypes.Version11]: {minertask.PreCommitInfoExtractorV9{}},
mineractors.VersionCodes()[actorstypes.Version12]: {minertask.PreCommitInfoExtractorV9{}},
},
),
minertask.PreCommitInfoExtractorV9{},
Expand Down Expand Up @@ -637,6 +639,7 @@ func MakeProcessors(api tasks.DataSource, indexerTasks []string) (*IndexerProces
mineractors.VersionCodes()[actorstypes.Version9]: {minertask.V7SectorInfoExtractor{}},
mineractors.VersionCodes()[actorstypes.Version10]: {minertask.V7SectorInfoExtractor{}},
mineractors.VersionCodes()[actorstypes.Version11]: {minertask.V7SectorInfoExtractor{}},
mineractors.VersionCodes()[actorstypes.Version12]: {minertask.V7SectorInfoExtractor{}},
},
),
minertask.V7SectorInfoExtractor{},
Expand Down Expand Up @@ -725,6 +728,7 @@ func MakeProcessors(api tasks.DataSource, indexerTasks []string) (*IndexerProces
verifregactors.VersionCodes()[actorstypes.Version9]: {verifregtask.ClaimExtractor{}},
verifregactors.VersionCodes()[actorstypes.Version10]: {verifregtask.ClaimExtractor{}},
verifregactors.VersionCodes()[actorstypes.Version11]: {verifregtask.ClaimExtractor{}},
verifregactors.VersionCodes()[actorstypes.Version12]: {verifregtask.ClaimExtractor{}},
},
))

Expand Down
3 changes: 3 additions & 0 deletions chain/indexer/integrated/processor/state_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ func TestNewProcessor(t *testing.T) {
miner.VersionCodes()[actorstypes.Version9]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version10]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version11]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version12]: {minertask.V7SectorInfoExtractor{}},
}),
minertask.V7SectorInfoExtractor{},
),
Expand All @@ -125,6 +126,7 @@ func TestNewProcessor(t *testing.T) {
miner.VersionCodes()[actorstypes.Version9]: {minertask.PreCommitInfoExtractorV9{}},
miner.VersionCodes()[actorstypes.Version10]: {minertask.PreCommitInfoExtractorV9{}},
miner.VersionCodes()[actorstypes.Version11]: {minertask.PreCommitInfoExtractorV9{}},
miner.VersionCodes()[actorstypes.Version12]: {minertask.PreCommitInfoExtractorV9{}},
},
),
minertask.PreCommitInfoExtractorV9{},
Expand All @@ -150,6 +152,7 @@ func TestNewProcessor(t *testing.T) {
verifreg.VersionCodes()[actorstypes.Version9]: {verifregtask.ClaimExtractor{}},
verifreg.VersionCodes()[actorstypes.Version10]: {verifregtask.ClaimExtractor{}},
verifreg.VersionCodes()[actorstypes.Version11]: {verifregtask.ClaimExtractor{}},
verifreg.VersionCodes()[actorstypes.Version12]: {verifregtask.ClaimExtractor{}},
},
)), proc.actorProcessors[tasktype.VerifiedRegistryClaim])

Expand Down
3 changes: 3 additions & 0 deletions chain/indexer/integrated/processor/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func TestMakeProcessorsActors(t *testing.T) {
miner.VersionCodes()[actorstypes.Version9]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version10]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version11]: {minertask.V7SectorInfoExtractor{}},
miner.VersionCodes()[actorstypes.Version12]: {minertask.V7SectorInfoExtractor{}},
},
),
transformer: minertask.V7SectorInfoExtractor{},
Expand Down Expand Up @@ -139,6 +140,7 @@ func TestMakeProcessorsActors(t *testing.T) {
miner.VersionCodes()[actorstypes.Version9]: {minertask.PreCommitInfoExtractorV9{}},
miner.VersionCodes()[actorstypes.Version10]: {minertask.PreCommitInfoExtractorV9{}},
miner.VersionCodes()[actorstypes.Version11]: {minertask.PreCommitInfoExtractorV9{}},
miner.VersionCodes()[actorstypes.Version12]: {minertask.PreCommitInfoExtractorV9{}},
},
),
transformer: minertask.PreCommitInfoExtractorV9{},
Expand Down Expand Up @@ -298,6 +300,7 @@ func TestMakeProcessorsActors(t *testing.T) {
verifreg.VersionCodes()[actorstypes.Version9]: {verifregtask.ClaimExtractor{}},
verifreg.VersionCodes()[actorstypes.Version10]: {verifregtask.ClaimExtractor{}},
verifreg.VersionCodes()[actorstypes.Version11]: {verifregtask.ClaimExtractor{}},
verifreg.VersionCodes()[actorstypes.Version12]: {verifregtask.ClaimExtractor{}},
}),
},
}
Expand Down

0 comments on commit 5ff8b7f

Please sign in to comment.