exposed missing gateway commands in nym-cli

This commit is contained in:
Jędrzej Stuczyński
2023-04-18 16:28:13 +01:00
parent 7c65d61d91
commit 9549bed8bb
5 changed files with 39 additions and 5 deletions
Generated
+2 -2
View File
@@ -4202,7 +4202,7 @@ dependencies = [
[[package]]
name = "nym-vesting-contract"
version = "1.3.0"
version = "1.3.1"
dependencies = [
"cosmwasm-derive",
"cosmwasm-std",
@@ -4220,7 +4220,7 @@ dependencies = [
[[package]]
name = "nym-vesting-contract-common"
version = "0.4.0"
version = "0.5.0"
dependencies = [
"cosmwasm-std",
"nym-contracts-common",
@@ -26,7 +26,7 @@ pub struct Args {
pub version: Option<String>,
}
pub async fn vesting_update_config(client: SigningClient, args: Args) {
pub async fn vesting_update_config(args: Args, client: SigningClient) {
info!("Update vesting gateway config!");
let current_details = match client
@@ -45,7 +45,9 @@ pub struct Args {
pub force: bool,
}
pub async fn vesting_bond_gateway(client: SigningClient, args: Args, denom: &str) {
pub async fn vesting_bond_gateway(args: Args, client: SigningClient) {
let denom = client.current_chain_details().mix_denom.base.as_str();
info!("Starting vesting gateway bonding!");
// if we're trying to bond less than 1 token
@@ -4,6 +4,8 @@
use nym_cli_commands::context::{create_signing_client, ClientArgs};
use nym_network_defaults::NymNetworkDetails;
pub(crate) mod settings;
pub(crate) async fn execute(
global_args: ClientArgs,
gateway: nym_cli_commands::validator::mixnet::operators::gateway::MixnetOperatorsGateway,
@@ -19,7 +21,16 @@ pub(crate) async fn execute(
nym_cli_commands::validator::mixnet::operators::gateway::MixnetOperatorsGatewayCommands::CreateGatewayBondingSignPayload(args) => {
nym_cli_commands::validator::mixnet::operators::gateway::gateway_bonding_sign_payload::create_payload(args,create_signing_client(global_args, network_details)?).await
}
_ => unreachable!(),
nym_cli_commands::validator::mixnet::operators::gateway::MixnetOperatorsGatewayCommands::Settings(settings) => {
settings::execute(global_args, settings, network_details).await?
}
nym_cli_commands::validator::mixnet::operators::gateway::MixnetOperatorsGatewayCommands::VestingBond(args) => {
nym_cli_commands::validator::mixnet::operators::gateway::vesting_bond_gateway::vesting_bond_gateway(args, create_signing_client(global_args, network_details)?).await
}
nym_cli_commands::validator::mixnet::operators::gateway::MixnetOperatorsGatewayCommands::VestingUnbond(_args) => {
nym_cli_commands::validator::mixnet::operators::gateway::vesting_unbond_gateway::vesting_unbond_gateway(create_signing_client(global_args, network_details)?).await
}
}
Ok(())
}
@@ -0,0 +1,21 @@
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use nym_cli_commands::context::{create_signing_client, ClientArgs};
use nym_network_defaults::NymNetworkDetails;
pub(crate) async fn execute(
global_args: ClientArgs,
settings: nym_cli_commands::validator::mixnet::operators::gateway::settings::MixnetOperatorsGatewaySettings,
network_details: &NymNetworkDetails,
) -> anyhow::Result<()> {
match settings.command {
nym_cli_commands::validator::mixnet::operators::gateway::settings::MixnetOperatorsGatewaySettingsCommands::UpdateConfig(args) => {
nym_cli_commands::validator::mixnet::operators::gateway::settings::update_config::update_config(args, create_signing_client(global_args, network_details)?).await
}
nym_cli_commands::validator::mixnet::operators::gateway::settings::MixnetOperatorsGatewaySettingsCommands::VestingUpdateConfig(args) => {
nym_cli_commands::validator::mixnet::operators::gateway::settings::vesting_update_config::vesting_update_config(args, create_signing_client(global_args, network_details)?).await
}
}
Ok(())
}