Skip to content

Commit 9549bed

Browse files
committed
exposed missing gateway commands in nym-cli
1 parent 7c65d61 commit 9549bed

File tree

5 files changed

+39
-5
lines changed

5 files changed

+39
-5
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/commands/src/validator/mixnet/operators/gateway/settings/vesting_update_config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct Args {
2626
pub version: Option<String>,
2727
}
2828

29-
pub async fn vesting_update_config(client: SigningClient, args: Args) {
29+
pub async fn vesting_update_config(args: Args, client: SigningClient) {
3030
info!("Update vesting gateway config!");
3131

3232
let current_details = match client

common/commands/src/validator/mixnet/operators/gateway/vesting_bond_gateway.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ pub struct Args {
4545
pub force: bool,
4646
}
4747

48-
pub async fn vesting_bond_gateway(client: SigningClient, args: Args, denom: &str) {
48+
pub async fn vesting_bond_gateway(args: Args, client: SigningClient) {
49+
let denom = client.current_chain_details().mix_denom.base.as_str();
50+
4951
info!("Starting vesting gateway bonding!");
5052

5153
// if we're trying to bond less than 1 token

tools/nym-cli/src/validator/mixnet/operators/gateways/mod.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
use nym_cli_commands::context::{create_signing_client, ClientArgs};
55
use nym_network_defaults::NymNetworkDetails;
66

7+
pub(crate) mod settings;
8+
79
pub(crate) async fn execute(
810
global_args: ClientArgs,
911
gateway: nym_cli_commands::validator::mixnet::operators::gateway::MixnetOperatorsGateway,
@@ -19,7 +21,16 @@ pub(crate) async fn execute(
1921
nym_cli_commands::validator::mixnet::operators::gateway::MixnetOperatorsGatewayCommands::CreateGatewayBondingSignPayload(args) => {
2022
nym_cli_commands::validator::mixnet::operators::gateway::gateway_bonding_sign_payload::create_payload(args,create_signing_client(global_args, network_details)?).await
2123
}
22-
_ => unreachable!(),
24+
nym_cli_commands::validator::mixnet::operators::gateway::MixnetOperatorsGatewayCommands::Settings(settings) => {
25+
settings::execute(global_args, settings, network_details).await?
26+
}
27+
nym_cli_commands::validator::mixnet::operators::gateway::MixnetOperatorsGatewayCommands::VestingBond(args) => {
28+
nym_cli_commands::validator::mixnet::operators::gateway::vesting_bond_gateway::vesting_bond_gateway(args, create_signing_client(global_args, network_details)?).await
29+
}
30+
nym_cli_commands::validator::mixnet::operators::gateway::MixnetOperatorsGatewayCommands::VestingUnbond(_args) => {
31+
nym_cli_commands::validator::mixnet::operators::gateway::vesting_unbond_gateway::vesting_unbond_gateway(create_signing_client(global_args, network_details)?).await
32+
33+
}
2334
}
2435
Ok(())
2536
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
use nym_cli_commands::context::{create_signing_client, ClientArgs};
5+
use nym_network_defaults::NymNetworkDetails;
6+
7+
pub(crate) async fn execute(
8+
global_args: ClientArgs,
9+
settings: nym_cli_commands::validator::mixnet::operators::gateway::settings::MixnetOperatorsGatewaySettings,
10+
network_details: &NymNetworkDetails,
11+
) -> anyhow::Result<()> {
12+
match settings.command {
13+
nym_cli_commands::validator::mixnet::operators::gateway::settings::MixnetOperatorsGatewaySettingsCommands::UpdateConfig(args) => {
14+
nym_cli_commands::validator::mixnet::operators::gateway::settings::update_config::update_config(args, create_signing_client(global_args, network_details)?).await
15+
}
16+
nym_cli_commands::validator::mixnet::operators::gateway::settings::MixnetOperatorsGatewaySettingsCommands::VestingUpdateConfig(args) => {
17+
nym_cli_commands::validator::mixnet::operators::gateway::settings::vesting_update_config::vesting_update_config(args, create_signing_client(global_args, network_details)?).await
18+
}
19+
}
20+
Ok(())
21+
}

0 commit comments

Comments
 (0)