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 (informalsystems#2573)
Closes: informalsystems#2566 * Support custom extension options when building tx * Cargo.lock is outdated * optimize serde encoding * fix clippy and test * Add changelog entry * Fix clippy warnings * Fix compilation * Fix clippy warnings Co-authored-by: Sean Chen <[email protected]> Co-authored-by: Romain Ruetschi <[email protected]>
- Loading branch information
1 parent
738e4b0
commit 8860b33
Showing
9 changed files
with
91 additions
and
3 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
.changelog/unreleased/features/ibc-relayer/2566-extension-options.md
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,2 @@ | ||
- Support custom extension options to be able to specify `max_priority_price` for Ethermint dynamic tx fee | ||
([#2566](https://github.com/informalsystems/ibc-rs/issues/2566)) |
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,25 @@ | ||
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, Eq, Message, Serialize, Deserialize)] | ||
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