This repository has been archived by the owner on Jun 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cosmos-stdtx: JSON serializers for computing/signing StdSignMsg
- Loading branch information
1 parent
1dc247f
commit be27fdf
Showing
14 changed files
with
286 additions
and
62 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,43 @@ | ||
//! Message fields | ||
use super::{Tag, Value}; | ||
use crate::type_name::TypeName; | ||
|
||
/// Message fields | ||
#[derive(Clone, Debug)] | ||
pub struct Field { | ||
/// Field number to use as the key in an Amino message. | ||
tag: Tag, | ||
|
||
/// Name of this field | ||
name: TypeName, | ||
|
||
/// Amino type to serialize this field as | ||
value: Value, | ||
} | ||
|
||
impl Field { | ||
/// Create a new message field | ||
pub fn new(tag: Tag, name: TypeName, value: impl Into<Value>) -> Self { | ||
Self { | ||
tag, | ||
name, | ||
value: value.into(), | ||
} | ||
} | ||
|
||
/// Get this field's [`Tag`] | ||
pub fn tag(&self) -> Tag { | ||
self.tag | ||
} | ||
|
||
/// Get this field's [`TypeName`] | ||
pub fn name(&self) -> &TypeName { | ||
&self.name | ||
} | ||
|
||
/// Get this field's [`Value`] | ||
pub fn value(&self) -> &Value { | ||
&self.value | ||
} | ||
} |
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.