forked from informalsystems/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support custom extension options when building tx
Closes: informalsystems#2566
- Loading branch information
Showing
8 changed files
with
83 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use ibc_proto::google::protobuf::Any; | ||
use prost::Message; | ||
use serde_derive::{Deserialize, Serialize}; | ||
|
||
use crate::error::Error; | ||
|
||
// ExtensionOptionDynamicFeeTx is an extension option used with ethermint dynamic fee tx. | ||
// protobuf message: https://github.com/evmos/ethermint/blob/main/proto/ethermint/types/v1/dynamic_fee.proto | ||
#[derive(Clone, PartialEq, Message, Serialize, Deserialize)] | ||
#[serde(transparent)] | ||
pub struct ExtensionOptionDynamicFeeTx { | ||
#[prost(string, tag = "1")] | ||
pub max_priority_price: ::prost::alloc::string::String, | ||
} | ||
|
||
impl ExtensionOptionDynamicFeeTx { | ||
pub fn to_any(&self) -> Result<Any, Error> { | ||
let mut buf = Vec::new(); | ||
Message::encode(self, &mut buf) | ||
.map_err(|e| Error::protobuf_encode("ExtensionOptionDynamicFeeTx".into(), e))?; | ||
Ok(Any { | ||
type_url: "/ethermint.types.v1.ExtensionOptionDynamicFeeTx".to_string(), | ||
value: buf, | ||
}) | ||
} | ||
} |
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