Skip to content

Commit

Permalink
fix sovereign flag and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
axenteoctavian committed Dec 2, 2024
1 parent 136d481 commit 2e6072a
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 28 deletions.
2 changes: 1 addition & 1 deletion cmd/proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ VERSION:
}
// sovereign defines a flag that specifies if what run type components should use
sovereign = cli.BoolFlag{
Name: "sovereign-config",
Name: "sovereign",
Usage: "If set to true, will use sovereign run type components",
}

Expand Down
4 changes: 2 additions & 2 deletions process/factory/sovereignTxNotarizationChecker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (
func TestSovereignTxNotarizationChecker(t *testing.T) {
t.Parallel()

tnc := NewTxNotarizationChecker()
tnc := NewSovereignTxNotarizationChecker()
require.False(t, tnc.IsInterfaceNil())
}

func TestSovereignTxNotarizationChecker_IsNotarized(t *testing.T) {
t.Parallel()

tnc := NewTxNotarizationChecker()
tnc := NewSovereignTxNotarizationChecker()
isNotarized := tnc.IsNotarized(transaction.ApiTransactionResult{})
require.True(t, isNotarized)
}
24 changes: 24 additions & 0 deletions process/mock/txNotarizationCheckerMock.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package mock

import (
"github.com/multiversx/mx-chain-core-go/data/transaction"
)

// TxNotarizationCheckerMock -
type TxNotarizationCheckerMock struct {
IsNotarizedCalled func(tx transaction.ApiTransactionResult) bool
}

// IsNotarized -
func (tnc *TxNotarizationCheckerMock) IsNotarized(tx transaction.ApiTransactionResult) bool {
if tnc.IsNotarizedCalled != nil {
return tnc.IsNotarizedCalled(tx)
}

return false
}

// IsInterfaceNil -
func (tnc *TxNotarizationCheckerMock) IsInterfaceNil() bool {
return tnc == nil
}
Loading

0 comments on commit 2e6072a

Please sign in to comment.