Skip to content

Commit

Permalink
fix: burn use private key
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmovses committed Feb 4, 2025
1 parent df63cb6 commit c7a8876
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 25 deletions.
14 changes: 9 additions & 5 deletions networks/movement/movement-full-node/src/admin/ops/burn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,20 @@ impl Burn {
.inner()
.chain_id;

let private_key = SUZUKA_CONFIG
let dot_movement = dot_movement::DotMovement::try_from_env()?;
let config = dot_movement.try_get_config_from_json::<movement_config::Config>()?;

let raw_private_key = config
.execution_config
.maptos_config
.chain
.maptos_private_key
.to_string();
.maptos_private_key_signer_identifier
.try_raw_private_key()?;

let hex_string = hex::encode(raw_private_key.as_slice());

let core_resources_account: LocalAccount =
LocalAccount::from_private_key(&private_key.clone(), 0)?;
LocalAccount::from_private_key(&hex_string.clone(), 0)?;

tracing::info!("Created core resources account");
tracing::debug!("core_resources_account address: {}", core_resources_account.address());
Expand Down Expand Up @@ -138,4 +143,3 @@ impl Burn {
Ok(())
}
}

17 changes: 0 additions & 17 deletions networks/movement/movement-full-node/src/admin/ops/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,6 @@ static SUZUKA_CONFIG: Lazy<movement_config::Config> = Lazy::new(|| {
config
});

static FAUCET_URL: Lazy<Url> = Lazy::new(|| {
let faucet_listen_address = SUZUKA_CONFIG
.execution_config
.maptos_config
.client
.maptos_faucet_rest_connection_hostname
.clone();
let faucet_listen_port = SUZUKA_CONFIG
.execution_config
.maptos_config
.client
.maptos_faucet_rest_connection_port
.clone();
let faucet_listen_url = format!("http://{}:{}", faucet_listen_address, faucet_listen_port);
Url::from_str(faucet_listen_url.as_str()).unwrap()
});

static NODE_URL: Lazy<Url> = Lazy::new(|| {
let node_connection_address = SUZUKA_CONFIG
.execution_config
Expand Down
6 changes: 3 additions & 3 deletions networks/movement/movement-full-node/src/admin/ops/mod.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
pub mod mint;
pub mod burn;
pub mod mint;

use clap::Subcommand;

#[derive(Subcommand, Debug)]
#[clap(rename_all = "kebab-case", about = "Commands for bespoke network operations")]
pub enum Ops {
Mint(mint::Mint),
Burn(burn::Burn),
//Burn(burn::Burn),
}

impl Ops {
pub async fn execute(&self) -> Result<(), anyhow::Error> {
match self {
Ops::Mint(mint) => mint.execute().await,
Ops::Burn(burn) => burn.execute().await,
//Ops::Burn(burn) => burn.execute().await,
}
}
}

0 comments on commit c7a8876

Please sign in to comment.