-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/release-2022-April' into feat-april-with-indexer-v…
…1-2-x # Conflicts: # go.mod # go.sum
- Loading branch information
Showing
59 changed files
with
1,357 additions
and
890 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package disabled | ||
|
||
// processStatusHandler is the disabled implementation for the status handler that keeps track what the node is doing: | ||
// processing blocks or idle | ||
type processStatusHandler struct { | ||
} | ||
|
||
// NewProcessStatusHandler creates a new instance of type processStatusHandler | ||
func NewProcessStatusHandler() *processStatusHandler { | ||
return &processStatusHandler{} | ||
} | ||
|
||
// SetBusy does nothing | ||
func (psh *processStatusHandler) SetBusy(_ string) {} | ||
|
||
// SetIdle does nothing | ||
func (psh *processStatusHandler) SetIdle() {} | ||
|
||
// IsIdle returns true | ||
func (psh *processStatusHandler) IsIdle() bool { | ||
return true | ||
} | ||
|
||
// IsInterfaceNil returns true if there is no value under the interface | ||
func (psh *processStatusHandler) IsInterfaceNil() bool { | ||
return psh == nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package disabled | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/ElrondNetwork/elrond-go-core/core/check" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestProcessStatusHandler_MethodsShouldNotPanic(t *testing.T) { | ||
t.Parallel() | ||
|
||
defer func() { | ||
r := recover() | ||
if r != nil { | ||
assert.Fail(t, fmt.Sprintf("should have not panicked: %v", r)) | ||
} | ||
}() | ||
|
||
psh := NewProcessStatusHandler() | ||
assert.False(t, check.IfNil(psh)) | ||
psh.SetBusy("") | ||
psh.SetIdle() | ||
assert.True(t, psh.IsIdle()) | ||
} |
Oops, something went wrong.