Skip to content

Commit

Permalink
refactor(backend): rename WithLocations to WithLatencies
Browse files Browse the repository at this point in the history
WithLatencies is a more representative name for this option.
  • Loading branch information
meling committed Dec 24, 2024
1 parent 963338a commit 934066a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions backend/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ type backendOptions struct {
// ServerOptions is a function for configuring the Server.
type ServerOptions func(*backendOptions)

// WithLocations sets the locations assigned to the replicas and
// WithLatencies sets the locations assigned to the replicas and
// constructs the corresponding latency matrix.
func WithLocations(id hotstuff.ID, locations []string) ServerOptions {
func WithLatencies(id hotstuff.ID, locations []string) ServerOptions {
return func(opts *backendOptions) {
opts.id = id
opts.latencyMatrix = latency.MatrixFrom(locations)
Expand Down
2 changes: 1 addition & 1 deletion replica/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func New(conf Config, builder modules.Builder) (replica *Replica) {
}

srv.hsSrv = backend.NewServer(
backend.WithLocations(conf.ID, conf.Locations),
backend.WithLatencies(conf.ID, conf.Locations),
backend.WithGorumsServerOptions(replicaSrvOpts...),
)

Expand Down

0 comments on commit 934066a

Please sign in to comment.