Skip to content

Commit

Permalink
refactor: rename CommitLevel interface
Browse files Browse the repository at this point in the history
  • Loading branch information
paologalligit committed Aug 6, 2024
1 parent cf472e3 commit 07d0cee
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions api/accounts/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ type Accounts struct {
stater *state.Stater
callGasLimit uint64
forkConfig thor.ForkConfig
bft bft.CommitLevel
bft bft.Committer
}

func New(
repo *chain.Repository,
stater *state.Stater,
callGasLimit uint64,
forkConfig thor.ForkConfig,
bft bft.CommitLevel,
bft bft.Committer,
) *Accounts {
return &Accounts{
repo,
Expand Down
2 changes: 1 addition & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func New(
stater *state.Stater,
txPool *txpool.TxPool,
logDB *logdb.LogDB,
bft bft.CommitLevel,
bft bft.Committer,
nw node.Network,
forkConfig thor.ForkConfig,
allowedOrigins string,
Expand Down
4 changes: 2 additions & 2 deletions api/blocks/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (

type Blocks struct {
repo *chain.Repository
bft bft.CommitLevel
bft bft.Committer
}

func New(repo *chain.Repository, bft bft.CommitLevel) *Blocks {
func New(repo *chain.Repository, bft bft.Committer) *Blocks {
return &Blocks{
repo,
bft,
Expand Down
4 changes: 2 additions & 2 deletions api/debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ type Debug struct {
forkConfig thor.ForkConfig
callGasLimit uint64
allowCustomTracer bool
bft bft.CommitLevel
bft bft.Committer
}

func New(repo *chain.Repository, stater *state.Stater, forkConfig thor.ForkConfig, callGaslimit uint64, allowCustomTracer bool, bft bft.CommitLevel) *Debug {
func New(repo *chain.Repository, stater *state.Stater, forkConfig thor.ForkConfig, callGaslimit uint64, allowCustomTracer bool, bft bft.Committer) *Debug {
return &Debug{
repo,
stater,
Expand Down
4 changes: 2 additions & 2 deletions api/utils/revisions.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func ParseRevision(revision string, allowNext bool) (*Revision, error) {

// GetSummary returns the block summary for the given revision,
// revision required to be a deterministic block other than "next".
func GetSummary(rev *Revision, repo *chain.Repository, bft bft.CommitLevel) (sum *chain.BlockSummary, err error) {
func GetSummary(rev *Revision, repo *chain.Repository, bft bft.Committer) (sum *chain.BlockSummary, err error) {
var id thor.Bytes32
switch rev := rev.val.(type) {
case thor.Bytes32:
Expand Down Expand Up @@ -104,7 +104,7 @@ func GetSummary(rev *Revision, repo *chain.Repository, bft bft.CommitLevel) (sum

// GetSummaryAndState returns the block summary and state for the given revision,
// this function supports the "next" revision.
func GetSummaryAndState(rev *Revision, repo *chain.Repository, bft bft.CommitLevel, stater *state.Stater) (*chain.BlockSummary, *state.State, error) {
func GetSummaryAndState(rev *Revision, repo *chain.Repository, bft bft.Committer, stater *state.Stater) (*chain.BlockSummary, *state.State, error) {
if rev.IsNext() {
best := repo.BestBlockSummary()

Expand Down
2 changes: 1 addition & 1 deletion bft/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const dataStoreName = "bft.engine"
var finalizedKey = []byte("finalized")
var justifiedKey = []byte("justified")

type CommitLevel interface {
type Committer interface {
Finalized() thor.Bytes32
Justified() thor.Bytes32
}
Expand Down

0 comments on commit 07d0cee

Please sign in to comment.