From 28af62af1cf4252bcb38f5f80f08284a0a6a9f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= Date: Fri, 11 Feb 2022 11:30:02 -0500 Subject: [PATCH] chore: filenames fastx -> sui --- Cargo.toml | 6 ++--- README.md | 8 +++--- network_utils/Cargo.toml | 4 +-- network_utils/src/network.rs | 2 +- sui/Cargo.toml | 10 +++---- sui/src/bench.rs | 8 +++--- sui/src/config.rs | 8 +++--- sui/src/{fastx.rs => sui.rs} | 8 +++--- sui/src/wallet.rs | 2 +- sui/src/wallet_commands.rs | 14 +++++----- sui_core/Cargo.toml | 8 +++--- sui_core/src/authority.rs | 20 +++++++------- sui_core/src/authority/temporary_store.rs | 2 +- sui_core/src/authority_aggregator.rs | 6 ++--- sui_core/src/authority_client.rs | 4 +-- sui_core/src/authority_server.rs | 4 +-- sui_core/src/client.rs | 14 +++++----- sui_core/src/client/client_store.rs | 2 +- sui_core/src/generate_format.rs | 2 +- sui_core/src/safe_client.rs | 4 +-- sui_core/src/unit_tests/authority_tests.rs | 18 ++++++------- sui_core/src/unit_tests/client_tests.rs | 12 ++++----- .../adapter/Cargo.toml | 8 +++--- .../adapter/src/adapter.rs | 26 +++++++++---------- .../adapter/src/bytecode_rewriter.rs | 0 .../adapter/src/genesis.rs | 20 +++++++------- .../adapter/src/lib.rs | 0 .../adapter/src/unit_tests/adapter_tests.rs | 20 +++++++------- .../src/unit_tests/bytecode_rewriter_tests.rs | 0 .../unit_tests/data/publish_init/Move.toml | 0 .../data/publish_init/sources/M1.move | 0 .../data/publish_init_param/Move.toml | 0 .../data/publish_init_param/sources/M1.move | 0 .../data/publish_init_public/Move.toml | 0 .../data/publish_init_public/sources/M1.move | 0 .../data/publish_init_ret/Move.toml | 0 .../data/publish_init_ret/sources/M1.move | 0 .../src/unit_tests/data/simple_call/Move.toml | 0 .../data/simple_call/sources/M1.move | 0 .../examples/Move.toml | 0 .../examples/sources/CombinableObjects.move | 0 .../sources/CustomObjectTemplate.move | 0 .../examples/sources/EconMod.move | 0 .../examples/sources/Hero.move | 0 .../examples/sources/HeroMod.move | 0 .../examples/sources/TrustedCoin.move | 0 .../framework/Cargo.toml | 6 ++--- .../framework/Move.toml | 0 .../framework/README.md | 2 +- .../framework/deps/move-stdlib/Move.toml | 0 .../deps/move-stdlib/sources/ASCII.move | 0 .../deps/move-stdlib/sources/BCS.move | 0 .../deps/move-stdlib/sources/BitVector.move | 0 .../deps/move-stdlib/sources/Capability.move | 0 .../deps/move-stdlib/sources/Errors.move | 0 .../move-stdlib/sources/FixedPoint32.move | 0 .../deps/move-stdlib/sources/GUID.move | 0 .../deps/move-stdlib/sources/Hash.move | 0 .../deps/move-stdlib/sources/Option.move | 0 .../deps/move-stdlib/sources/Signer.move | 0 .../deps/move-stdlib/sources/UnitTest.move | 0 .../deps/move-stdlib/sources/Vector.move | 0 .../framework/sources/Address.move | 0 .../framework/sources/Coin.move | 0 .../framework/sources/Collection.move | 0 .../framework/sources/Escrow.move | 0 .../framework/sources/Event.move | 0 .../framework/sources/GAS.move | 0 .../framework/sources/ID.move | 0 .../framework/sources/Math.move | 0 .../framework/sources/ObjectBasics.move | 0 .../framework/sources/Transfer.move | 0 .../framework/sources/TxContext.move | 0 .../framework/src/lib.rs | 14 +++++----- .../framework/src/natives/event.rs | 0 .../framework/src/natives/id.rs | 0 .../framework/src/natives/mod.rs | 8 +++--- .../framework/src/natives/transfer.rs | 0 .../framework/src/natives/tx_context.rs | 2 +- .../framework/tests/CollectionTests.move | 0 .../framework/tests/IDTests.move | 0 .../framework/tests/TxContextTests.move | 0 .../verifier/Cargo.toml | 4 +-- .../src/global_storage_access_verifier.rs | 4 +-- .../verifier/src/id_immutable_verifier.rs | 2 +- .../verifier/src/id_leak_verifier.rs | 10 +++---- .../verifier/src/lib.rs | 2 +- .../verifier/src/struct_with_key_verifier.rs | 12 ++++----- .../verifier/src/verifier.rs | 2 +- .../verifier/tests/common/mod.rs | 0 .../verifier/tests/common/module_builder.rs | 4 +-- ...lobal_storage_access_verification_tests.rs | 2 +- .../tests/id_immutable_verification_test.rs | 2 +- .../tests/id_leak_verification_test.rs | 4 +-- .../struct_with_key_verification_test.rs | 8 +++--- {fastx_types => sui_types}/Cargo.toml | 2 +- {fastx_types => sui_types}/src/base_types.rs | 0 {fastx_types => sui_types}/src/coin.rs | 4 +-- {fastx_types => sui_types}/src/committee.rs | 0 {fastx_types => sui_types}/src/error.rs | 0 {fastx_types => sui_types}/src/event.rs | 0 {fastx_types => sui_types}/src/gas.rs | 0 {fastx_types => sui_types}/src/gas_coin.rs | 4 +-- {fastx_types => sui_types}/src/id.rs | 4 +-- {fastx_types => sui_types}/src/lib.rs | 2 +- {fastx_types => sui_types}/src/messages.rs | 0 {fastx_types => sui_types}/src/object.rs | 0 {fastx_types => sui_types}/src/serialize.rs | 0 {fastx_types => sui_types}/src/storage.rs | 0 .../src/unit_tests/base_types_tests.rs | 0 .../src/unit_tests/messages_tests.rs | 0 .../src/unit_tests/serialize_tests.rs | 0 112 files changed, 172 insertions(+), 172 deletions(-) rename sui/src/{fastx.rs => sui.rs} (97%) rename {fastx_programmability => sui_programmability}/adapter/Cargo.toml (88%) rename {fastx_programmability => sui_programmability}/adapter/src/adapter.rs (98%) rename {fastx_programmability => sui_programmability}/adapter/src/bytecode_rewriter.rs (100%) rename {fastx_programmability => sui_programmability}/adapter/src/genesis.rs (77%) rename {fastx_programmability => sui_programmability}/adapter/src/lib.rs (100%) rename {fastx_programmability => sui_programmability}/adapter/src/unit_tests/adapter_tests.rs (99%) rename {fastx_programmability => sui_programmability}/adapter/src/unit_tests/bytecode_rewriter_tests.rs (100%) rename {fastx_programmability => sui_programmability}/adapter/src/unit_tests/data/publish_init/Move.toml (100%) rename {fastx_programmability => sui_programmability}/adapter/src/unit_tests/data/publish_init/sources/M1.move (100%) rename {fastx_programmability => sui_programmability}/adapter/src/unit_tests/data/publish_init_param/Move.toml (100%) rename {fastx_programmability => sui_programmability}/adapter/src/unit_tests/data/publish_init_param/sources/M1.move (100%) rename {fastx_programmability => sui_programmability}/adapter/src/unit_tests/data/publish_init_public/Move.toml (100%) rename {fastx_programmability => sui_programmability}/adapter/src/unit_tests/data/publish_init_public/sources/M1.move (100%) rename {fastx_programmability => sui_programmability}/adapter/src/unit_tests/data/publish_init_ret/Move.toml (100%) rename {fastx_programmability => sui_programmability}/adapter/src/unit_tests/data/publish_init_ret/sources/M1.move (100%) rename {fastx_programmability => sui_programmability}/adapter/src/unit_tests/data/simple_call/Move.toml (100%) rename {fastx_programmability => sui_programmability}/adapter/src/unit_tests/data/simple_call/sources/M1.move (100%) rename {fastx_programmability => sui_programmability}/examples/Move.toml (100%) rename {fastx_programmability => sui_programmability}/examples/sources/CombinableObjects.move (100%) rename {fastx_programmability => sui_programmability}/examples/sources/CustomObjectTemplate.move (100%) rename {fastx_programmability => sui_programmability}/examples/sources/EconMod.move (100%) rename {fastx_programmability => sui_programmability}/examples/sources/Hero.move (100%) rename {fastx_programmability => sui_programmability}/examples/sources/HeroMod.move (100%) rename {fastx_programmability => sui_programmability}/examples/sources/TrustedCoin.move (100%) rename {fastx_programmability => sui_programmability}/framework/Cargo.toml (92%) rename {fastx_programmability => sui_programmability}/framework/Move.toml (100%) rename {fastx_programmability => sui_programmability}/framework/README.md (92%) rename {fastx_programmability => sui_programmability}/framework/deps/move-stdlib/Move.toml (100%) rename {fastx_programmability => sui_programmability}/framework/deps/move-stdlib/sources/ASCII.move (100%) rename {fastx_programmability => sui_programmability}/framework/deps/move-stdlib/sources/BCS.move (100%) rename {fastx_programmability => sui_programmability}/framework/deps/move-stdlib/sources/BitVector.move (100%) rename {fastx_programmability => sui_programmability}/framework/deps/move-stdlib/sources/Capability.move (100%) rename {fastx_programmability => sui_programmability}/framework/deps/move-stdlib/sources/Errors.move (100%) rename {fastx_programmability => sui_programmability}/framework/deps/move-stdlib/sources/FixedPoint32.move (100%) rename {fastx_programmability => sui_programmability}/framework/deps/move-stdlib/sources/GUID.move (100%) rename {fastx_programmability => sui_programmability}/framework/deps/move-stdlib/sources/Hash.move (100%) rename {fastx_programmability => sui_programmability}/framework/deps/move-stdlib/sources/Option.move (100%) rename {fastx_programmability => sui_programmability}/framework/deps/move-stdlib/sources/Signer.move (100%) rename {fastx_programmability => sui_programmability}/framework/deps/move-stdlib/sources/UnitTest.move (100%) rename {fastx_programmability => sui_programmability}/framework/deps/move-stdlib/sources/Vector.move (100%) rename {fastx_programmability => sui_programmability}/framework/sources/Address.move (100%) rename {fastx_programmability => sui_programmability}/framework/sources/Coin.move (100%) rename {fastx_programmability => sui_programmability}/framework/sources/Collection.move (100%) rename {fastx_programmability => sui_programmability}/framework/sources/Escrow.move (100%) rename {fastx_programmability => sui_programmability}/framework/sources/Event.move (100%) rename {fastx_programmability => sui_programmability}/framework/sources/GAS.move (100%) rename {fastx_programmability => sui_programmability}/framework/sources/ID.move (100%) rename {fastx_programmability => sui_programmability}/framework/sources/Math.move (100%) rename {fastx_programmability => sui_programmability}/framework/sources/ObjectBasics.move (100%) rename {fastx_programmability => sui_programmability}/framework/sources/Transfer.move (100%) rename {fastx_programmability => sui_programmability}/framework/sources/TxContext.move (100%) rename {fastx_programmability => sui_programmability}/framework/src/lib.rs (94%) rename {fastx_programmability => sui_programmability}/framework/src/natives/event.rs (100%) rename {fastx_programmability => sui_programmability}/framework/src/natives/id.rs (100%) rename {fastx_programmability => sui_programmability}/framework/src/natives/mod.rs (87%) rename {fastx_programmability => sui_programmability}/framework/src/natives/transfer.rs (100%) rename {fastx_programmability => sui_programmability}/framework/src/natives/tx_context.rs (96%) rename {fastx_programmability => sui_programmability}/framework/tests/CollectionTests.move (100%) rename {fastx_programmability => sui_programmability}/framework/tests/IDTests.move (100%) rename {fastx_programmability => sui_programmability}/framework/tests/TxContextTests.move (100%) rename {fastx_programmability => sui_programmability}/verifier/Cargo.toml (88%) rename {fastx_programmability => sui_programmability}/verifier/src/global_storage_access_verifier.rs (97%) rename {fastx_programmability => sui_programmability}/verifier/src/id_immutable_verifier.rs (98%) rename {fastx_programmability => sui_programmability}/verifier/src/id_leak_verifier.rs (99%) rename {fastx_programmability => sui_programmability}/verifier/src/lib.rs (90%) rename {fastx_programmability => sui_programmability}/verifier/src/struct_with_key_verifier.rs (87%) rename {fastx_programmability => sui_programmability}/verifier/src/verifier.rs (94%) rename {fastx_programmability => sui_programmability}/verifier/tests/common/mod.rs (100%) rename {fastx_programmability => sui_programmability}/verifier/tests/common/module_builder.rs (98%) rename {fastx_programmability => sui_programmability}/verifier/tests/global_storage_access_verification_tests.rs (96%) rename {fastx_programmability => sui_programmability}/verifier/tests/id_immutable_verification_test.rs (98%) rename {fastx_programmability => sui_programmability}/verifier/tests/id_leak_verification_test.rs (98%) rename {fastx_programmability => sui_programmability}/verifier/tests/struct_with_key_verification_test.rs (96%) rename {fastx_types => sui_types}/Cargo.toml (98%) rename {fastx_types => sui_types}/src/base_types.rs (100%) rename {fastx_types => sui_types}/src/coin.rs (94%) rename {fastx_types => sui_types}/src/committee.rs (100%) rename {fastx_types => sui_types}/src/error.rs (100%) rename {fastx_types => sui_types}/src/event.rs (100%) rename {fastx_types => sui_types}/src/gas.rs (100%) rename {fastx_types => sui_types}/src/gas_coin.rs (97%) rename {fastx_types => sui_types}/src/id.rs (94%) rename {fastx_types => sui_types}/src/lib.rs (91%) rename {fastx_types => sui_types}/src/messages.rs (100%) rename {fastx_types => sui_types}/src/object.rs (100%) rename {fastx_types => sui_types}/src/serialize.rs (100%) rename {fastx_types => sui_types}/src/storage.rs (100%) rename {fastx_types => sui_types}/src/unit_tests/base_types_tests.rs (100%) rename {fastx_types => sui_types}/src/unit_tests/messages_tests.rs (100%) rename {fastx_types => sui_types}/src/unit_tests/serialize_tests.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 9ee52aa3b3fc7..19324a14770dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,9 +2,9 @@ members = [ "sui_core", "sui", - "fastx_programmability/adapter", - "fastx_programmability/framework", - "fastx_types", + "sui_programmability/adapter", + "sui_programmability/framework", + "sui_types", ] [profile.release] diff --git a/README.md b/README.md index 044a6595f47e7..24c9d0e121daf 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,12 @@ cargo build --release cd target/release ``` -This will create `fastx` and `wallet` binaries in `target/release` directory. +This will create `sui` and `wallet` binaries in `target/release` directory. ### 2. Genesis ```shell -./fastx genesis +./sui genesis ``` The genesis command creates 4 authorities, 5 user accounts each with 5 gas objects. @@ -37,13 +37,13 @@ A `wallet.conf` will also be generated to be used by the `wallet` binary to mana Run the following command to start the local Sui network: ```shell -./fastx start +./sui start ``` or ```shell -./fastx start --config [config file path] +./sui start --config [config file path] ``` The network config file path is defaulted to `./network.conf` if not specified. diff --git a/network_utils/Cargo.toml b/network_utils/Cargo.toml index a6ba0777a789a..9e504def62c11 100644 --- a/network_utils/Cargo.toml +++ b/network_utils/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "fastx-network" +name = "sui-network" version = "0.1.0" authors = ["Mysten Labs "] license = "Apache-2.0" @@ -14,7 +14,7 @@ net2 = "0.2.37" tokio = { version = "1.15.0", features = ["full"] } tracing = { version = "0.1", features = ["log"] } -fastx-types = { path = "../fastx_types" } +sui-types = { path = "../sui_types" } [package.metadata.cargo-udeps.ignore] normal = ["net2"] \ No newline at end of file diff --git a/network_utils/src/network.rs b/network_utils/src/network.rs index 83aec08a4a869..bf9dc4f2228e2 100644 --- a/network_utils/src/network.rs +++ b/network_utils/src/network.rs @@ -3,9 +3,9 @@ use crate::transport::*; use bytes::Bytes; -use fastx_types::{error::*, serialize::*}; use futures::future::FutureExt; use std::sync::atomic::{AtomicUsize, Ordering}; +use sui_types::{error::*, serialize::*}; use tracing::*; use std::io; diff --git a/sui/Cargo.toml b/sui/Cargo.toml index 3a4a012e6e4fe..5937475bc5172 100644 --- a/sui/Cargo.toml +++ b/sui/Cargo.toml @@ -31,9 +31,9 @@ tracing-subscriber = { version = "0.3", features = ["time", "env-filter"] } bcs = "0.1.3" sui_core = { path = "../sui_core" } -fastx-adapter = { path = "../fastx_programmability/adapter" } -fastx-network = { path = "../network_utils" } -fastx-types = { path = "../fastx_types" } +sui-adapter = { path = "../sui_programmability/adapter" } +sui-network = { path = "../network_utils" } +sui-types = { path = "../sui_types" } rustyline = "9.1.2" rustyline-derive = "0.6.0" @@ -53,5 +53,5 @@ name = "wallet" path = "src/wallet.rs" [[bin]] -name = "fastx" -path = "src/fastx.rs" +name = "sui" +path = "src/sui.rs" diff --git a/sui/src/bench.rs b/sui/src/bench.rs index 5c988febb347e..7c3f1b3a782c8 100644 --- a/sui/src/bench.rs +++ b/sui/src/bench.rs @@ -4,9 +4,6 @@ #![deny(warnings)] use bytes::Bytes; -use fastx_network::{network::NetworkClient, transport}; -use fastx_types::FASTX_FRAMEWORK_ADDRESS; -use fastx_types::{base_types::*, committee::*, messages::*, object::Object, serialize::*}; use futures::stream::StreamExt; use move_core_types::ident_str; use rand::rngs::StdRng; @@ -14,6 +11,9 @@ use rand::Rng; use std::time::{Duration, Instant}; use structopt::StructOpt; use sui_core::{authority::*, authority_server::AuthorityServer}; +use sui_network::{network::NetworkClient, transport}; +use sui_types::SUI_FRAMEWORK_ADDRESS; +use sui_types::{base_types::*, committee::*, messages::*, object::Object, serialize::*}; use tokio::runtime::Runtime; use tokio::{runtime::Builder, time}; use tracing::subscriber::set_global_default; @@ -209,7 +209,7 @@ impl ClientServerBenchmark { let order = if self.use_move { // TODO: authority should not require seq# or digets for package in Move calls. Use dummy values let framework_obj_ref = ( - FASTX_FRAMEWORK_ADDRESS, + SUI_FRAMEWORK_ADDRESS, SequenceNumber::new(), ObjectDigest::new([0; 32]), ); diff --git a/sui/src/config.rs b/sui/src/config.rs index a7f13817d6db0..e998abd4ade30 100644 --- a/sui/src/config.rs +++ b/sui/src/config.rs @@ -1,15 +1,13 @@ // Copyright (c) Facebook, Inc. and its affiliates. // SPDX-License-Identifier: Apache-2.0 -use fastx_types::{ +use sui_core::client::ClientState; +use sui_types::{ base_types::*, messages::{CertifiedOrder, OrderKind}, }; -use sui_core::client::ClientState; use crate::utils::Config; -use fastx_network::transport; -use fastx_types::object::Object; use move_core_types::language_storage::TypeTag; use move_core_types::{identifier::Identifier, transaction_argument::TransactionArgument}; use serde::{Deserialize, Serialize}; @@ -22,6 +20,8 @@ use std::{ io::{BufReader, BufWriter, Write}, iter::FromIterator, }; +use sui_network::transport; +use sui_types::object::Object; #[derive(Clone, Debug, Serialize, Deserialize)] pub struct AuthorityConfig { diff --git a/sui/src/fastx.rs b/sui/src/sui.rs similarity index 97% rename from sui/src/fastx.rs rename to sui/src/sui.rs index 4eaa5fe4b40a8..b1abcd475c882 100644 --- a/sui/src/fastx.rs +++ b/sui/src/sui.rs @@ -1,8 +1,5 @@ // Copyright (c) Mysten Labs // SPDX-License-Identifier: Apache-2.0 -use fastx_types::base_types::{get_key_pair, ObjectID, SequenceNumber}; -use fastx_types::committee::Committee; -use fastx_types::object::Object; use futures::future::join_all; use std::collections::BTreeMap; use std::net::TcpListener; @@ -14,6 +11,9 @@ use sui::config::{AccountInfo, AuthorityInfo, AuthorityPrivateInfo, NetworkConfi use sui::utils::Config; use sui_core::authority::{AuthorityState, AuthorityStore}; use sui_core::authority_server::AuthorityServer; +use sui_types::base_types::{get_key_pair, ObjectID, SequenceNumber}; +use sui_types::committee::Committee; +use sui_types::object::Object; use tracing::error; use tracing::subscriber::set_global_default; use tracing_subscriber::EnvFilter; @@ -36,7 +36,7 @@ struct FastXOpt { #[derive(StructOpt)] #[structopt(rename_all = "kebab-case")] pub enum FastXCommand { - /// Start fastx network. + /// Start sui network. #[structopt(name = "start")] Start, #[structopt(name = "genesis")] diff --git a/sui/src/wallet.rs b/sui/src/wallet.rs index 4f3b01811e9d2..c5aa7986dcd4d 100644 --- a/sui/src/wallet.rs +++ b/sui/src/wallet.rs @@ -75,7 +75,7 @@ async fn main() -> Result<(), anyhow::Error> { println!(); let mut shell = Shell { - prompt: "fastx>-$ ", + prompt: "sui>-$ ", state: context, handler: ClientCommandHandler, description: String::new(), diff --git a/sui/src/wallet_commands.rs b/sui/src/wallet_commands.rs index 977f083e7e5a5..332b320813daa 100644 --- a/sui/src/wallet_commands.rs +++ b/sui/src/wallet_commands.rs @@ -1,18 +1,17 @@ // Copyright (c) Mysten Labs // SPDX-License-Identifier: Apache-2.0 use crate::config::{AccountInfo, AuthorityInfo, WalletConfig}; -use fastx_network::network::NetworkClient; -use fastx_types::base_types::{ +use sui_core::authority_client::AuthorityClient; +use sui_core::client::{Client, ClientState}; +use sui_network::network::NetworkClient; +use sui_types::base_types::{ decode_address_hex, encode_address_hex, get_key_pair, AuthorityName, ObjectID, PublicKeyBytes, SuiAddress, }; -use fastx_types::committee::Committee; -use fastx_types::messages::{ExecutionStatus, OrderEffects}; -use sui_core::authority_client::AuthorityClient; -use sui_core::client::{Client, ClientState}; +use sui_types::committee::Committee; +use sui_types::messages::{ExecutionStatus, OrderEffects}; use crate::utils::Config; -use fastx_types::error::SuiError; use move_core_types::identifier::Identifier; use move_core_types::language_storage::TypeTag; use move_core_types::parser::{parse_transaction_argument, parse_type_tag}; @@ -22,6 +21,7 @@ use std::path::PathBuf; use std::time::{Duration, Instant}; use structopt::clap::AppSettings; use structopt::StructOpt; +use sui_types::error::SuiError; use tracing::*; #[derive(StructOpt)] diff --git a/sui_core/Cargo.toml b/sui_core/Cargo.toml index a6095b05a0dcf..bc8f6e30ac3d6 100644 --- a/sui_core/Cargo.toml +++ b/sui_core/Cargo.toml @@ -22,10 +22,10 @@ tracing = { version = "0.1", features = ["log"] } signature = "1.5.0" ed25519-dalek = "1.0.1" -fastx-adapter = { path = "../fastx_programmability/adapter" } -fastx-framework = { path = "../fastx_programmability/framework" } -fastx-network = { path = "../network_utils" } -fastx-types = { path = "../fastx_types" } +sui-adapter = { path = "../sui_programmability/adapter" } +sui-framework = { path = "../sui_programmability/framework" } +sui-network = { path = "../network_utils" } +sui-types = { path = "../sui_types" } move-binary-format = { git = "https://github.com/diem/move", rev="1e5e36cb1fede8073c8688886a0943bb5bfe40d5" } move-core-types = { git = "https://github.com/diem/move", rev="1e5e36cb1fede8073c8688886a0943bb5bfe40d5", features=["address20"] } diff --git a/sui_core/src/authority.rs b/sui_core/src/authority.rs index 1d7b51c595e43..cf48e14f631fc 100644 --- a/sui_core/src/authority.rs +++ b/sui_core/src/authority.rs @@ -1,16 +1,6 @@ // Copyright (c) Facebook, Inc. and its affiliates. // SPDX-License-Identifier: Apache-2.0 -use fastx_adapter::{adapter, genesis}; -use fastx_types::{ - base_types::*, - committee::Committee, - error::{SuiError, SuiResult}, - fp_bail, fp_ensure, gas, - messages::*, - object::{Data, Object}, - storage::Storage, -}; use move_core_types::{ account_address::AccountAddress, language_storage::{ModuleId, StructTag}, @@ -22,6 +12,16 @@ use std::{ pin::Pin, sync::Arc, }; +use sui_adapter::{adapter, genesis}; +use sui_types::{ + base_types::*, + committee::Committee, + error::{SuiError, SuiResult}, + fp_bail, fp_ensure, gas, + messages::*, + object::{Data, Object}, + storage::Storage, +}; #[cfg(test)] #[path = "unit_tests/authority_tests.rs"] diff --git a/sui_core/src/authority/temporary_store.rs b/sui_core/src/authority/temporary_store.rs index cf32584fa0218..7881fdf68db83 100644 --- a/sui_core/src/authority/temporary_store.rs +++ b/sui_core/src/authority/temporary_store.rs @@ -1,4 +1,4 @@ -use fastx_types::event::Event; +use sui_types::event::Event; use super::*; diff --git a/sui_core/src/authority_aggregator.rs b/sui_core/src/authority_aggregator.rs index 99d646178f35a..9ea6b2c6ab407 100644 --- a/sui_core/src/authority_aggregator.rs +++ b/sui_core/src/authority_aggregator.rs @@ -4,14 +4,14 @@ use crate::authority_client::AuthorityAPI; use crate::safe_client::SafeClient; -use fastx_types::object::{Object, ObjectRead}; -use fastx_types::{ +use futures::{future, StreamExt}; +use sui_types::object::{Object, ObjectRead}; +use sui_types::{ base_types::*, committee::Committee, error::{SuiError, SuiResult}, messages::*, }; -use futures::{future, StreamExt}; use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::time::Duration; diff --git a/sui_core/src/authority_client.rs b/sui_core/src/authority_client.rs index 0f9fa56ddc170..8446e3fed9635 100644 --- a/sui_core/src/authority_client.rs +++ b/sui_core/src/authority_client.rs @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 use async_trait::async_trait; -use fastx_network::network::NetworkClient; -use fastx_types::{error::SuiError, messages::*, serialize::*}; +use sui_network::network::NetworkClient; +use sui_types::{error::SuiError, messages::*, serialize::*}; #[async_trait] pub trait AuthorityAPI { diff --git a/sui_core/src/authority_server.rs b/sui_core/src/authority_server.rs index 1e730b2c8455d..3a6a95a5bbe79 100644 --- a/sui_core/src/authority_server.rs +++ b/sui_core/src/authority_server.rs @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 use crate::authority::AuthorityState; -use fastx_network::{ +use sui_network::{ network::NetworkServer, transport::{spawn_server, MessageHandler, SpawnedServer}, }; -use fastx_types::{error::*, messages::*, serialize::*}; +use sui_types::{error::*, messages::*, serialize::*}; use std::io; use tracing::*; diff --git a/sui_core/src/client.rs b/sui_core/src/client.rs index 1ba1db1fc26f1..87526ebd92d70 100644 --- a/sui_core/src/client.rs +++ b/sui_core/src/client.rs @@ -3,15 +3,15 @@ use crate::{authority_aggregator::AuthorityAggregator, authority_client::AuthorityAPI}; use async_trait::async_trait; -use fastx_framework::build_move_package_to_bytes; -use fastx_types::{ - base_types::*, committee::Committee, error::SuiError, fp_ensure, messages::*, - object::ObjectRead, -}; use futures::future; use itertools::Itertools; use move_core_types::identifier::Identifier; use move_core_types::language_storage::TypeTag; +use sui_framework::build_move_package_to_bytes; +use sui_types::{ + base_types::*, committee::Committee, error::SuiError, fp_ensure, messages::*, + object::ObjectRead, +}; use typed_store::rocks::open_cf; use typed_store::Map; @@ -34,7 +34,7 @@ pub mod client_store; use self::client_store::ClientStore; #[cfg(test)] -use fastx_types::FASTX_FRAMEWORK_ADDRESS; +use sui_types::SUI_FRAMEWORK_ADDRESS; pub type AsyncResult<'a, T, E> = future::BoxFuture<'a, Result>; @@ -237,7 +237,7 @@ where #[cfg(test)] pub async fn get_framework_object_ref(&mut self) -> Result { - let info = self.get_object_info(FASTX_FRAMEWORK_ADDRESS).await?; + let info = self.get_object_info(SUI_FRAMEWORK_ADDRESS).await?; Ok(info.reference()?) } diff --git a/sui_core/src/client/client_store.rs b/sui_core/src/client/client_store.rs index 77a0203d6bd8a..11ae3a17b16d2 100644 --- a/sui_core/src/client/client_store.rs +++ b/sui_core/src/client/client_store.rs @@ -1,8 +1,8 @@ use super::*; -use fastx_types::object::Object; use rocksdb::{DBWithThreadMode, MultiThreaded}; use std::path::PathBuf; use std::sync::Arc; +use sui_types::object::Object; use typed_store::rocks::DBMap; const CERT_CF_NAME: &str = "certificates"; diff --git a/sui_core/src/generate_format.rs b/sui_core/src/generate_format.rs index 1ee7190ec91e2..9ffdd733aa74f 100644 --- a/sui_core/src/generate_format.rs +++ b/sui_core/src/generate_format.rs @@ -1,7 +1,7 @@ // Copyright (c) Facebook, Inc. and its affiliates. // SPDX-License-Identifier: Apache-2.0 -use fastx_types::{error, messages, serialize}; +use sui_types::{error, messages, serialize}; use serde_reflection::{Registry, Result, Samples, Tracer, TracerConfig}; use std::{fs::File, io::Write}; use structopt::{clap::arg_enum, StructOpt}; diff --git a/sui_core/src/safe_client.rs b/sui_core/src/safe_client.rs index 2f5d48de3dcd9..19ac2b9eee9f8 100644 --- a/sui_core/src/safe_client.rs +++ b/sui_core/src/safe_client.rs @@ -3,9 +3,9 @@ use crate::authority_client::AuthorityAPI; use async_trait::async_trait; -use fastx_types::{base_types::*, committee::*, fp_ensure}; +use sui_types::{base_types::*, committee::*, fp_ensure}; -use fastx_types::{ +use sui_types::{ error::{SuiError, SuiResult}, messages::*, }; diff --git a/sui_core/src/unit_tests/authority_tests.rs b/sui_core/src/unit_tests/authority_tests.rs index ed9869c4c74ec..9e9ae64bbfd74 100644 --- a/sui_core/src/unit_tests/authority_tests.rs +++ b/sui_core/src/unit_tests/authority_tests.rs @@ -3,19 +3,19 @@ use super::*; use bcs; -use fastx_adapter::genesis; -use fastx_types::{ - base_types::dbg_addr, - gas::{calculate_module_publish_cost, get_gas_balance}, - messages::ExecutionStatus, - object::{GAS_VALUE_FOR_TESTING, OBJECT_START_VERSION}, -}; use move_binary_format::{ file_format::{self, AddressIdentifierIndex, IdentifierIndex, ModuleHandle}, CompiledModule, }; use move_core_types::{ident_str, identifier::Identifier, language_storage::TypeTag}; use move_package::BuildConfig; +use sui_adapter::genesis; +use sui_types::{ + base_types::dbg_addr, + gas::{calculate_module_publish_cost, get_gas_balance}, + messages::ExecutionStatus, + object::{GAS_VALUE_FOR_TESTING, OBJECT_START_VERSION}, +}; use std::fs; use std::path::PathBuf; @@ -1284,8 +1284,8 @@ async fn test_hero() { // 1. Compile the Hero Move code. let build_config = BuildConfig::default(); let mut hero_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - hero_path.push("../fastx_programmability/examples/"); - let modules = fastx_framework::build_move_package(&hero_path, build_config, false).unwrap(); + hero_path.push("../sui_programmability/examples/"); + let modules = sui_framework::build_move_package(&hero_path, build_config, false).unwrap(); // 2. Create an admin account, and a player account. // Using a hard-coded key to match the address in the Move code. diff --git a/sui_core/src/unit_tests/client_tests.rs b/sui_core/src/unit_tests/client_tests.rs index 5d2e800ebe9fd..c25da934568aa 100644 --- a/sui_core/src/unit_tests/client_tests.rs +++ b/sui_core/src/unit_tests/client_tests.rs @@ -7,7 +7,6 @@ use crate::authority::{AuthorityState, AuthorityStore}; use crate::client::client_store::ClientStore; use crate::client::{Client, ClientState}; use async_trait::async_trait; -use fastx_types::object::{Data, Object, GAS_VALUE_FOR_TESTING, OBJECT_START_VERSION}; use futures::lock::Mutex; use move_core_types::{ident_str, identifier::Identifier}; use std::{ @@ -15,13 +14,14 @@ use std::{ convert::TryInto, sync::Arc, }; +use sui_types::object::{Data, Object, GAS_VALUE_FOR_TESTING, OBJECT_START_VERSION}; use tokio::runtime::Runtime; use typed_store::Map; -use fastx_types::error::SuiError::ObjectNotFound; use move_core_types::account_address::AccountAddress; use std::env; use std::fs; +use sui_types::error::SuiError::ObjectNotFound; // Only relevant in a ser/de context : the `CertifiedOrder` for a transaction is not unique fn compare_certified_orders(o1: &CertifiedOrder, o2: &CertifiedOrder) { @@ -1137,7 +1137,7 @@ async fn test_module_publish_and_call_good() { // Provide path to well formed package sources let mut hero_path = env!("CARGO_MANIFEST_DIR").to_owned(); - hero_path.push_str("/../fastx_programmability/examples/"); + hero_path.push_str("/../sui_programmability/examples/"); let pub_res = client1.publish(hero_path, gas_object_ref, 1000).await; @@ -1256,7 +1256,7 @@ async fn test_module_publish_file_path() { let mut hero_path = env!("CARGO_MANIFEST_DIR").to_owned(); // Use a path pointing to a different file - hero_path.push_str("/../fastx_programmability/examples/Hero.move"); + hero_path.push_str("/../sui_programmability/examples/Hero.move"); let pub_resp = client1.publish(hero_path, gas_object_ref, 1000).await; @@ -1324,7 +1324,7 @@ async fn test_module_publish_bad_path() { let mut hero_path = env!("CARGO_MANIFEST_DIR").to_owned(); // Use a bad path - hero_path.push_str("/../fastx_____programmability/examples/"); + hero_path.push_str("/../sui_____programmability/examples/"); let pub_resp = client1.publish(hero_path, gas_object_ref, 1000).await; // Has to fail @@ -1540,7 +1540,7 @@ async fn test_object_store() { // Provide path to well formed package sources let mut hero_path = env!("CARGO_MANIFEST_DIR").to_owned(); - hero_path.push_str("/../fastx_programmability/examples/"); + hero_path.push_str("/../sui_programmability/examples/"); let pub_res = client1.publish(hero_path, gas_object_ref, 1000).await; diff --git a/fastx_programmability/adapter/Cargo.toml b/sui_programmability/adapter/Cargo.toml similarity index 88% rename from fastx_programmability/adapter/Cargo.toml rename to sui_programmability/adapter/Cargo.toml index 2ba429301337a..c0cd37799027d 100644 --- a/fastx_programmability/adapter/Cargo.toml +++ b/sui_programmability/adapter/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "fastx-adapter" +name = "sui-adapter" version = "0.1.0" authors = ["Mysten Labs "] description = "Adapter and accompanying CLI for local fastX development" @@ -21,9 +21,9 @@ move-cli = { git = "https://github.com/diem/move", rev="1e5e36cb1fede8073c868888 move-vm-runtime = { git = "https://github.com/diem/move", rev="1e5e36cb1fede8073c8688886a0943bb5bfe40d5" } move-vm-types = { git = "https://github.com/diem/move", rev="1e5e36cb1fede8073c8688886a0943bb5bfe40d5" } -fastx-framework = { path = "../framework" } -fastx-verifier = { path = "../verifier" } -fastx-types = { path = "../../fastx_types" } +sui-framework = { path = "../framework" } +sui-verifier = { path = "../verifier" } +sui-types = { path = "../../sui_types" } [dev-dependencies] move-package = { git = "https://github.com/diem/move", rev="1e5e36cb1fede8073c8688886a0943bb5bfe40d5" } diff --git a/fastx_programmability/adapter/src/adapter.rs b/sui_programmability/adapter/src/adapter.rs similarity index 98% rename from fastx_programmability/adapter/src/adapter.rs rename to sui_programmability/adapter/src/adapter.rs index 41397a58abd63..9dab4efa1795b 100644 --- a/fastx_programmability/adapter/src/adapter.rs +++ b/sui_programmability/adapter/src/adapter.rs @@ -4,8 +4,13 @@ use anyhow::Result; use crate::bytecode_rewriter::ModuleHandleRewriter; -use fastx_framework::EventType; -use fastx_types::{ +use move_binary_format::{ + errors::PartialVMResult, + file_format::{CompiledModule, Visibility}, + normalized::{Function, Type}, +}; +use sui_framework::EventType; +use sui_types::{ base_types::{ Authenticator, ObjectID, SuiAddress, TransactionDigest, TxContext, TX_CONTEXT_MODULE_NAME, TX_CONTEXT_STRUCT_NAME, @@ -16,14 +21,9 @@ use fastx_types::{ messages::ExecutionStatus, object::{Data, MoveObject, Object}, storage::Storage, - FASTX_FRAMEWORK_ADDRESS, -}; -use fastx_verifier::verifier; -use move_binary_format::{ - errors::PartialVMResult, - file_format::{CompiledModule, Visibility}, - normalized::{Function, Type}, + SUI_FRAMEWORK_ADDRESS, }; +use sui_verifier::verifier; use move_cli::sandbox::utils::get_gas_status; use move_core_types::{ @@ -66,7 +66,7 @@ pub fn new_move_vm(natives: NativeFunctionTable) -> Result, SuiError /// Execute `module::function(object_args ++ pure_args)` as a call from `sender` with the given `gas_budget`. /// Execution will read from/write to the store in `state_view`. /// IMPORTANT NOTES on the return value: -/// The return value indicates whether a system error has occured (i.e. issues with the fastx system, not with user transaction). +/// The return value indicates whether a system error has occured (i.e. issues with the sui system, not with user transaction). /// As long as there are no system issues we return Ok(ExecutionStatus). /// ExecutionStatus indicates the execution result. If execution failed, we wrap both the gas used and the error /// into ExecutionStatus::Failure. @@ -157,7 +157,7 @@ fn execute_internal< ctx: &mut TxContext, for_publish: bool, ) -> SuiResult { - // TODO: Update Move gas constants to reflect the gas fee on fastx. + // TODO: Update Move gas constants to reflect the gas fee on sui. let cost_table = &move_vm_types::gas_schedule::INITIAL_COST_SCHEDULE; let mut gas_status = match get_gas_status(cost_table, Some(gas_budget)).map_err(|e| SuiError::GasBudgetTooHigh { @@ -694,7 +694,7 @@ fn resolve_and_type_check( return Err(SuiError::InvalidFunctionSignature { error: format!( "Expected last parameter of function signature to be &mut {}::{}::{}, but found {}", - FASTX_FRAMEWORK_ADDRESS, TX_CONTEXT_MODULE_NAME, TX_CONTEXT_STRUCT_NAME, last_param + SUI_FRAMEWORK_ADDRESS, TX_CONTEXT_MODULE_NAME, TX_CONTEXT_STRUCT_NAME, last_param ), }); } @@ -802,7 +802,7 @@ fn is_param_tx_context(param: &Type) -> bool { module, name, type_arguments, - } if address == &FASTX_FRAMEWORK_ADDRESS + } if address == &SUI_FRAMEWORK_ADDRESS && module.as_ident_str() == TX_CONTEXT_MODULE_NAME && name.as_ident_str() == TX_CONTEXT_STRUCT_NAME && type_arguments.is_empty() => diff --git a/fastx_programmability/adapter/src/bytecode_rewriter.rs b/sui_programmability/adapter/src/bytecode_rewriter.rs similarity index 100% rename from fastx_programmability/adapter/src/bytecode_rewriter.rs rename to sui_programmability/adapter/src/bytecode_rewriter.rs diff --git a/fastx_programmability/adapter/src/genesis.rs b/sui_programmability/adapter/src/genesis.rs similarity index 77% rename from fastx_programmability/adapter/src/genesis.rs rename to sui_programmability/adapter/src/genesis.rs index a528dd9a893af..e622edd8561e1 100644 --- a/fastx_programmability/adapter/src/genesis.rs +++ b/sui_programmability/adapter/src/genesis.rs @@ -1,15 +1,15 @@ // Copyright (c) Mysten Labs // SPDX-License-Identifier: Apache-2.0 -use fastx_framework::{self}; -use fastx_types::{ - base_types::{Authenticator, SuiAddress, TransactionDigest}, - object::Object, - FASTX_FRAMEWORK_ADDRESS, MOVE_STDLIB_ADDRESS, -}; use move_vm_runtime::native_functions::NativeFunctionTable; use once_cell::sync::Lazy; use std::sync::Mutex; +use sui_framework::{self}; +use sui_types::{ + base_types::{Authenticator, SuiAddress, TransactionDigest}, + object::Object, + MOVE_STDLIB_ADDRESS, SUI_FRAMEWORK_ADDRESS, +}; static GENESIS: Lazy> = Lazy::new(|| Mutex::new(create_genesis_module_objects())); @@ -25,14 +25,14 @@ pub fn clone_genesis_data() -> (Vec, NativeFunctionTable) { /// Create and return objects wrapping the genesis modules for fastX fn create_genesis_module_objects() -> Genesis { - let fastx_modules = fastx_framework::get_fastx_framework_modules(); - let std_modules = fastx_framework::get_move_stdlib_modules(); + let sui_modules = sui_framework::get_sui_framework_modules(); + let std_modules = sui_framework::get_move_stdlib_modules(); let native_functions = - fastx_framework::natives::all_natives(MOVE_STDLIB_ADDRESS, FASTX_FRAMEWORK_ADDRESS); + sui_framework::natives::all_natives(MOVE_STDLIB_ADDRESS, SUI_FRAMEWORK_ADDRESS); let owner = SuiAddress::default(); let objects = vec![ Object::new_package( - fastx_modules, + sui_modules, Authenticator::Address(owner), TransactionDigest::genesis(), ), diff --git a/fastx_programmability/adapter/src/lib.rs b/sui_programmability/adapter/src/lib.rs similarity index 100% rename from fastx_programmability/adapter/src/lib.rs rename to sui_programmability/adapter/src/lib.rs diff --git a/fastx_programmability/adapter/src/unit_tests/adapter_tests.rs b/sui_programmability/adapter/src/unit_tests/adapter_tests.rs similarity index 99% rename from fastx_programmability/adapter/src/unit_tests/adapter_tests.rs rename to sui_programmability/adapter/src/unit_tests/adapter_tests.rs index 088f78fcc61de..3a405d16f9921 100644 --- a/fastx_programmability/adapter/src/unit_tests/adapter_tests.rs +++ b/sui_programmability/adapter/src/unit_tests/adapter_tests.rs @@ -2,14 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 use crate::{adapter, genesis}; -use fastx_types::{ - base_types::{self, SequenceNumber}, - error::SuiResult, - gas_coin::GAS, - object::Data, - storage::Storage, - FASTX_FRAMEWORK_ADDRESS, -}; use move_binary_format::file_format::{ self, AbilitySet, AddressIdentifierIndex, IdentifierIndex, ModuleHandle, ModuleHandleIndex, StructHandle, @@ -17,6 +9,14 @@ use move_binary_format::file_format::{ use move_core_types::{account_address::AccountAddress, ident_str}; use move_package::BuildConfig; use std::{mem, path::PathBuf}; +use sui_types::{ + base_types::{self, SequenceNumber}, + error::SuiResult, + gas_coin::GAS, + object::Data, + storage::Storage, + SUI_FRAMEWORK_ADDRESS, +}; use super::*; @@ -749,7 +749,7 @@ fn test_move_call_incorrect_function() { assert_eq!(gas_used, gas::MIN_MOVE_CALL_GAS); assert!(err.to_string().contains(&format!( "Could not resolve function 'foo' in module {}::ObjectBasics", - FASTX_FRAMEWORK_ADDRESS + SUI_FRAMEWORK_ADDRESS ))); } @@ -916,7 +916,7 @@ fn publish_from_src( let build_config = BuildConfig::default(); let mut module_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); module_path.push(src_path); - let modules = fastx_framework::build_move_package(&module_path, build_config, false).unwrap(); + let modules = sui_framework::build_move_package(&module_path, build_config, false).unwrap(); // publish modules let all_module_bytes = modules diff --git a/fastx_programmability/adapter/src/unit_tests/bytecode_rewriter_tests.rs b/sui_programmability/adapter/src/unit_tests/bytecode_rewriter_tests.rs similarity index 100% rename from fastx_programmability/adapter/src/unit_tests/bytecode_rewriter_tests.rs rename to sui_programmability/adapter/src/unit_tests/bytecode_rewriter_tests.rs diff --git a/fastx_programmability/adapter/src/unit_tests/data/publish_init/Move.toml b/sui_programmability/adapter/src/unit_tests/data/publish_init/Move.toml similarity index 100% rename from fastx_programmability/adapter/src/unit_tests/data/publish_init/Move.toml rename to sui_programmability/adapter/src/unit_tests/data/publish_init/Move.toml diff --git a/fastx_programmability/adapter/src/unit_tests/data/publish_init/sources/M1.move b/sui_programmability/adapter/src/unit_tests/data/publish_init/sources/M1.move similarity index 100% rename from fastx_programmability/adapter/src/unit_tests/data/publish_init/sources/M1.move rename to sui_programmability/adapter/src/unit_tests/data/publish_init/sources/M1.move diff --git a/fastx_programmability/adapter/src/unit_tests/data/publish_init_param/Move.toml b/sui_programmability/adapter/src/unit_tests/data/publish_init_param/Move.toml similarity index 100% rename from fastx_programmability/adapter/src/unit_tests/data/publish_init_param/Move.toml rename to sui_programmability/adapter/src/unit_tests/data/publish_init_param/Move.toml diff --git a/fastx_programmability/adapter/src/unit_tests/data/publish_init_param/sources/M1.move b/sui_programmability/adapter/src/unit_tests/data/publish_init_param/sources/M1.move similarity index 100% rename from fastx_programmability/adapter/src/unit_tests/data/publish_init_param/sources/M1.move rename to sui_programmability/adapter/src/unit_tests/data/publish_init_param/sources/M1.move diff --git a/fastx_programmability/adapter/src/unit_tests/data/publish_init_public/Move.toml b/sui_programmability/adapter/src/unit_tests/data/publish_init_public/Move.toml similarity index 100% rename from fastx_programmability/adapter/src/unit_tests/data/publish_init_public/Move.toml rename to sui_programmability/adapter/src/unit_tests/data/publish_init_public/Move.toml diff --git a/fastx_programmability/adapter/src/unit_tests/data/publish_init_public/sources/M1.move b/sui_programmability/adapter/src/unit_tests/data/publish_init_public/sources/M1.move similarity index 100% rename from fastx_programmability/adapter/src/unit_tests/data/publish_init_public/sources/M1.move rename to sui_programmability/adapter/src/unit_tests/data/publish_init_public/sources/M1.move diff --git a/fastx_programmability/adapter/src/unit_tests/data/publish_init_ret/Move.toml b/sui_programmability/adapter/src/unit_tests/data/publish_init_ret/Move.toml similarity index 100% rename from fastx_programmability/adapter/src/unit_tests/data/publish_init_ret/Move.toml rename to sui_programmability/adapter/src/unit_tests/data/publish_init_ret/Move.toml diff --git a/fastx_programmability/adapter/src/unit_tests/data/publish_init_ret/sources/M1.move b/sui_programmability/adapter/src/unit_tests/data/publish_init_ret/sources/M1.move similarity index 100% rename from fastx_programmability/adapter/src/unit_tests/data/publish_init_ret/sources/M1.move rename to sui_programmability/adapter/src/unit_tests/data/publish_init_ret/sources/M1.move diff --git a/fastx_programmability/adapter/src/unit_tests/data/simple_call/Move.toml b/sui_programmability/adapter/src/unit_tests/data/simple_call/Move.toml similarity index 100% rename from fastx_programmability/adapter/src/unit_tests/data/simple_call/Move.toml rename to sui_programmability/adapter/src/unit_tests/data/simple_call/Move.toml diff --git a/fastx_programmability/adapter/src/unit_tests/data/simple_call/sources/M1.move b/sui_programmability/adapter/src/unit_tests/data/simple_call/sources/M1.move similarity index 100% rename from fastx_programmability/adapter/src/unit_tests/data/simple_call/sources/M1.move rename to sui_programmability/adapter/src/unit_tests/data/simple_call/sources/M1.move diff --git a/fastx_programmability/examples/Move.toml b/sui_programmability/examples/Move.toml similarity index 100% rename from fastx_programmability/examples/Move.toml rename to sui_programmability/examples/Move.toml diff --git a/fastx_programmability/examples/sources/CombinableObjects.move b/sui_programmability/examples/sources/CombinableObjects.move similarity index 100% rename from fastx_programmability/examples/sources/CombinableObjects.move rename to sui_programmability/examples/sources/CombinableObjects.move diff --git a/fastx_programmability/examples/sources/CustomObjectTemplate.move b/sui_programmability/examples/sources/CustomObjectTemplate.move similarity index 100% rename from fastx_programmability/examples/sources/CustomObjectTemplate.move rename to sui_programmability/examples/sources/CustomObjectTemplate.move diff --git a/fastx_programmability/examples/sources/EconMod.move b/sui_programmability/examples/sources/EconMod.move similarity index 100% rename from fastx_programmability/examples/sources/EconMod.move rename to sui_programmability/examples/sources/EconMod.move diff --git a/fastx_programmability/examples/sources/Hero.move b/sui_programmability/examples/sources/Hero.move similarity index 100% rename from fastx_programmability/examples/sources/Hero.move rename to sui_programmability/examples/sources/Hero.move diff --git a/fastx_programmability/examples/sources/HeroMod.move b/sui_programmability/examples/sources/HeroMod.move similarity index 100% rename from fastx_programmability/examples/sources/HeroMod.move rename to sui_programmability/examples/sources/HeroMod.move diff --git a/fastx_programmability/examples/sources/TrustedCoin.move b/sui_programmability/examples/sources/TrustedCoin.move similarity index 100% rename from fastx_programmability/examples/sources/TrustedCoin.move rename to sui_programmability/examples/sources/TrustedCoin.move diff --git a/fastx_programmability/framework/Cargo.toml b/sui_programmability/framework/Cargo.toml similarity index 92% rename from fastx_programmability/framework/Cargo.toml rename to sui_programmability/framework/Cargo.toml index c137788a0532d..a256dc932632d 100644 --- a/fastx_programmability/framework/Cargo.toml +++ b/sui_programmability/framework/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "fastx-framework" +name = "sui-framework" version = "0.1.0" edition = "2021" authors = ["Mysten Labs "] @@ -12,8 +12,8 @@ anyhow = "1.0.53" smallvec = "1.8.0" num_enum = "0.5.6" -fastx-types = { path = "../../fastx_types" } -fastx-verifier = { path = "../verifier" } +sui-types = { path = "../../sui_types" } +sui-verifier = { path = "../verifier" } move-binary-format = { git = "https://github.com/diem/move", rev="1e5e36cb1fede8073c8688886a0943bb5bfe40d5" } move-bytecode-verifier = { git = "https://github.com/diem/move", rev="1e5e36cb1fede8073c8688886a0943bb5bfe40d5" } diff --git a/fastx_programmability/framework/Move.toml b/sui_programmability/framework/Move.toml similarity index 100% rename from fastx_programmability/framework/Move.toml rename to sui_programmability/framework/Move.toml diff --git a/fastx_programmability/framework/README.md b/sui_programmability/framework/README.md similarity index 92% rename from fastx_programmability/framework/README.md rename to sui_programmability/framework/README.md index 15c7b8bc290f9..66c147ca12c35 100644 --- a/fastx_programmability/framework/README.md +++ b/sui_programmability/framework/README.md @@ -16,6 +16,6 @@ For reading/editing Move, your best bet is vscode + this [plugin](https://market ### Building ``` -# Inside the fastx_programmability/framework dir +# Inside the sui_programmability/framework dir move package -d build ``` diff --git a/fastx_programmability/framework/deps/move-stdlib/Move.toml b/sui_programmability/framework/deps/move-stdlib/Move.toml similarity index 100% rename from fastx_programmability/framework/deps/move-stdlib/Move.toml rename to sui_programmability/framework/deps/move-stdlib/Move.toml diff --git a/fastx_programmability/framework/deps/move-stdlib/sources/ASCII.move b/sui_programmability/framework/deps/move-stdlib/sources/ASCII.move similarity index 100% rename from fastx_programmability/framework/deps/move-stdlib/sources/ASCII.move rename to sui_programmability/framework/deps/move-stdlib/sources/ASCII.move diff --git a/fastx_programmability/framework/deps/move-stdlib/sources/BCS.move b/sui_programmability/framework/deps/move-stdlib/sources/BCS.move similarity index 100% rename from fastx_programmability/framework/deps/move-stdlib/sources/BCS.move rename to sui_programmability/framework/deps/move-stdlib/sources/BCS.move diff --git a/fastx_programmability/framework/deps/move-stdlib/sources/BitVector.move b/sui_programmability/framework/deps/move-stdlib/sources/BitVector.move similarity index 100% rename from fastx_programmability/framework/deps/move-stdlib/sources/BitVector.move rename to sui_programmability/framework/deps/move-stdlib/sources/BitVector.move diff --git a/fastx_programmability/framework/deps/move-stdlib/sources/Capability.move b/sui_programmability/framework/deps/move-stdlib/sources/Capability.move similarity index 100% rename from fastx_programmability/framework/deps/move-stdlib/sources/Capability.move rename to sui_programmability/framework/deps/move-stdlib/sources/Capability.move diff --git a/fastx_programmability/framework/deps/move-stdlib/sources/Errors.move b/sui_programmability/framework/deps/move-stdlib/sources/Errors.move similarity index 100% rename from fastx_programmability/framework/deps/move-stdlib/sources/Errors.move rename to sui_programmability/framework/deps/move-stdlib/sources/Errors.move diff --git a/fastx_programmability/framework/deps/move-stdlib/sources/FixedPoint32.move b/sui_programmability/framework/deps/move-stdlib/sources/FixedPoint32.move similarity index 100% rename from fastx_programmability/framework/deps/move-stdlib/sources/FixedPoint32.move rename to sui_programmability/framework/deps/move-stdlib/sources/FixedPoint32.move diff --git a/fastx_programmability/framework/deps/move-stdlib/sources/GUID.move b/sui_programmability/framework/deps/move-stdlib/sources/GUID.move similarity index 100% rename from fastx_programmability/framework/deps/move-stdlib/sources/GUID.move rename to sui_programmability/framework/deps/move-stdlib/sources/GUID.move diff --git a/fastx_programmability/framework/deps/move-stdlib/sources/Hash.move b/sui_programmability/framework/deps/move-stdlib/sources/Hash.move similarity index 100% rename from fastx_programmability/framework/deps/move-stdlib/sources/Hash.move rename to sui_programmability/framework/deps/move-stdlib/sources/Hash.move diff --git a/fastx_programmability/framework/deps/move-stdlib/sources/Option.move b/sui_programmability/framework/deps/move-stdlib/sources/Option.move similarity index 100% rename from fastx_programmability/framework/deps/move-stdlib/sources/Option.move rename to sui_programmability/framework/deps/move-stdlib/sources/Option.move diff --git a/fastx_programmability/framework/deps/move-stdlib/sources/Signer.move b/sui_programmability/framework/deps/move-stdlib/sources/Signer.move similarity index 100% rename from fastx_programmability/framework/deps/move-stdlib/sources/Signer.move rename to sui_programmability/framework/deps/move-stdlib/sources/Signer.move diff --git a/fastx_programmability/framework/deps/move-stdlib/sources/UnitTest.move b/sui_programmability/framework/deps/move-stdlib/sources/UnitTest.move similarity index 100% rename from fastx_programmability/framework/deps/move-stdlib/sources/UnitTest.move rename to sui_programmability/framework/deps/move-stdlib/sources/UnitTest.move diff --git a/fastx_programmability/framework/deps/move-stdlib/sources/Vector.move b/sui_programmability/framework/deps/move-stdlib/sources/Vector.move similarity index 100% rename from fastx_programmability/framework/deps/move-stdlib/sources/Vector.move rename to sui_programmability/framework/deps/move-stdlib/sources/Vector.move diff --git a/fastx_programmability/framework/sources/Address.move b/sui_programmability/framework/sources/Address.move similarity index 100% rename from fastx_programmability/framework/sources/Address.move rename to sui_programmability/framework/sources/Address.move diff --git a/fastx_programmability/framework/sources/Coin.move b/sui_programmability/framework/sources/Coin.move similarity index 100% rename from fastx_programmability/framework/sources/Coin.move rename to sui_programmability/framework/sources/Coin.move diff --git a/fastx_programmability/framework/sources/Collection.move b/sui_programmability/framework/sources/Collection.move similarity index 100% rename from fastx_programmability/framework/sources/Collection.move rename to sui_programmability/framework/sources/Collection.move diff --git a/fastx_programmability/framework/sources/Escrow.move b/sui_programmability/framework/sources/Escrow.move similarity index 100% rename from fastx_programmability/framework/sources/Escrow.move rename to sui_programmability/framework/sources/Escrow.move diff --git a/fastx_programmability/framework/sources/Event.move b/sui_programmability/framework/sources/Event.move similarity index 100% rename from fastx_programmability/framework/sources/Event.move rename to sui_programmability/framework/sources/Event.move diff --git a/fastx_programmability/framework/sources/GAS.move b/sui_programmability/framework/sources/GAS.move similarity index 100% rename from fastx_programmability/framework/sources/GAS.move rename to sui_programmability/framework/sources/GAS.move diff --git a/fastx_programmability/framework/sources/ID.move b/sui_programmability/framework/sources/ID.move similarity index 100% rename from fastx_programmability/framework/sources/ID.move rename to sui_programmability/framework/sources/ID.move diff --git a/fastx_programmability/framework/sources/Math.move b/sui_programmability/framework/sources/Math.move similarity index 100% rename from fastx_programmability/framework/sources/Math.move rename to sui_programmability/framework/sources/Math.move diff --git a/fastx_programmability/framework/sources/ObjectBasics.move b/sui_programmability/framework/sources/ObjectBasics.move similarity index 100% rename from fastx_programmability/framework/sources/ObjectBasics.move rename to sui_programmability/framework/sources/ObjectBasics.move diff --git a/fastx_programmability/framework/sources/Transfer.move b/sui_programmability/framework/sources/Transfer.move similarity index 100% rename from fastx_programmability/framework/sources/Transfer.move rename to sui_programmability/framework/sources/Transfer.move diff --git a/fastx_programmability/framework/sources/TxContext.move b/sui_programmability/framework/sources/TxContext.move similarity index 100% rename from fastx_programmability/framework/sources/TxContext.move rename to sui_programmability/framework/sources/TxContext.move diff --git a/fastx_programmability/framework/src/lib.rs b/sui_programmability/framework/src/lib.rs similarity index 94% rename from fastx_programmability/framework/src/lib.rs rename to sui_programmability/framework/src/lib.rs index fe29e3b509566..9c1973e43cb12 100644 --- a/fastx_programmability/framework/src/lib.rs +++ b/sui_programmability/framework/src/lib.rs @@ -1,14 +1,14 @@ // Copyright (c) Mysten Labs // SPDX-License-Identifier: Apache-2.0 -use fastx_types::error::{SuiError, SuiResult}; -use fastx_verifier::verifier as fastx_bytecode_verifier; use move_binary_format::CompiledModule; use move_core_types::{account_address::AccountAddress, ident_str}; use move_package::BuildConfig; use num_enum::TryFromPrimitive; use std::collections::HashSet; use std::path::{Path, PathBuf}; +use sui_types::error::{SuiError, SuiResult}; +use sui_verifier::verifier as sui_bytecode_verifier; pub mod natives; @@ -34,7 +34,7 @@ pub enum EventType { User, } -pub fn get_fastx_framework_modules() -> Vec { +pub fn get_sui_framework_modules() -> Vec { let modules = build_framework("."); verify_modules(&modules); modules @@ -140,7 +140,7 @@ pub fn build_move_package( fn verify_modules(modules: &[CompiledModule]) { for m in modules { move_bytecode_verifier::verify_module(m).unwrap(); - fastx_bytecode_verifier::verify_module(m).unwrap(); + sui_bytecode_verifier::verify_module(m).unwrap(); } // TODO(https://github.com/MystenLabs/fastnft/issues/69): Run Move linker } @@ -170,14 +170,14 @@ fn get_examples() -> Vec { #[test] fn check_that_move_code_can_be_built_verified_tested() { - get_fastx_framework_modules(); + get_sui_framework_modules(); get_examples(); } #[test] fn run_move_unit_tests() { - use fastx_types::{FASTX_FRAMEWORK_ADDRESS, MOVE_STDLIB_ADDRESS}; use move_cli::package::cli::{self, UnitTestResult}; + use sui_types::{MOVE_STDLIB_ADDRESS, SUI_FRAMEWORK_ADDRESS}; use move_unit_test::UnitTestingConfig; use std::path::Path; @@ -190,7 +190,7 @@ fn run_move_unit_tests() { ..Default::default() }, UnitTestingConfig::default_with_bound(Some(MAX_UNIT_TEST_INSTRUCTIONS)), - natives::all_natives(MOVE_STDLIB_ADDRESS, FASTX_FRAMEWORK_ADDRESS), + natives::all_natives(MOVE_STDLIB_ADDRESS, SUI_FRAMEWORK_ADDRESS), /* compute_coverage */ false, ) .unwrap(); diff --git a/fastx_programmability/framework/src/natives/event.rs b/sui_programmability/framework/src/natives/event.rs similarity index 100% rename from fastx_programmability/framework/src/natives/event.rs rename to sui_programmability/framework/src/natives/event.rs diff --git a/fastx_programmability/framework/src/natives/id.rs b/sui_programmability/framework/src/natives/id.rs similarity index 100% rename from fastx_programmability/framework/src/natives/id.rs rename to sui_programmability/framework/src/natives/id.rs diff --git a/fastx_programmability/framework/src/natives/mod.rs b/sui_programmability/framework/src/natives/mod.rs similarity index 87% rename from fastx_programmability/framework/src/natives/mod.rs rename to sui_programmability/framework/src/natives/mod.rs index 0c09d6edced20..110c81e333677 100644 --- a/fastx_programmability/framework/src/natives/mod.rs +++ b/sui_programmability/framework/src/natives/mod.rs @@ -11,9 +11,9 @@ use move_vm_runtime::native_functions::{NativeFunction, NativeFunctionTable}; pub fn all_natives( move_stdlib_addr: AccountAddress, - fastx_framework_addr: AccountAddress, + sui_framework_addr: AccountAddress, ) -> NativeFunctionTable { - const FASTX_NATIVES: &[(&str, &str, NativeFunction)] = &[ + const SUI_NATIVES: &[(&str, &str, NativeFunction)] = &[ ("Event", "emit", event::emit), ("ID", "bytes_to_address", id::bytes_to_address), ("ID", "delete", id::delete), @@ -26,12 +26,12 @@ pub fn all_natives( ), ("TxContext", "fresh_id", tx_context::fresh_id), ]; - FASTX_NATIVES + SUI_NATIVES .iter() .cloned() .map(|(module_name, func_name, func)| { ( - fastx_framework_addr, + sui_framework_addr, Identifier::new(module_name).unwrap(), Identifier::new(func_name).unwrap(), func, diff --git a/fastx_programmability/framework/src/natives/transfer.rs b/sui_programmability/framework/src/natives/transfer.rs similarity index 100% rename from fastx_programmability/framework/src/natives/transfer.rs rename to sui_programmability/framework/src/natives/transfer.rs diff --git a/fastx_programmability/framework/src/natives/tx_context.rs b/sui_programmability/framework/src/natives/tx_context.rs similarity index 96% rename from fastx_programmability/framework/src/natives/tx_context.rs rename to sui_programmability/framework/src/natives/tx_context.rs index 23819f6470cfd..9d042e1e69eba 100644 --- a/fastx_programmability/framework/src/natives/tx_context.rs +++ b/sui_programmability/framework/src/natives/tx_context.rs @@ -1,7 +1,6 @@ // Copyright (c) Mysten Labs // SPDX-License-Identifier: Apache-2.0 -use fastx_types::base_types::TransactionDigest; use move_binary_format::errors::PartialVMResult; use move_vm_runtime::native_functions::NativeContext; use move_vm_types::{ @@ -13,6 +12,7 @@ use move_vm_types::{ }; use smallvec::smallvec; use std::{collections::VecDeque, convert::TryFrom}; +use sui_types::base_types::TransactionDigest; pub fn fresh_id( context: &mut NativeContext, diff --git a/fastx_programmability/framework/tests/CollectionTests.move b/sui_programmability/framework/tests/CollectionTests.move similarity index 100% rename from fastx_programmability/framework/tests/CollectionTests.move rename to sui_programmability/framework/tests/CollectionTests.move diff --git a/fastx_programmability/framework/tests/IDTests.move b/sui_programmability/framework/tests/IDTests.move similarity index 100% rename from fastx_programmability/framework/tests/IDTests.move rename to sui_programmability/framework/tests/IDTests.move diff --git a/fastx_programmability/framework/tests/TxContextTests.move b/sui_programmability/framework/tests/TxContextTests.move similarity index 100% rename from fastx_programmability/framework/tests/TxContextTests.move rename to sui_programmability/framework/tests/TxContextTests.move diff --git a/fastx_programmability/verifier/Cargo.toml b/sui_programmability/verifier/Cargo.toml similarity index 88% rename from fastx_programmability/verifier/Cargo.toml rename to sui_programmability/verifier/Cargo.toml index c5962c3998f3f..21f0a2a57c94b 100644 --- a/fastx_programmability/verifier/Cargo.toml +++ b/sui_programmability/verifier/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "fastx-verifier" +name = "sui-verifier" version = "0.1.0" edition = "2021" authors = ["Mysten Labs "] @@ -12,4 +12,4 @@ move-binary-format = { git = "https://github.com/diem/move", rev="1e5e36cb1fede8 move-bytecode-verifier = { git = "https://github.com/diem/move", rev="1e5e36cb1fede8073c8688886a0943bb5bfe40d5" } move-core-types = { git = "https://github.com/diem/move", rev="1e5e36cb1fede8073c8688886a0943bb5bfe40d5", features=["address20"] } -fastx-types = { path = "../../fastx_types" } +sui-types = { path = "../../sui_types" } diff --git a/fastx_programmability/verifier/src/global_storage_access_verifier.rs b/sui_programmability/verifier/src/global_storage_access_verifier.rs similarity index 97% rename from fastx_programmability/verifier/src/global_storage_access_verifier.rs rename to sui_programmability/verifier/src/global_storage_access_verifier.rs index 29fec519cb224..fcdfe48a43188 100644 --- a/fastx_programmability/verifier/src/global_storage_access_verifier.rs +++ b/sui_programmability/verifier/src/global_storage_access_verifier.rs @@ -2,17 +2,17 @@ // SPDX-License-Identifier: Apache-2.0 use crate::verification_failure; -use fastx_types::error::SuiResult; use move_binary_format::{ binary_views::BinaryIndexedView, file_format::{Bytecode, CompiledModule}, }; +use sui_types::error::SuiResult; pub fn verify_module(module: &CompiledModule) -> SuiResult { verify_global_storage_access(module) } -/// Global storage in fastx is handled by fastx instead of within Move. +/// Global storage in sui is handled by sui instead of within Move. /// Hence we want to forbid any global storage access in Move. fn verify_global_storage_access(module: &CompiledModule) -> SuiResult { let view = BinaryIndexedView::Module(module); diff --git a/fastx_programmability/verifier/src/id_immutable_verifier.rs b/sui_programmability/verifier/src/id_immutable_verifier.rs similarity index 98% rename from fastx_programmability/verifier/src/id_immutable_verifier.rs rename to sui_programmability/verifier/src/id_immutable_verifier.rs index a54939b8caa6d..13f8f61a88268 100644 --- a/fastx_programmability/verifier/src/id_immutable_verifier.rs +++ b/sui_programmability/verifier/src/id_immutable_verifier.rs @@ -8,11 +8,11 @@ //! an ID field. use crate::verification_failure; -use fastx_types::error::SuiResult; use move_binary_format::{ binary_views::BinaryIndexedView, file_format::{Bytecode, CompiledModule, FieldHandleIndex}, }; +use sui_types::error::SuiResult; pub fn verify_module(module: &CompiledModule) -> SuiResult { verify_id_immutable(module) diff --git a/fastx_programmability/verifier/src/id_leak_verifier.rs b/sui_programmability/verifier/src/id_leak_verifier.rs similarity index 99% rename from fastx_programmability/verifier/src/id_leak_verifier.rs rename to sui_programmability/verifier/src/id_leak_verifier.rs index 97e0eea8fa0fb..a27d9824c0ea3 100644 --- a/fastx_programmability/verifier/src/id_leak_verifier.rs +++ b/sui_programmability/verifier/src/id_leak_verifier.rs @@ -14,10 +14,6 @@ //! 4. Passed to a function call use crate::verification_failure; -use fastx_types::{ - error::{SuiError, SuiResult}, - FASTX_FRAMEWORK_ADDRESS, -}; use move_binary_format::{ binary_views::{BinaryIndexedView, FunctionView}, file_format::{ @@ -30,6 +26,10 @@ use move_bytecode_verifier::absint::{ TransferFunctions, }; use std::collections::BTreeMap; +use sui_types::{ + error::{SuiError, SuiResult}, + SUI_FRAMEWORK_ADDRESS, +}; #[derive(Clone, Copy, Debug, Eq, PartialEq)] enum AbstractValue { @@ -168,7 +168,7 @@ fn is_call_safe_to_leak(verifier: &IDLeakAnalysis, function_handle: &FunctionHan let m = verifier .binary_view .module_handle_at(function_handle.module); - verifier.binary_view.address_identifier_at(m.address) == &FASTX_FRAMEWORK_ADDRESS + verifier.binary_view.address_identifier_at(m.address) == &SUI_FRAMEWORK_ADDRESS && verifier.binary_view.identifier_at(m.name).as_str() == "ID" && verifier .binary_view diff --git a/fastx_programmability/verifier/src/lib.rs b/sui_programmability/verifier/src/lib.rs similarity index 90% rename from fastx_programmability/verifier/src/lib.rs rename to sui_programmability/verifier/src/lib.rs index e4ddc9b46b4b8..3fad944821d8c 100644 --- a/fastx_programmability/verifier/src/lib.rs +++ b/sui_programmability/verifier/src/lib.rs @@ -8,7 +8,7 @@ pub mod id_immutable_verifier; pub mod id_leak_verifier; pub mod struct_with_key_verifier; -use fastx_types::error::SuiError; +use sui_types::error::SuiError; fn verification_failure(error: String) -> SuiError { SuiError::ModuleVerificationFailure { error } diff --git a/fastx_programmability/verifier/src/struct_with_key_verifier.rs b/sui_programmability/verifier/src/struct_with_key_verifier.rs similarity index 87% rename from fastx_programmability/verifier/src/struct_with_key_verifier.rs rename to sui_programmability/verifier/src/struct_with_key_verifier.rs index 62c1ef9e5aa02..fb08163371bbf 100644 --- a/fastx_programmability/verifier/src/struct_with_key_verifier.rs +++ b/sui_programmability/verifier/src/struct_with_key_verifier.rs @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 use crate::verification_failure; -use fastx_types::{error::SuiResult, fp_ensure, FASTX_FRAMEWORK_ADDRESS}; use move_binary_format::{ access::ModuleAccess, binary_views::BinaryIndexedView, file_format::{CompiledModule, SignatureToken}, }; +use sui_types::{error::SuiResult, fp_ensure, SUI_FRAMEWORK_ADDRESS}; pub fn verify_module(module: &CompiledModule) -> SuiResult { verify_key_structs(module) @@ -23,8 +23,8 @@ fn verify_key_structs(module: &CompiledModule) -> SuiResult { } let name = view.identifier_at(handle.name); // Check that a struct with key ability must not have drop ability. - // A struct with key ability represents a fastx object. - // We want to ensure that fastx objects cannot be arbitrarily dropped. + // A struct with key ability represents a sui object. + // We want to ensure that sui objects cannot be arbitrarily dropped. // For example, *x = new_object shouldn't work for a key object x. fp_ensure!( !handle.abilities.has_drop(), @@ -63,7 +63,7 @@ fn verify_key_structs(module: &CompiledModule) -> SuiResult { ))) } }; - // Chech that the struct type for "id" field must be FASTX_FRAMEWORK_ADDRESS::ID::ID. + // Chech that the struct type for "id" field must be SUI_FRAMEWORK_ADDRESS::ID::ID. let id_type_struct = module.struct_handle_at(*id_field_type); let id_type_struct_name = view.identifier_at(id_type_struct.name).as_str(); let id_type_module = module.module_handle_at(id_type_struct.module); @@ -71,12 +71,12 @@ fn verify_key_structs(module: &CompiledModule) -> SuiResult { let id_type_module_name = module.identifier_at(id_type_module.name).to_string(); fp_ensure!( id_type_struct_name == "ID" - && id_type_module_address == &FASTX_FRAMEWORK_ADDRESS + && id_type_module_address == &SUI_FRAMEWORK_ADDRESS && id_type_module_name == "ID", verification_failure(format!( "First field of struct {} must be of type {}::ID::ID, {}::{}::{} type found", name, - FASTX_FRAMEWORK_ADDRESS, + SUI_FRAMEWORK_ADDRESS, id_type_module_address, id_type_module_name, id_type_struct_name diff --git a/fastx_programmability/verifier/src/verifier.rs b/sui_programmability/verifier/src/verifier.rs similarity index 94% rename from fastx_programmability/verifier/src/verifier.rs rename to sui_programmability/verifier/src/verifier.rs index a456b19a4e718..fcde835e9ed28 100644 --- a/fastx_programmability/verifier/src/verifier.rs +++ b/sui_programmability/verifier/src/verifier.rs @@ -3,8 +3,8 @@ //! This module contains the public APIs supported by the bytecode verifier. -use fastx_types::error::SuiResult; use move_binary_format::file_format::CompiledModule; +use sui_types::error::SuiResult; use crate::{ global_storage_access_verifier, id_immutable_verifier, id_leak_verifier, diff --git a/fastx_programmability/verifier/tests/common/mod.rs b/sui_programmability/verifier/tests/common/mod.rs similarity index 100% rename from fastx_programmability/verifier/tests/common/mod.rs rename to sui_programmability/verifier/tests/common/mod.rs diff --git a/fastx_programmability/verifier/tests/common/module_builder.rs b/sui_programmability/verifier/tests/common/module_builder.rs similarity index 98% rename from fastx_programmability/verifier/tests/common/module_builder.rs rename to sui_programmability/verifier/tests/common/module_builder.rs index dce4416796d93..3b9c524dfe712 100644 --- a/fastx_programmability/verifier/tests/common/module_builder.rs +++ b/sui_programmability/verifier/tests/common/module_builder.rs @@ -1,9 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // SPDX-License-Identifier: Apache-2.0 -use fastx_types::FASTX_FRAMEWORK_ADDRESS; use move_binary_format::file_format::*; use move_core_types::{account_address::AccountAddress, identifier::Identifier}; +use sui_types::SUI_FRAMEWORK_ADDRESS; pub struct ModuleBuilder { module: CompiledModule, @@ -52,7 +52,7 @@ impl ModuleBuilder { /// Creates the "ID" module in framework address, along with the "ID" struct. /// Both the module and the ID struct information are returned. pub fn default() -> (Self, StructInfo) { - let mut module = Self::new(FASTX_FRAMEWORK_ADDRESS, "ID"); + let mut module = Self::new(SUI_FRAMEWORK_ADDRESS, "ID"); let id = module.add_struct( module.get_self_index(), "ID", diff --git a/fastx_programmability/verifier/tests/global_storage_access_verification_tests.rs b/sui_programmability/verifier/tests/global_storage_access_verification_tests.rs similarity index 96% rename from fastx_programmability/verifier/tests/global_storage_access_verification_tests.rs rename to sui_programmability/verifier/tests/global_storage_access_verification_tests.rs index 3d2ceac5ed7c9..e31257dc2715e 100644 --- a/fastx_programmability/verifier/tests/global_storage_access_verification_tests.rs +++ b/sui_programmability/verifier/tests/global_storage_access_verification_tests.rs @@ -4,8 +4,8 @@ mod common; pub use common::module_builder::ModuleBuilder; -use fastx_verifier::global_storage_access_verifier::verify_module; use move_binary_format::file_format::*; +use sui_verifier::global_storage_access_verifier::verify_module; #[test] fn function_with_global_access_bytecode() { diff --git a/fastx_programmability/verifier/tests/id_immutable_verification_test.rs b/sui_programmability/verifier/tests/id_immutable_verification_test.rs similarity index 98% rename from fastx_programmability/verifier/tests/id_immutable_verification_test.rs rename to sui_programmability/verifier/tests/id_immutable_verification_test.rs index 1c7e30595bdc3..62cbb810b78f0 100644 --- a/fastx_programmability/verifier/tests/id_immutable_verification_test.rs +++ b/sui_programmability/verifier/tests/id_immutable_verification_test.rs @@ -4,8 +4,8 @@ mod common; pub use common::module_builder::ModuleBuilder; -use fastx_verifier::id_immutable_verifier::verify_module; use move_binary_format::file_format::*; +use sui_verifier::id_immutable_verifier::verify_module; #[test] fn mut_borrow_key_struct_id_field() { diff --git a/fastx_programmability/verifier/tests/id_leak_verification_test.rs b/sui_programmability/verifier/tests/id_leak_verification_test.rs similarity index 98% rename from fastx_programmability/verifier/tests/id_leak_verification_test.rs rename to sui_programmability/verifier/tests/id_leak_verification_test.rs index 43298152cb28e..15be31ea333c6 100644 --- a/fastx_programmability/verifier/tests/id_leak_verification_test.rs +++ b/sui_programmability/verifier/tests/id_leak_verification_test.rs @@ -4,15 +4,15 @@ mod common; pub use common::module_builder::*; -use fastx_verifier::id_leak_verifier::verify_module; use move_binary_format::file_format::*; +use sui_verifier::id_leak_verifier::verify_module; fn make_module_with_default_struct() -> (ModuleBuilder, StructInfo, StructInfo) { /* Creating a module with a default struct Foo: struct Foo has key { - id: FASTX_FRAMEWORK_ADDRESS::ID::ID + id: SUI_FRAMEWORK_ADDRESS::ID::ID } */ let (mut module, id_struct) = ModuleBuilder::default(); diff --git a/fastx_programmability/verifier/tests/struct_with_key_verification_test.rs b/sui_programmability/verifier/tests/struct_with_key_verification_test.rs similarity index 96% rename from fastx_programmability/verifier/tests/struct_with_key_verification_test.rs rename to sui_programmability/verifier/tests/struct_with_key_verification_test.rs index da157efad759c..0a4f7c669b385 100644 --- a/fastx_programmability/verifier/tests/struct_with_key_verification_test.rs +++ b/sui_programmability/verifier/tests/struct_with_key_verification_test.rs @@ -4,10 +4,10 @@ mod common; pub use common::module_builder::ModuleBuilder; -use fastx_types::FASTX_FRAMEWORK_ADDRESS; -use fastx_verifier::struct_with_key_verifier::verify_module; use move_binary_format::file_format::*; use move_core_types::account_address::AccountAddress; +use sui_types::SUI_FRAMEWORK_ADDRESS; +use sui_verifier::struct_with_key_verifier::verify_module; #[test] fn key_struct_with_drop() { @@ -114,7 +114,7 @@ fn key_struct_id_field_incorrect_struct_address() { let err_str = verify_module(module.get_module()).unwrap_err().to_string(); assert!(err_str.contains(&format!( "First field of struct S must be of type {}::ID::ID, {}::ID::ID type found", - FASTX_FRAMEWORK_ADDRESS, addr + SUI_FRAMEWORK_ADDRESS, addr ))); } @@ -138,7 +138,7 @@ fn key_struct_id_field_incorrect_struct_name() { .to_string() .contains(&format!( "First field of struct S must be of type {0}::ID::ID, {0}::ID::FOO type found", - FASTX_FRAMEWORK_ADDRESS + SUI_FRAMEWORK_ADDRESS ))); } diff --git a/fastx_types/Cargo.toml b/sui_types/Cargo.toml similarity index 98% rename from fastx_types/Cargo.toml rename to sui_types/Cargo.toml index 0ed7f5d26936b..3034339a949e0 100644 --- a/fastx_types/Cargo.toml +++ b/sui_types/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "fastx-types" +name = "sui-types" version = "0.1.0" authors = ["Mysten Labs "] license = "Apache-2.0" diff --git a/fastx_types/src/base_types.rs b/sui_types/src/base_types.rs similarity index 100% rename from fastx_types/src/base_types.rs rename to sui_types/src/base_types.rs diff --git a/fastx_types/src/coin.rs b/sui_types/src/coin.rs similarity index 94% rename from fastx_types/src/coin.rs rename to sui_types/src/coin.rs index 12308a103723a..07ce7e6c9accc 100644 --- a/fastx_types/src/coin.rs +++ b/sui_types/src/coin.rs @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; use crate::{ base_types::{ObjectID, SequenceNumber}, id::ID, - FASTX_FRAMEWORK_ADDRESS, + SUI_FRAMEWORK_ADDRESS, }; pub const COIN_MODULE_NAME: &IdentStr = ident_str!("Coin"); @@ -31,7 +31,7 @@ impl Coin { pub fn type_(type_param: StructTag) -> StructTag { StructTag { - address: FASTX_FRAMEWORK_ADDRESS, + address: SUI_FRAMEWORK_ADDRESS, name: COIN_STRUCT_NAME.to_owned(), module: COIN_MODULE_NAME.to_owned(), type_params: vec![TypeTag::Struct(type_param)], diff --git a/fastx_types/src/committee.rs b/sui_types/src/committee.rs similarity index 100% rename from fastx_types/src/committee.rs rename to sui_types/src/committee.rs diff --git a/fastx_types/src/error.rs b/sui_types/src/error.rs similarity index 100% rename from fastx_types/src/error.rs rename to sui_types/src/error.rs diff --git a/fastx_types/src/event.rs b/sui_types/src/event.rs similarity index 100% rename from fastx_types/src/event.rs rename to sui_types/src/event.rs diff --git a/fastx_types/src/gas.rs b/sui_types/src/gas.rs similarity index 100% rename from fastx_types/src/gas.rs rename to sui_types/src/gas.rs diff --git a/fastx_types/src/gas_coin.rs b/sui_types/src/gas_coin.rs similarity index 97% rename from fastx_types/src/gas_coin.rs rename to sui_types/src/gas_coin.rs index 84e201af3236d..76b4ae8b68c9a 100644 --- a/fastx_types/src/gas_coin.rs +++ b/sui_types/src/gas_coin.rs @@ -15,7 +15,7 @@ use crate::{ error::{SuiError, SuiResult}, id::ID, object::{Data, MoveObject, Object}, - FASTX_FRAMEWORK_ADDRESS, + SUI_FRAMEWORK_ADDRESS, }; pub const GAS_MODULE_NAME: &IdentStr = ident_str!("GAS"); @@ -25,7 +25,7 @@ pub struct GAS {} impl GAS { pub fn type_() -> StructTag { StructTag { - address: FASTX_FRAMEWORK_ADDRESS, + address: SUI_FRAMEWORK_ADDRESS, name: GAS_STRUCT_NAME.to_owned(), module: GAS_MODULE_NAME.to_owned(), type_params: Vec::new(), diff --git a/fastx_types/src/id.rs b/sui_types/src/id.rs similarity index 94% rename from fastx_types/src/id.rs rename to sui_types/src/id.rs index add57a3b17b7f..9ee4d05450246 100644 --- a/fastx_types/src/id.rs +++ b/sui_types/src/id.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; use crate::{ base_types::{ObjectID, SequenceNumber}, - FASTX_FRAMEWORK_ADDRESS, + SUI_FRAMEWORK_ADDRESS, }; pub const ID_MODULE_NAME: &IdentStr = ident_str!("ID"); @@ -35,7 +35,7 @@ impl ID { pub fn type_() -> StructTag { StructTag { - address: FASTX_FRAMEWORK_ADDRESS, + address: SUI_FRAMEWORK_ADDRESS, name: ID_STRUCT_NAME.to_owned(), module: ID_MODULE_NAME.to_owned(), type_params: Vec::new(), diff --git a/fastx_types/src/lib.rs b/sui_types/src/lib.rs similarity index 91% rename from fastx_types/src/lib.rs rename to sui_types/src/lib.rs index 9161101f15a17..a76fe1996aad6 100644 --- a/fastx_types/src/lib.rs +++ b/sui_types/src/lib.rs @@ -29,7 +29,7 @@ pub mod storage; pub const MOVE_STDLIB_ADDRESS: AccountAddress = AccountAddress::ONE; /// 0x2-- account address where fastX framework modules are stored -pub const FASTX_FRAMEWORK_ADDRESS: AccountAddress = get_hex_address_two(); +pub const SUI_FRAMEWORK_ADDRESS: AccountAddress = get_hex_address_two(); const fn get_hex_address_two() -> AccountAddress { let mut addr = [0u8; AccountAddress::LENGTH]; diff --git a/fastx_types/src/messages.rs b/sui_types/src/messages.rs similarity index 100% rename from fastx_types/src/messages.rs rename to sui_types/src/messages.rs diff --git a/fastx_types/src/object.rs b/sui_types/src/object.rs similarity index 100% rename from fastx_types/src/object.rs rename to sui_types/src/object.rs diff --git a/fastx_types/src/serialize.rs b/sui_types/src/serialize.rs similarity index 100% rename from fastx_types/src/serialize.rs rename to sui_types/src/serialize.rs diff --git a/fastx_types/src/storage.rs b/sui_types/src/storage.rs similarity index 100% rename from fastx_types/src/storage.rs rename to sui_types/src/storage.rs diff --git a/fastx_types/src/unit_tests/base_types_tests.rs b/sui_types/src/unit_tests/base_types_tests.rs similarity index 100% rename from fastx_types/src/unit_tests/base_types_tests.rs rename to sui_types/src/unit_tests/base_types_tests.rs diff --git a/fastx_types/src/unit_tests/messages_tests.rs b/sui_types/src/unit_tests/messages_tests.rs similarity index 100% rename from fastx_types/src/unit_tests/messages_tests.rs rename to sui_types/src/unit_tests/messages_tests.rs diff --git a/fastx_types/src/unit_tests/serialize_tests.rs b/sui_types/src/unit_tests/serialize_tests.rs similarity index 100% rename from fastx_types/src/unit_tests/serialize_tests.rs rename to sui_types/src/unit_tests/serialize_tests.rs