diff --git a/Cargo.lock b/Cargo.lock index 63750d5057317..44fbcab141a01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1839,7 +1839,7 @@ dependencies = [ "aptos-types", "async-trait", "bcs 0.1.6 (git+https://github.com/movementlabsxyz/bcs.git?rev=bc16d2d39cabafaabd76173dd1b04b2aa170cf0c)", - "bigdecimal", + "bigdecimal 0.3.1", "chrono", "diesel", "diesel_migrations", @@ -1862,7 +1862,7 @@ dependencies = [ "aptos-indexer-grpc-server-framework", "aptos-indexer-grpc-utils", "aptos-metrics-core", - "aptos-moving-average 0.1.0 (git+https://github.com/movementlabsxyz/aptos-indexer-processors?rev=77a36245400250e7d8a854360194288d078681bc)", + "aptos-moving-average", "aptos-protos 1.3.0", "async-trait", "clap 4.5.13", @@ -1889,7 +1889,7 @@ dependencies = [ "aptos-indexer-grpc-server-framework", "aptos-indexer-grpc-utils", "aptos-metrics-core", - "aptos-moving-average 0.1.0 (git+https://github.com/movementlabsxyz/aptos-indexer-processors?rev=77a36245400250e7d8a854360194288d078681bc)", + "aptos-moving-average", "aptos-protos 1.3.0", "aptos-transaction-filter", "async-trait", @@ -1917,7 +1917,7 @@ dependencies = [ "aptos-indexer-grpc-server-framework", "aptos-indexer-grpc-utils", "aptos-metrics-core", - "aptos-moving-average 0.1.0 (git+https://github.com/movementlabsxyz/aptos-indexer-processors?rev=77a36245400250e7d8a854360194288d078681bc)", + "aptos-moving-average", "async-trait", "clap 4.5.13", "futures", @@ -1951,7 +1951,7 @@ dependencies = [ "aptos-mempool", "aptos-mempool-notifications", "aptos-metrics-core", - "aptos-moving-average 0.1.0 (git+https://github.com/movementlabsxyz/aptos-indexer-processors?rev=77a36245400250e7d8a854360194288d078681bc)", + "aptos-moving-average", "aptos-proptest-helpers", "aptos-protos 1.3.0", "aptos-runtimes", @@ -2088,7 +2088,6 @@ dependencies = [ "backoff", "base64 0.13.1", "chrono", - "cloud-storage", "dashmap", "futures", "itertools 0.12.1", @@ -2288,7 +2287,7 @@ dependencies = [ "ed25519-dalek 1.0.1", "hex", "hmac 0.12.1", - "jsonwebtoken 8.3.0", + "jsonwebtoken", "once_cell", "rand 0.7.3", "regex", @@ -2333,7 +2332,7 @@ dependencies = [ "dashmap", "hex", "hyper", - "jsonwebtoken 8.3.0", + "jsonwebtoken", "jwt", "once_cell", "rand 0.7.3", @@ -2598,14 +2597,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "aptos-moving-average" -version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-indexer-processors?branch=mikhail/upstream-bcs#00132c0d205a7a49f54f10842bcdbaabc503dca0" -dependencies = [ - "chrono", -] - [[package]] name = "aptos-moving-average" version = "0.1.0" @@ -3752,7 +3743,7 @@ dependencies = [ "futures", "gcp-bigquery-client", "httpmock", - "jsonwebtoken 8.3.0", + "jsonwebtoken", "once_cell", "prometheus", "rand 0.7.3", @@ -3989,7 +3980,7 @@ dependencies = [ "hashbrown 0.14.3", "hex", "itertools 0.12.1", - "jsonwebtoken 8.3.0", + "jsonwebtoken", "move-binary-format", "move-bytecode-verifier", "move-core-types", @@ -4980,12 +4971,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[package]] -name = "base64" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" - [[package]] name = "base64" version = "0.13.1" @@ -5106,6 +5091,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "bigdecimal" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" +dependencies = [ + "num-bigint 0.4.4", + "num-integer", + "num-traits", + "serde", +] + [[package]] name = "bigdecimal" version = "0.4.2" @@ -5876,30 +5873,6 @@ dependencies = [ "cc", ] -[[package]] -name = "cloud-storage" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7602ac4363f68ac757d6b87dd5d850549a14d37489902ae639c06ecec06ad275" -dependencies = [ - "async-trait", - "base64 0.13.1", - "bytes", - "chrono", - "dotenv", - "futures-util", - "hex", - "jsonwebtoken 7.2.0", - "lazy_static", - "pem 0.8.3", - "percent-encoding", - "reqwest", - "ring 0.16.20", - "serde", - "serde_json", - "tokio", -] - [[package]] name = "codespan" version = "0.11.1" @@ -6750,9 +6723,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.11" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", "serde", @@ -6859,13 +6832,13 @@ version = "2.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "158fe8e2e68695bd615d7e4f3227c0727b151330d3e253b525086c348d055d5e" dependencies = [ - "bigdecimal", + "bigdecimal 0.4.2", "bitflags 2.6.0", "byteorder", "chrono", "diesel_derives", "itoa", - "num-bigint 0.2.6", + "num-bigint 0.4.4", "num-integer", "num-traits", "pq-sys", @@ -7035,12 +7008,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" -[[package]] -name = "dotenv" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" - [[package]] name = "downcast" version = "0.11.0" @@ -7699,7 +7666,7 @@ checksum = "e29e5681dc8556fb9df1409e95eae050e12e8776394313da3546dcb8cf390c73" dependencies = [ "az", "bytemuck", - "half 1.8.2", + "half 2.2.1", "typenum", ] @@ -8217,7 +8184,7 @@ dependencies = [ "google-cloud-metadata", "google-cloud-token", "home", - "jsonwebtoken 8.3.0", + "jsonwebtoken", "reqwest", "serde", "serde_json", @@ -8765,7 +8732,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2 0.5.5", "tokio", "tower-service", "tracing", @@ -9319,20 +9286,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "jsonwebtoken" -version = "7.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afabcc15e437a6484fc4f12d0fd63068fe457bf93f1c148d3d9649c60b103f32" -dependencies = [ - "base64 0.12.3", - "pem 0.8.3", - "ring 0.16.20", - "serde", - "serde_json", - "simple_asn1 0.4.1", -] - [[package]] name = "jsonwebtoken" version = "8.3.0" @@ -9340,11 +9293,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ "base64 0.21.6", - "pem 1.1.1", + "pem", "ring 0.16.20", "serde", "serde_json", - "simple_asn1 0.6.2", + "simple_asn1", ] [[package]] @@ -9427,7 +9380,7 @@ dependencies = [ "jsonpath_lib", "k8s-openapi", "kube-core", - "pem 1.1.1", + "pem", "pin-project", "rustls 0.20.9", "rustls-pemfile 0.2.1", @@ -11313,17 +11266,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-bigint" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-bigint" version = "0.3.3" @@ -11382,6 +11324,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-derive" version = "0.3.3" @@ -11945,17 +11893,6 @@ dependencies = [ "crypto-mac 0.8.0", ] -[[package]] -name = "pem" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd56cbd21fea48d0c440b41cd69c589faacade08c992d9a54e471b79d0fd13eb" -dependencies = [ - "base64 0.13.1", - "once_cell", - "regex", -] - [[package]] name = "pem" version = "1.1.1" @@ -12686,17 +12623,17 @@ dependencies = [ [[package]] name = "processor" version = "1.0.0" -source = "git+https://github.com/movementlabsxyz/aptos-indexer-processors?branch=mikhail/upstream-bcs#00132c0d205a7a49f54f10842bcdbaabc503dca0" +source = "git+https://github.com/movementlabsxyz/aptos-indexer-processors?rev=77a36245400250e7d8a854360194288d078681bc#77a36245400250e7d8a854360194288d078681bc" dependencies = [ "ahash 0.8.11", "allocative", "allocative_derive", "anyhow", - "aptos-moving-average 0.1.0 (git+https://github.com/movementlabsxyz/aptos-indexer-processors?branch=mikhail/upstream-bcs)", + "aptos-moving-average", "aptos-protos 1.3.0 (git+https://github.com/movementlabsxyz/aptos-core?rev=338f9a1bcc06f62ce4a4994f1642b9a61b631ee0)", "async-trait", "bcs 0.1.6 (git+https://github.com/movementlabsxyz/bcs.git?rev=bc16d2d39cabafaabd76173dd1b04b2aa170cf0c)", - "bigdecimal", + "bigdecimal 0.4.2", "bitflags 2.6.0", "canonical_json", "chrono", @@ -14267,7 +14204,7 @@ dependencies = [ [[package]] name = "server-framework" version = "1.0.0" -source = "git+https://github.com/movementlabsxyz/aptos-indexer-processors?branch=mikhail/upstream-bcs#00132c0d205a7a49f54f10842bcdbaabc503dca0" +source = "git+https://github.com/movementlabsxyz/aptos-indexer-processors?rev=77a36245400250e7d8a854360194288d078681bc#77a36245400250e7d8a854360194288d078681bc" dependencies = [ "anyhow", "aptos-system-utils 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core?rev=338f9a1bcc06f62ce4a4994f1642b9a61b631ee0)", @@ -14480,17 +14417,6 @@ dependencies = [ "similar", ] -[[package]] -name = "simple_asn1" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692ca13de57ce0613a363c8c2f1de925adebc81b04c923ac60c5488bb44abe4b" -dependencies = [ - "chrono", - "num-bigint 0.2.6", - "num-traits", -] - [[package]] name = "simple_asn1" version = "0.6.2" @@ -15268,13 +15194,14 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", "itoa", "libc", + "num-conv", "num_threads", "powerfmt", "serde", @@ -15284,16 +15211,17 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" dependencies = [ + "num-conv", "time-core", ] @@ -16228,7 +16156,7 @@ dependencies = [ "errno", "js-sys", "libc", - "rustix 0.37.27", + "rustix 0.38.28", "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", "winapi 0.3.9", diff --git a/Cargo.toml b/Cargo.toml index 8c0c58c45c078..26b6aab25a405 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -487,7 +487,7 @@ bcs = { git = "https://github.com/movementlabsxyz/bcs.git", rev = "bc16d2d39caba better_any = "0.1.1" bellman = { version = "0.13.1", default-features = false } # Bumped down to 0.3 due to https://github.com/diesel-rs/diesel/issues/4477 -bigdecimal = { version = "0.4.0", features = ["serde"] } +bigdecimal = { version = "0.3.0", features = ["serde"] } version-compare = "0.1.1" bitvec = "1.0.1" blake2 = "0.10.4" diff --git a/aptos-move/framework/aptos-framework/doc/aptos_coin.md b/aptos-move/framework/aptos-framework/doc/aptos_coin.md index 3e864fadf869c..a2e9c548a67cb 100644 --- a/aptos-move/framework/aptos-framework/doc/aptos_coin.md +++ b/aptos-move/framework/aptos-framework/doc/aptos_coin.md @@ -396,7 +396,7 @@ Only callable in tests and testnets where the core resources account exists. Create delegated token for the address so the account could claim MintCapability later. -
public entry fun delegate_mint_capability(account: &signer, to: address)
+public entry fun delegate_mint_capability(account: signer, to: address)
@@ -405,11 +405,11 @@ Create delegated token for the address so the account could claim MintCapability
Implementation
-public entry fun delegate_mint_capability(account: &signer, to: address) acquires Delegations {
- system_addresses::assert_aptos_framework(account);
+public entry fun delegate_mint_capability(account: signer, to: address) acquires Delegations {
+ system_addresses::assert_aptos_framework(&account);
let delegations = &mut borrow_global_mut<Delegations>(@aptos_framework).inner;
- if (!exists<Delegations>(signer::address_of(account))) {
- move_to(account, Delegations { inner: vector[] });
+ if (!exists<Delegations>(signer::address_of(&account))) {
+ move_to(&account, Delegations { inner: vector[] });
};
vector::for_each_ref(delegations, |element| {
let element: &DelegatedMintCapability = element;
@@ -633,7 +633,7 @@ Claim the delegated mint capability and destroy the delegated token.
### Function `delegate_mint_capability`
-public entry fun delegate_mint_capability(account: &signer, to: address)
+public entry fun delegate_mint_capability(account: signer, to: address)
diff --git a/aptos-move/framework/aptos-framework/doc/aptos_governance.md b/aptos-move/framework/aptos-framework/doc/aptos_governance.md
index 4daf73a12bded..064d68833fd36 100644
--- a/aptos-move/framework/aptos-framework/doc/aptos_governance.md
+++ b/aptos-move/framework/aptos-framework/doc/aptos_governance.md
@@ -1885,8 +1885,6 @@ Only called in testnet where the core resources account exists and has been gran
public fun get_signer_testnet_only(
core_resources: &signer, signer_address: address): signer acquires GovernanceResponsbility {
system_addresses::assert_core_resource(core_resources);
- // Core resources account only has mint capability in tests/testnets.
- assert!(aptos_coin::has_mint_capability(core_resources), error::unauthenticated(EUNAUTHORIZED));
get_signer(signer_address)
}
diff --git a/aptos-move/framework/aptos-framework/doc/governed_gas_pool.md b/aptos-move/framework/aptos-framework/doc/governed_gas_pool.md
index 10f215c858e16..431246fd1b052 100644
--- a/aptos-move/framework/aptos-framework/doc/governed_gas_pool.md
+++ b/aptos-move/framework/aptos-framework/doc/governed_gas_pool.md
@@ -165,6 +165,11 @@ Initializes the governed gas pool around a resource account creation seed.
) {
system_addresses::assert_aptos_framework(aptos_framework);
+ // return if the governed gas pool has already been initialized
+ if (exists<GovernedGasPool>(signer::address_of(aptos_framework))) {
+ return
+ };
+
// generate a seed to be used to create the resource account hosting the delegation pool
let seed = create_resource_account_seed(delegation_pool_creation_seed);
diff --git a/aptos-move/framework/aptos-framework/doc/primary_fungible_store.md b/aptos-move/framework/aptos-framework/doc/primary_fungible_store.md
index 28b1374e4f850..3427f7836b8a9 100644
--- a/aptos-move/framework/aptos-framework/doc/primary_fungible_store.md
+++ b/aptos-move/framework/aptos-framework/doc/primary_fungible_store.md
@@ -48,7 +48,8 @@ fungible asset to it. This emits an deposit event.
- [Module-level Specification](#module-level-spec)
-use 0x1::dispatchable_fungible_asset;
+use 0x1::account;
+use 0x1::dispatchable_fungible_asset;
use 0x1::fungible_asset;
use 0x1::object;
use 0x1::option;
@@ -558,6 +559,8 @@ Transfer amount
of fungible asset from sender's primary store to re
recipient: address,
amount: u64,
) acquires DeriveRefPod {
+ // Create account if it does not yet exist, otherwise funds may get stuck in new accounts.
+ account::create_account_if_does_not_exist(recipient);
let sender_store = ensure_primary_store_exists(signer::address_of(sender), metadata);
// Check if the sender store object has been burnt or not. If so, unburn it first.
may_be_unburn(sender, sender_store);
diff --git a/crates/aptos-runtimes/src/lib.rs b/crates/aptos-runtimes/src/lib.rs
index 74a16ca7aca1e..dc41821816609 100644
--- a/crates/aptos-runtimes/src/lib.rs
+++ b/crates/aptos-runtimes/src/lib.rs
@@ -13,54 +13,57 @@ const MAX_THREAD_NAME_LENGTH: usize = 12;
/// Returns a tokio runtime with named threads.
/// This is useful for tracking threads when debugging.
pub fn spawn_named_runtime(thread_name: String, num_worker_threads: Option) -> Runtime {
- spawn_named_runtime_with_start_hook(thread_name, num_worker_threads, || {})
+ tokio::runtime::Builder::new_current_thread()
+ .enable_all()
+ .build()
+ .expect("Failed to build dummy runtime")
}
-pub fn spawn_named_runtime_with_start_hook(
- thread_name: String,
- num_worker_threads: Option,
- on_thread_start: F,
-) -> Runtime
-where
- F: Fn() + Send + Sync + 'static,
-{
- const MAX_BLOCKING_THREADS: usize = 64;
+// pub fn spawn_named_runtime_with_start_hook(
+// thread_name: String,
+// num_worker_threads: Option,
+// on_thread_start: F,
+// ) -> Runtime
+// where
+// F: Fn() + Send + Sync + 'static,
+// {
+// const MAX_BLOCKING_THREADS: usize = 64;
- // Verify the given name has an appropriate length
- if thread_name.len() > MAX_THREAD_NAME_LENGTH {
- panic!(
- "The given runtime thread name is too long! Max length: {}, given name: {}",
- MAX_THREAD_NAME_LENGTH, thread_name
- );
- }
+// // Verify the given name has an appropriate length
+// if thread_name.len() > MAX_THREAD_NAME_LENGTH {
+// panic!(
+// "The given runtime thread name is too long! Max length: {}, given name: {}",
+// MAX_THREAD_NAME_LENGTH, thread_name
+// );
+// }
- // Create the runtime builder
- let atomic_id = AtomicUsize::new(0);
- let thread_name_clone = thread_name.clone();
- let mut builder = Builder::new_multi_thread();
- builder
- .thread_name_fn(move || {
- let id = atomic_id.fetch_add(1, Ordering::SeqCst);
- format!("{}-{}", thread_name_clone, id)
- })
- .on_thread_start(on_thread_start)
- .disable_lifo_slot()
- // Limit concurrent blocking tasks from spawn_blocking(), in case, for example, too many
- // Rest API calls overwhelm the node.
- .max_blocking_threads(MAX_BLOCKING_THREADS)
- .enable_all();
- if let Some(num_worker_threads) = num_worker_threads {
- builder.worker_threads(num_worker_threads);
- }
+// // Create the runtime builder
+// let atomic_id = AtomicUsize::new(0);
+// let thread_name_clone = thread_name.clone();
+// let mut builder = Builder::new_multi_thread();
+// builder
+// .thread_name_fn(move || {
+// let id = atomic_id.fetch_add(1, Ordering::SeqCst);
+// format!("{}-{}", thread_name_clone, id)
+// })
+// .on_thread_start(on_thread_start)
+// .disable_lifo_slot()
+// // Limit concurrent blocking tasks from spawn_blocking(), in case, for example, too many
+// // Rest API calls overwhelm the node.
+// .max_blocking_threads(MAX_BLOCKING_THREADS)
+// .enable_all();
+// if let Some(num_worker_threads) = num_worker_threads {
+// builder.worker_threads(num_worker_threads);
+// }
- // Spawn and return the runtime
- builder.build().unwrap_or_else(|error| {
- panic!(
- "Failed to spawn named runtime! Name: {:?}, Error: {:?}",
- thread_name, error
- )
- })
-}
+// // Spawn and return the runtime
+// builder.build().unwrap_or_else(|error| {
+// panic!(
+// "Failed to spawn named runtime! Name: {:?}, Error: {:?}",
+// thread_name, error
+// )
+// })
+// }
/// Returns a rayon threadpool with threads.
/// This is useful for tracking threads when debugging.
diff --git a/crates/aptos/src/common/init.rs b/crates/aptos/src/common/init.rs
index e9459b5f49207..9b52060750a18 100644
--- a/crates/aptos/src/common/init.rs
+++ b/crates/aptos/src/common/init.rs
@@ -113,44 +113,32 @@ impl CliCommand<()> for InitTool {
eprintln!("Configuring for network {:?}", network);
network
} else {
- eprintln!(
- "Choose network from [devnet, testnet, local, custom | defaults to devnet]. For testnet, start over and run movement init --skip-faucet"
- );
+ eprintln!("Choose network from [mainnet, testnet, local, custom]");
let input = read_line("network")?;
let input = input.trim();
if input.is_empty() {
- eprintln!("No network given, using devnet...");
- Network::Devnet
+ eprintln!("No network given, using testnet...");
+ Network::Testnet
} else {
Network::from_str(input)?
}
};
- if network == Network::Testnet && !self.skip_faucet {
- return Err(CliError::CommandArgumentError(format!(
- "For testnet, start over and run movement init --skip-faucet"
- )));
- }
-
// Ensure the config contains the network used
profile_config.network = Some(network);
// Ensure that there is at least a REST URL set for the network
match network {
- // Network::Mainnet => {
- // profile_config.rest_url =
- // Some("https://fullnode.mainnet.aptoslabs.com".to_string());
- // profile_config.faucet_url = None;
- // },
+ Network::Mainnet => {
+ profile_config.rest_url =
+ Some("https://mainnet.movementnetwork.xyz/v1".to_string());
+ profile_config.faucet_url = None;
+ },
Network::Testnet => {
profile_config.rest_url =
- Some("https://aptos.testnet.suzuka.movementlabs.xyz/v1/".to_string());
+ Some("https://testnet.bardock.movementnetwork.xyz/v1".to_string());
profile_config.faucet_url =
- Some("https://faucet.testnet.suzuka.movementlabs.xyz/".to_string());
- },
- Network::Devnet => {
- profile_config.rest_url = Some("https://aptos.devnet.inola.movementlabs.xyz/v1".to_string());
- profile_config.faucet_url = Some("https://faucet.devnet.inola.movementlabs.xyz".to_string());
+ Some("https://faucet.testnet.bardock.movementnetwork.xyz/v1".to_string());
},
Network::Local => {
profile_config.rest_url = Some("http://localhost:8080".to_string());
@@ -334,9 +322,9 @@ impl CliCommand<()> for InitTool {
}
} else if account_exists {
eprintln!("Account {} has been already found onchain", address);
- } /* else if network == Network::Mainnet {
+ } else if network == Network::Mainnet {
eprintln!("Account {} does not exist, you will need to create and fund the account by transferring funds from another account", address);
- } */ else {
+ } else {
eprintln!("Account {} has been initialized locally, but you must transfer coins to it to create the account onchain", address);
}
@@ -448,9 +436,8 @@ impl InitTool {
/// Any command using this, will be simpler to setup as profiles
#[derive(Copy, Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
pub enum Network {
- // Mainnet,
+ Mainnet,
Testnet,
- Devnet,
Local,
Custom,
}
@@ -458,9 +445,8 @@ pub enum Network {
impl Display for Network {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", match self {
- // Network::Mainnet => "mainnet",
+ Network::Mainnet => "mainnet",
Network::Testnet => "testnet",
- Network::Devnet => "devnet",
Network::Local => "local",
Network::Custom => "custom",
})
@@ -472,14 +458,13 @@ impl FromStr for Network {
fn from_str(s: &str) -> Result {
Ok(match s.to_lowercase().trim() {
- // "mainnet" => Self::Mainnet,
+ "mainnet" => Self::Mainnet,
"testnet" => Self::Testnet,
- "devnet" => Self::Devnet,
"local" => Self::Local,
"custom" => Self::Custom,
str => {
return Err(CliError::CommandArgumentError(format!(
- "Invalid network {}. Must be one of [devnet, testnet, local, custom]",
+ "Invalid network {}. Must be one of [mainnet, testnet, local, custom]",
str
)));
},
@@ -489,6 +474,6 @@ impl FromStr for Network {
impl Default for Network {
fn default() -> Self {
- Self::Devnet
+ Self::Testnet
}
}
diff --git a/crates/aptos/src/move_tool/mod.rs b/crates/aptos/src/move_tool/mod.rs
index 109a3c308b813..0ae1c56bfe300 100644
--- a/crates/aptos/src/move_tool/mod.rs
+++ b/crates/aptos/src/move_tool/mod.rs
@@ -184,9 +184,9 @@ impl FrameworkPackageArgs {
prompt_options: PromptOptions,
) -> CliTypedResult<()> {
const APTOS_FRAMEWORK: &str = "AptosFramework";
- const APTOS_GIT_PATH: &str = "https://github.com/aptos-labs/aptos-core.git";
+ const APTOS_GIT_PATH: &str = "https://github.com/movementlabsxyz/aptos-core.git";
const SUBDIR_PATH: &str = "aptos-move/framework/aptos-framework";
- const DEFAULT_BRANCH: &str = "mainnet";
+ const DEFAULT_BRANCH: &str = "movement";
let move_toml = package_dir.join(SourcePackageLayout::Manifest.path());
check_if_file_exists(move_toml.as_path(), prompt_options)?;
@@ -209,30 +209,24 @@ impl FrameworkPackageArgs {
// Add the framework dependency if it's provided
let mut dependencies = BTreeMap::new();
if let Some(ref path) = self.framework_local_dir {
- dependencies.insert(
- APTOS_FRAMEWORK.to_string(),
- Dependency {
- local: Some(path.display().to_string()),
- git: None,
- rev: None,
- subdir: None,
- aptos: None,
- address: None,
- },
- );
+ dependencies.insert(APTOS_FRAMEWORK.to_string(), Dependency {
+ local: Some(path.display().to_string()),
+ git: None,
+ rev: None,
+ subdir: None,
+ aptos: None,
+ address: None,
+ });
} else {
let git_rev = self.framework_git_rev.as_deref().unwrap_or(DEFAULT_BRANCH);
- dependencies.insert(
- APTOS_FRAMEWORK.to_string(),
- Dependency {
- local: None,
- git: Some(APTOS_GIT_PATH.to_string()),
- rev: Some(git_rev.to_string()),
- subdir: Some(SUBDIR_PATH.to_string()),
- aptos: None,
- address: None,
- },
- );
+ dependencies.insert(APTOS_FRAMEWORK.to_string(), Dependency {
+ local: None,
+ git: Some(APTOS_GIT_PATH.to_string()),
+ rev: Some(git_rev.to_string()),
+ subdir: Some(SUBDIR_PATH.to_string()),
+ aptos: None,
+ address: None,
+ });
}
let manifest = MovePackageManifest {
diff --git a/movement.rb b/movement.rb
new file mode 100644
index 0000000000000..acade1d4147ca
--- /dev/null
+++ b/movement.rb
@@ -0,0 +1,18 @@
+class Movement < Formula
+ desc "Movement CLI for interacting with the Movement network"
+ homepage "https://github.com/movementlabsxyz/aptos-core"
+ url "file://#{Dir.pwd}/movement-cli-v3.5.tar.gz"
+ sha256 "0626826ffb341498fe6184de96d1a24f30d91f21904a4a105d527d85d874a7f9"
+ version "0.0.1-alpha"
+
+ depends_on "rust" => :build
+ depends_on "cmake" => :build
+
+ def install
+ system "cargo", "install", *std_cargo_args(path: "crates/aptos"), "--bin", "movement"
+ end
+
+ test do
+ system "#{bin}/movement", "--help"
+ end
+end
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index 30329882ad821..9b32b4e01173d 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -1,5 +1,5 @@
[toolchain]
-channel = "1.78.0"
+channel = "stable"
# Note: we don't specify cargofmt in our toolchain because we rely on
# the nightly version of cargofmt and verify formatting in CI/CD.