-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4716 from nymtech/feature/vesting-purge-plus-rang…
…ed-cost-params Feature/vesting purge plus ranged cost params
- Loading branch information
Showing
104 changed files
with
2,256 additions
and
3,677 deletions.
There are no files selected for viewing
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
42 changes: 42 additions & 0 deletions
42
common/commands/src/validator/mixnet/delegators/migrate_vested_delegation.rs
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,42 @@ | ||
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net> | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use crate::context::SigningClient; | ||
use clap::Parser; | ||
use log::info; | ||
use nym_mixnet_contract_common::MixId; | ||
use nym_validator_client::nyxd::contract_traits::{MixnetQueryClient, MixnetSigningClient}; | ||
|
||
#[derive(Debug, Parser)] | ||
pub struct Args { | ||
#[clap(long)] | ||
pub mix_id: Option<MixId>, | ||
|
||
#[clap(long)] | ||
pub identity_key: Option<String>, | ||
} | ||
|
||
pub async fn migrate_vested_delegation(args: Args, client: SigningClient) { | ||
let mix_id = match args.mix_id { | ||
Some(mix_id) => mix_id, | ||
None => { | ||
let identity_key = args | ||
.identity_key | ||
.expect("either mix_id or mix_identity has to be specified"); | ||
let node_details = client | ||
.get_mixnode_details_by_identity(identity_key) | ||
.await | ||
.expect("contract query failed") | ||
.mixnode_details | ||
.expect("mixnode with the specified identity doesnt exist"); | ||
node_details.mix_id() | ||
} | ||
}; | ||
|
||
let res = client | ||
.migrate_vested_delegation(mix_id, None) | ||
.await | ||
.expect("failed to migrate delegation!"); | ||
|
||
info!("migration result: {:?}", res) | ||
} |
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
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
Oops, something went wrong.