From 0d73b2d1d41f5005031f9427bc1f2e9248423e65 Mon Sep 17 00:00:00 2001 From: nick Date: Sat, 24 Aug 2024 21:11:48 +0900 Subject: [PATCH] fix: fix typo, rename key func --- node/pkg/aggregator/aggregator_test.go | 2 +- node/pkg/aggregator/globalaggregatebulkwriter.go | 2 +- node/pkg/aggregator/utils.go | 2 +- node/pkg/common/keys/keys.go | 4 ++-- node/pkg/dal/collector/collector.go | 2 +- node/pkg/dal/tests/main_test.go | 2 +- node/pkg/reporter/app_test.go | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/node/pkg/aggregator/aggregator_test.go b/node/pkg/aggregator/aggregator_test.go index 5f5a47ea8..e84121c44 100644 --- a/node/pkg/aggregator/aggregator_test.go +++ b/node/pkg/aggregator/aggregator_test.go @@ -121,7 +121,7 @@ func TestPublishGlobalAggregateAndProof(t *testing.T) { } ch := make(chan SubmissionData) - err = db.Subscribe(ctx, keys.SubmissionDataStreamKeyV2(node.Name), ch) + err = db.Subscribe(ctx, keys.SubmissionDataStreamKey(node.Name), ch) if err != nil { t.Fatal("error subscribing to stream") } diff --git a/node/pkg/aggregator/globalaggregatebulkwriter.go b/node/pkg/aggregator/globalaggregatebulkwriter.go index e318f0e83..e4fcb15f8 100644 --- a/node/pkg/aggregator/globalaggregatebulkwriter.go +++ b/node/pkg/aggregator/globalaggregatebulkwriter.go @@ -108,7 +108,7 @@ func (s *GlobalAggregateBulkWriter) receive(ctx context.Context) { } func (s *GlobalAggregateBulkWriter) receiveEach(ctx context.Context, configName string) { - err := db.Subscribe(ctx, keys.SubmissionDataStreamKeyV2(configName), s.ReceiveChannels[configName]) + err := db.Subscribe(ctx, keys.SubmissionDataStreamKey(configName), s.ReceiveChannels[configName]) if err != nil { log.Error().Err(err).Str("Player", "Aggregator").Msg("failed to subscribe to submission stream") } diff --git a/node/pkg/aggregator/utils.go b/node/pkg/aggregator/utils.go index da1f8fa9a..f9406413d 100644 --- a/node/pkg/aggregator/utils.go +++ b/node/pkg/aggregator/utils.go @@ -26,7 +26,7 @@ func PublishGlobalAggregateAndProof(ctx context.Context, name string, globalAggr GlobalAggregate: globalAggregate, Proof: proof, } - return db.Publish(ctx, keys.SubmissionDataStreamKeyV2(name), data) + return db.Publish(ctx, keys.SubmissionDataStreamKey(name), data) } func getLatestRoundId(ctx context.Context, configId int32) (int32, error) { diff --git a/node/pkg/common/keys/keys.go b/node/pkg/common/keys/keys.go index 1b3287b45..487153e46 100644 --- a/node/pkg/common/keys/keys.go +++ b/node/pkg/common/keys/keys.go @@ -1,5 +1,5 @@ package keys -func SubmissionDataStreamKeyV2(name string) string { - return "submissionDataSteram:" + name +func SubmissionDataStreamKey(name string) string { + return "submissionDataStream:" + name } diff --git a/node/pkg/dal/collector/collector.go b/node/pkg/dal/collector/collector.go index 202a17663..479638847 100644 --- a/node/pkg/dal/collector/collector.go +++ b/node/pkg/dal/collector/collector.go @@ -107,7 +107,7 @@ func NewCollector(ctx context.Context, configs []Config) (*Collector, error) { collector.OutgoingStream[config.ID] = make(chan *dalcommon.OutgoingSubmissionData, 1000) collector.Symbols[config.ID] = config.Name collector.FeedHashes[config.ID] = crypto.Keccak256([]byte(config.Name)) - redisTopics = append(redisTopics, keys.SubmissionDataStreamKeyV2(config.Name)) + redisTopics = append(redisTopics, keys.SubmissionDataStreamKey(config.Name)) } baseRediscribe, err := db.NewRediscribe( diff --git a/node/pkg/dal/tests/main_test.go b/node/pkg/dal/tests/main_test.go index dea876c93..1cece9b87 100644 --- a/node/pkg/dal/tests/main_test.go +++ b/node/pkg/dal/tests/main_test.go @@ -37,7 +37,7 @@ type TestItems struct { } func testPublishData(ctx context.Context, name string, submissionData aggregator.SubmissionData) error { - return db.Publish(ctx, keys.SubmissionDataStreamKeyV2(name), submissionData) + return db.Publish(ctx, keys.SubmissionDataStreamKey(name), submissionData) } func generateSampleSubmissionData(configId int32, value int64, timestamp time.Time, round int32, symbol string) (*aggregator.SubmissionData, error) { diff --git a/node/pkg/reporter/app_test.go b/node/pkg/reporter/app_test.go index 352d0d1c5..7617c67ba 100644 --- a/node/pkg/reporter/app_test.go +++ b/node/pkg/reporter/app_test.go @@ -61,7 +61,7 @@ func TestWsDataHandling(t *testing.T) { t.Fatalf("error generating sample submission data: %v", err) } - err = db.Publish(ctx, keys.SubmissionDataStreamKeyV2("test-aggregate"), sampleSubmissionData) + err = db.Publish(ctx, keys.SubmissionDataStreamKey("test-aggregate"), sampleSubmissionData) if err != nil { t.Fatalf("error publishing sample submission data: %v", err) }