Skip to content

Commit

Permalink
Create builder and use it in service builder
Browse files Browse the repository at this point in the history
  • Loading branch information
maximopalopoli committed Feb 19, 2025
1 parent d41b3d9 commit 387e947
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions services/bls_aggregation/blsagg.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,18 @@ type BlsAggregatorBuilder struct {
hashFunction types.TaskResponseHashFunction
}

func NewBlsAggregatorBuilder(
avsRegistryService avsregistry.AvsRegistryService,
hashFunction types.TaskResponseHashFunction,
logger logging.Logger,
) *BlsAggregatorBuilder {
return &BlsAggregatorBuilder{
avsRegistryService: avsRegistryService,
logger: logger,
hashFunction: hashFunction,
}
}

// NewBlsAggregatorService creates a new BlsAggregatorService
// avsRegistryService is the AVS registry service to use
// hashFunction is the hash function to use to compute the taskResponseDigest from the taskResponse
Expand All @@ -244,11 +256,7 @@ func NewBlsAggregatorService(
logger logging.Logger,
) *BlsAggregatorService {
// Instantiate builder and save handler and receiver.
builder := BlsAggregatorBuilder{
avsRegistryService: avsRegistryService,
logger: logger,
hashFunction: hashFunction,
}
builder := NewBlsAggregatorBuilder(avsRegistryService, hashFunction, logger)

handler, receiver := builder.Start()

Expand Down

0 comments on commit 387e947

Please sign in to comment.