Skip to content

Commit

Permalink
Fix: fixed some random stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
hmoog committed Apr 10, 2022
1 parent f8f8194 commit d84c7fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 225 deletions.
8 changes: 4 additions & 4 deletions packages/consensus/finality/finality_gadget.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ import (
"github.com/iotaledger/hive.go/types"

"github.com/iotaledger/goshimmer/packages/consensus/gof"
"github.com/iotaledger/goshimmer/packages/ledgerstate"
"github.com/iotaledger/goshimmer/packages/ledger/branchdag"
"github.com/iotaledger/goshimmer/packages/markers"
"github.com/iotaledger/goshimmer/packages/tangle"
)

// Gadget is an interface that describes the finality gadget.
type Gadget interface {
HandleMarker(marker *markers.Marker, aw float64) (err error)
HandleBranch(branchID ledgerstate.BranchID, aw float64) (err error)
HandleBranch(branchID branchdag.BranchID, aw float64) (err error)
tangle.ConfirmationOracle
}

// MessageThresholdTranslation is a function which translates approval weight to a gof.GradeOfFinality.
type MessageThresholdTranslation func(aw float64) gof.GradeOfFinality

// BranchThresholdTranslation is a function which translates approval weight to a gof.GradeOfFinality.
type BranchThresholdTranslation func(branchID ledgerstate.BranchID, aw float64) gof.GradeOfFinality
type BranchThresholdTranslation func(branchID branchdag.BranchID, aw float64) gof.GradeOfFinality

const (
lowLowerBound = 0.25
Expand All @@ -36,7 +36,7 @@ const (

var (
// DefaultBranchGoFTranslation is the default function to translate the approval weight to gof.GradeOfFinality of a branch.
DefaultBranchGoFTranslation BranchThresholdTranslation = func(branchID ledgerstate.BranchID, aw float64) gof.GradeOfFinality {
DefaultBranchGoFTranslation BranchThresholdTranslation = func(branchID branchdag.BranchID, aw float64) gof.GradeOfFinality {
switch {
case aw >= lowLowerBound && aw < mediumLowerBound:
return gof.Low
Expand Down
221 changes: 0 additions & 221 deletions packages/ledgerstate/branch_dag_test.go

This file was deleted.

0 comments on commit d84c7fd

Please sign in to comment.