From 5ff8b7f8d4a297c5e83ab80287845bdf6941fa8f Mon Sep 17 00:00:00 2001 From: "terry.hung" Date: Wed, 13 Dec 2023 11:22:09 +0800 Subject: [PATCH] fix: Add new actor version for tasks (#1277) * Add new actor version for tasks * fix the unit test * Add more unit test for different version --- chain/indexer/integrated/processor/state.go | 4 ++++ chain/indexer/integrated/processor/state_internal_test.go | 3 +++ chain/indexer/integrated/processor/state_test.go | 3 +++ 3 files changed, 10 insertions(+) diff --git a/chain/indexer/integrated/processor/state.go b/chain/indexer/integrated/processor/state.go index 9ca50604..44799797 100644 --- a/chain/indexer/integrated/processor/state.go +++ b/chain/indexer/integrated/processor/state.go @@ -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: @@ -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{}, @@ -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{}, @@ -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{}}, }, )) diff --git a/chain/indexer/integrated/processor/state_internal_test.go b/chain/indexer/integrated/processor/state_internal_test.go index 873de0d9..37b6e3c9 100644 --- a/chain/indexer/integrated/processor/state_internal_test.go +++ b/chain/indexer/integrated/processor/state_internal_test.go @@ -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{}, ), @@ -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{}, @@ -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]) diff --git a/chain/indexer/integrated/processor/state_test.go b/chain/indexer/integrated/processor/state_test.go index 4d57e5d8..160d9bde 100644 --- a/chain/indexer/integrated/processor/state_test.go +++ b/chain/indexer/integrated/processor/state_test.go @@ -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{}, @@ -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{}, @@ -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{}}, }), }, }