-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release sync mode type. no functional changes. (#12794)
- Loading branch information
1 parent
4deb016
commit 2af372d
Showing
11 changed files
with
79 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package stages | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
type Mode int8 // in which staged sync can run | ||
|
||
const ( | ||
ModeUnknown Mode = iota | ||
ModeBlockProduction | ||
ModeForkValidation | ||
ModeApplyingBlocks | ||
) | ||
|
||
func (m Mode) String() string { | ||
switch m { | ||
case ModeBlockProduction: | ||
return "ModeBlockProduction" | ||
case ModeForkValidation: | ||
return "ModeForkValidation" | ||
case ModeApplyingBlocks: | ||
return "ModeApplyingBlocks" | ||
default: | ||
return "UnknownMode" | ||
} | ||
} | ||
|
||
func ModeFromString(s string) Mode { //nolint | ||
switch s { | ||
case "ModeBlockProduction": | ||
return ModeBlockProduction | ||
case "ModeForkValidation": | ||
return ModeForkValidation | ||
case "ModeApplyingBlocks": | ||
return ModeApplyingBlocks | ||
case "UnknownMode": | ||
return ModeUnknown | ||
default: | ||
panic(fmt.Sprintf("unexpected mode string: %s", s)) | ||
} | ||
} |
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