From d77d7366584f3e9595d559489162f7ed12d3dfc7 Mon Sep 17 00:00:00 2001 From: Liam Monninger Date: Mon, 2 Oct 2023 13:10:38 -0700 Subject: [PATCH 1/2] [CLI] init fix. --- m1/.movement/config.yaml | 8 ++++++++ m1/movement/src/common/init.rs | 10 +++++----- 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 m1/.movement/config.yaml diff --git a/m1/.movement/config.yaml b/m1/.movement/config.yaml new file mode 100644 index 00000000..432301b5 --- /dev/null +++ b/m1/.movement/config.yaml @@ -0,0 +1,8 @@ +--- +profiles: + default: + private_key: "0x91dafb168a68dfebcf7bf207a0d672470c15d40cf94e4fdd9ccbee52b9b962dd" + public_key: "0x91d05880a0a978a67e0d16d7e08dc406a098805d1b77efe7f6f9b03d443eef39" + account: 4fb29c02b82140fa57e8da381d971e63aa09fb4fab193d9c60a3aed3659c6bdc + rest_url: "https://seed-node1.movementlabs.xyz" + faucet_url: "https://seed-node1.movementlabs.xyz" diff --git a/m1/movement/src/common/init.rs b/m1/movement/src/common/init.rs index c68ae64d..9cd60c4b 100644 --- a/m1/movement/src/common/init.rs +++ b/m1/movement/src/common/init.rs @@ -9,7 +9,7 @@ use crate::{ ConfigSearchMode, EncodingOptions, PrivateKeyInputOptions, ProfileConfig, ProfileOptions, PromptOptions, RngArgs, DEFAULT_PROFILE, }, - utils::{fund_account, prompt_yes_with_override, read_line, wait_for_transactions}, + utils::{fund_account, fund_pub_key, prompt_yes_with_override, read_line, wait_for_transactions}, }, }; use aptos_crypto::{ed25519::Ed25519PrivateKey, PrivateKey, ValidCryptoMaterialStringExt}; @@ -179,7 +179,7 @@ impl CliCommand<()> for InitTool { let address = lookup_address(&client, derived_address, false).await?; profile_config.private_key = Some(private_key); - profile_config.public_key = Some(public_key); + profile_config.public_key = Some(public_key.clone()); profile_config.account = Some(address); // Create account if it doesn't exist (and there's a faucet) @@ -229,11 +229,11 @@ impl CliCommand<()> for InitTool { "Account {} doesn't exist, creating it and funding it with {} Octas", address, NUM_DEFAULT_OCTAS ); - let hashes = fund_account( + let hashes = fund_pub_key( Url::parse(faucet_url) .map_err(|err| CliError::UnableToParse("rest_url", err.to_string()))?, - NUM_DEFAULT_OCTAS, - address, + // NUM_DEFAULT_OCTAS, + (public_key.clone()).to_string(), ) .await?; wait_for_transactions(&client, hashes).await?; From d0253c9cd04586f2c2258afc7445c31dd8cfd977 Mon Sep 17 00:00:00 2001 From: Liam Monninger Date: Mon, 2 Oct 2023 13:11:43 -0700 Subject: [PATCH 2/2] [ORG] cleaning account. --- m1/.movement/config.yaml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 m1/.movement/config.yaml diff --git a/m1/.movement/config.yaml b/m1/.movement/config.yaml deleted file mode 100644 index 432301b5..00000000 --- a/m1/.movement/config.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -profiles: - default: - private_key: "0x91dafb168a68dfebcf7bf207a0d672470c15d40cf94e4fdd9ccbee52b9b962dd" - public_key: "0x91d05880a0a978a67e0d16d7e08dc406a098805d1b77efe7f6f9b03d443eef39" - account: 4fb29c02b82140fa57e8da381d971e63aa09fb4fab193d9c60a3aed3659c6bdc - rest_url: "https://seed-node1.movementlabs.xyz" - faucet_url: "https://seed-node1.movementlabs.xyz"