Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a --denom option to the tx raw upgrade-chain command to make the deposit denomination configurable #1790

Merged
merged 6 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Added a `denom` member to `upgrade_chain::UpgradePlanOptions`.
([#1662](https://github.com/informalsystems/ibc-rs/issues/1662))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Make the deposit denomination configurable in `tx raw upgrade-chain` via a new `--denom` flag.
([#1662](https://github.com/informalsystems/ibc-rs/issues/1662))
25 changes: 7 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions relayer-cli/src/commands/tx/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ pub struct TxIbcUpgradeChainCmd {
)]
upgrade_name: Option<String>,

#[clap(
short = 'd',
long,
help = "denomination for the deposit (default: 'stake')"
)]
denom: Option<String>,

#[clap(
short = 'l',
long,
Expand Down Expand Up @@ -93,6 +100,7 @@ impl TxIbcUpgradeChainCmd {
src_chain_config: src_chain_config.clone(),
src_client_id: self.src_client_id.clone(),
amount: self.amount,
denom: self.denom.as_deref().unwrap_or("stake").into(),
height_offset: self.height_offset,
upgraded_chain_id: self
.new_chain_id
Expand Down
3 changes: 2 additions & 1 deletion relayer/src/upgrade_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub struct UpgradePlanOptions {
pub dst_chain_config: ChainConfig,
pub src_client_id: ClientId,
pub amount: u64,
pub denom: String,
pub height_offset: u64,
pub upgraded_chain_id: ChainId,
pub upgraded_unbonding_period: Option<Duration>,
Expand Down Expand Up @@ -115,7 +116,7 @@ pub fn build_and_send_ibc_upgrade_proposal(
let proposer = dst_chain.get_signer().map_err(UpgradeChainError::key)?;

let coins = ibc_proto::cosmos::base::v1beta1::Coin {
denom: "stake".to_string(),
denom: opts.denom.clone(),
amount: opts.amount.to_string(),
};

Expand Down