-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(registry): Add node_reward_type to NodeRecord (#1608)
This adds support for node_reward_type to NodeRecord and to AddNodePayload. It adds it as a string to AddNodePayload, but as an enum with validation to NodeRecord.
- Loading branch information
1 parent
0501f7b
commit 9fc5ab4
Showing
15 changed files
with
257 additions
and
74 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 |
---|---|---|
@@ -1,3 +1,21 @@ | ||
use crate::registry::node::v1::NodeRewardType; | ||
|
||
#[allow(clippy::all)] | ||
#[path = "../gen/registry/registry.node.v1.rs"] | ||
pub mod v1; | ||
|
||
impl From<NodeRewardType> for String { | ||
fn from(value: NodeRewardType) -> Self { | ||
match value { | ||
NodeRewardType::Unspecified => { | ||
panic!("Cannot create a node type string from unspecified") | ||
} | ||
NodeRewardType::Type0 => "type0".to_string(), | ||
NodeRewardType::Type1 => "type1".to_string(), | ||
NodeRewardType::Type2 => "type2".to_string(), | ||
NodeRewardType::Type3 => "type3".to_string(), | ||
NodeRewardType::Type3dot1 => "type3.1".to_string(), | ||
NodeRewardType::Type1dot1 => "type1.1".to_string(), | ||
} | ||
} | ||
} |
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
Oops, something went wrong.