Skip to content

Commit

Permalink
fix: fix typo, rename key func
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Aug 24, 2024
1 parent e59cbf9 commit 0d73b2d
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion node/pkg/aggregator/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion node/pkg/aggregator/globalaggregatebulkwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion node/pkg/aggregator/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions node/pkg/common/keys/keys.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package keys

func SubmissionDataStreamKeyV2(name string) string {
return "submissionDataSteram:" + name
func SubmissionDataStreamKey(name string) string {
return "submissionDataStream:" + name
}
2 changes: 1 addition & 1 deletion node/pkg/dal/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion node/pkg/dal/tests/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion node/pkg/reporter/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 0d73b2d

Please sign in to comment.