Skip to content

Commit

Permalink
[chore, move] Lowercase all the modules and addresses (MystenLabs#2558)
Browse files Browse the repository at this point in the history
  • Loading branch information
damirka authored Jun 15, 2022
1 parent 8452df8 commit ca37ecc
Show file tree
Hide file tree
Showing 255 changed files with 4,255 additions and 4,227 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/generate-json-rpc-spec/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ async fn get_nft_response(

let result = WalletCommands::Call {
package: ObjectID::from(SUI_FRAMEWORK_ADDRESS),
module: "DevNetNFT".to_string(),
module: "devnet_nft".to_string(),
function: "mint".to_string(),
type_args: vec![],
args,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ written: object(104)

task 3 'view-object'. lines 32-32:
Owner: Account Address ( A )
Contents: Test::M1::Object {id: Sui::ID::VersionedID {id: Sui::ID::UniqueID {id: Sui::ID::ID {bytes: fake(105)}}, version: 1u64}, value: 0u64}
Contents: Test::M1::Object {id: sui::id::VersionedID {id: sui::id::UniqueID {id: sui::id::ID {bytes: fake(105)}}, version: 1u64}, value: 0u64}
12 changes: 6 additions & 6 deletions crates/sui-adapter-transactional-tests/tests/call/simple.move
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

//# publish
module Test::M1 {
use Sui::ID::VersionedID;
use Sui::TxContext::{Self, TxContext};
use Sui::Transfer;
use Sui::Coin::Coin;
use sui::id::VersionedID;
use sui::tx_context::{Self, TxContext};
use sui::transfer;
use sui::coin::Coin;

struct Object has key, store {
id: VersionedID,
Expand All @@ -20,8 +20,8 @@ module Test::M1 {
}

public entry fun create(value: u64, recipient: address, ctx: &mut TxContext) {
Transfer::transfer(
Object { id: TxContext::new_id(ctx), value },
transfer::transfer(
Object { id: tx_context::new_id(ctx), value },
recipient
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@
//# publish

module T3::O3 {
use Sui::ID::VersionedID;
use Sui::Transfer;
use Sui::TxContext::{Self, TxContext};
use sui::id::VersionedID;
use sui::transfer;
use sui::tx_context::{Self, TxContext};

struct O3 has key, store {
id: VersionedID,
}

public entry fun create(ctx: &mut TxContext) {
let o = O3 { id: TxContext::new_id(ctx) };
Transfer::transfer(o, TxContext::sender(ctx))
let o = O3 { id: tx_context::new_id(ctx) };
transfer::transfer(o, tx_context::sender(ctx))
}
}

//# publish

module T2::O2 {
use Sui::ID::VersionedID;
use Sui::Transfer::{Self, ChildRef};
use Sui::TxContext::{Self, TxContext};
use sui::id::VersionedID;
use sui::transfer::{Self, ChildRef};
use sui::tx_context::{Self, TxContext};
use T3::O3::O3;

struct O2 has key, store {
Expand All @@ -34,18 +34,18 @@ module T2::O2 {
}

public entry fun create_shared(child: O3, ctx: &mut TxContext) {
Transfer::share_object(new(child, ctx))
transfer::share_object(new(child, ctx))
}

public entry fun create_owned(child: O3, ctx: &mut TxContext) {
Transfer::transfer(new(child, ctx), TxContext::sender(ctx))
transfer::transfer(new(child, ctx), tx_context::sender(ctx))
}

public entry fun use_o2_o3(_o2: &mut O2, _o3: &mut O3) {}

fun new(child: O3, ctx: &mut TxContext): O2 {
let id = TxContext::new_id(ctx);
let (id, child) = Transfer::transfer_to_object_id(child, id);
let id = tx_context::new_id(ctx);
let (id, child) = transfer::transfer_to_object_id(child, id);
O2 { id, child }
}
}
Expand All @@ -54,9 +54,9 @@ module T2::O2 {
//# publish

module T1::O1 {
use Sui::ID::VersionedID;
use Sui::Transfer::{Self, ChildRef};
use Sui::TxContext::{Self, TxContext};
use sui::id::VersionedID;
use sui::transfer::{Self, ChildRef};
use sui::tx_context::{Self, TxContext};
use T2::O2::O2;
use T3::O3::O3;

Expand All @@ -66,15 +66,15 @@ module T1::O1 {
}

public entry fun create_shared(child: O2, ctx: &mut TxContext) {
Transfer::share_object(new(child, ctx))
transfer::share_object(new(child, ctx))
}

// This function will be invalid if _o2 is a shared object and owns _o3.
public entry fun use_o2_o3(_o2: &mut O2, _o3: &mut O3) {}

fun new(child: O2, ctx: &mut TxContext): O1 {
let id = TxContext::new_id(ctx);
let (id, child) = Transfer::transfer_to_object_id(child, id);
let id = tx_context::new_id(ctx);
let (id, child) = transfer::transfer_to_object_id(child, id);
O1 { id, child }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@

//# publish
module Test::M {
use Sui::TxContext::{Self, TxContext};
use sui::tx_context::{Self, TxContext};
struct Obj has key {
id: Sui::ID::VersionedID,
id: sui::id::VersionedID,
value: u64
}

public entry fun mint(ctx: &mut TxContext) {
Sui::Transfer::transfer(
Obj { id: TxContext::new_id(ctx), value: 0 },
TxContext::sender(ctx),
sui::transfer::transfer(
Obj { id: tx_context::new_id(ctx), value: 0 },
tx_context::sender(ctx),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

//# publish
module Test::M {
use Sui::TxContext::TxContext;
use sui::tx_context::TxContext;

public fun t1(_: &mut TxContext) {
abort 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ written: object(102)

task 2 'view-object'. lines 25-25:
Owner: Account Address ( _ )
Contents: Test::M1::Object {id: Sui::ID::VersionedID {id: Sui::ID::UniqueID {id: Sui::ID::ID {bytes: fake(104)}}, version: 1u64}, value: 42u64}
Contents: Test::M1::Object {id: sui::id::VersionedID {id: sui::id::UniqueID {id: sui::id::ID {bytes: fake(104)}}, version: 1u64}, value: 42u64}

task 3 'view-object'. lines 27-27:
103::M1
10 changes: 5 additions & 5 deletions crates/sui-adapter-transactional-tests/tests/publish/init.move
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

//# publish
module Test::M1 {
use Sui::ID::VersionedID;
use Sui::TxContext::{Self, TxContext};
use Sui::Transfer;
use sui::id::VersionedID;
use sui::tx_context::{Self, TxContext};
use sui::transfer;

struct Object has key, store {
id: VersionedID,
Expand All @@ -17,8 +17,8 @@ module Test::M1 {
// initializer that should be executed upon publishing this module
fun init(ctx: &mut TxContext) {
let value = 42;
let singleton = Object { id: TxContext::new_id(ctx), value };
Transfer::transfer(singleton, TxContext::sender(ctx))
let singleton = Object { id: tx_context::new_id(ctx), value };
transfer::transfer(singleton, tx_context::sender(ctx))
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
processed 2 tasks

task 1 'publish'. lines 5-24:
Error: Failed to verify the Move module, reason: "Expected exactly one parameter for _::M1::init of type &mut Sui::TxContext::TxContext".
Error: Failed to verify the Move module, reason: "Expected exactly one parameter for _::M1::init of type &mut sui::tx_context::TxContext".
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
// initializer not valid due extra non-ctx param

module Test::M1 {
use Sui::ID::VersionedID;
use Sui::TxContext::{Self, TxContext};
use Sui::Transfer;
use sui::id::VersionedID;
use sui::tx_context::{Self, TxContext};
use sui::transfer;

struct Object has key, store {
id: VersionedID,
Expand All @@ -18,7 +18,7 @@ module Test::M1 {

// value param invalid
fun init(ctx: &mut TxContext, value: u64) {
let singleton = Object { id: TxContext::new_id(ctx), value };
Transfer::transfer(singleton, TxContext::sender(ctx))
let singleton = Object { id: tx_context::new_id(ctx), value };
transfer::transfer(singleton, tx_context::sender(ctx))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
// initializer not valid due to public visibility

module Test::M1 {
use Sui::ID::VersionedID;
use Sui::TxContext::{Self, TxContext};
use Sui::Transfer;
use sui::id::VersionedID;
use sui::tx_context::{Self, TxContext};
use sui::transfer;

struct Object has key, store {
id: VersionedID,
Expand All @@ -19,7 +19,7 @@ module Test::M1 {
// public initializer - should not be executed
public fun init(ctx: &mut TxContext) {
let value = 42;
let singleton = Object { id: TxContext::new_id(ctx), value };
Transfer::transfer(singleton, TxContext::sender(ctx))
let singleton = Object { id: tx_context::new_id(ctx), value };
transfer::transfer(singleton, tx_context::sender(ctx))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
// initializer not valid due to return value

module Test::M1 {
use Sui::ID::VersionedID;
use Sui::TxContext::{Self, TxContext};
use Sui::Transfer;
use sui::id::VersionedID;
use sui::tx_context::{Self, TxContext};
use sui::transfer;

struct Object has key, store {
id: VersionedID,
Expand All @@ -19,8 +19,8 @@ module Test::M1 {
// initializer that should be executed upon publishing this module
fun init(ctx: &mut TxContext): u64 {
let value = 42;
let singleton = Object { id: TxContext::new_id(ctx), value };
Transfer::transfer(singleton, TxContext::sender(ctx));
let singleton = Object { id: tx_context::new_id(ctx), value };
transfer::transfer(singleton, tx_context::sender(ctx));
value
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ A: object(100), B: object(101), C: object(102)

task 1 'view-object'. lines 8-8:
Owner: Account Address ( A )
Contents: Sui::Coin::Coin<Sui::SUI::SUI> {id: Sui::ID::VersionedID {id: Sui::ID::UniqueID {id: Sui::ID::ID {bytes: fake(100)}}, version: 0u64}, balance: Sui::Balance::Balance<Sui::SUI::SUI> {value: 100000u64}}
Contents: sui::coin::Coin<sui::sui::SUI> {id: sui::id::VersionedID {id: sui::id::UniqueID {id: sui::id::ID {bytes: fake(100)}}, version: 0u64}, balance: sui::balance::Balance<sui::sui::SUI> {value: 100000u64}}

task 2 'run'. lines 10-10:
created: object(106)
written: object(100), object(105)

task 3 'view-object'. lines 12-12:
Owner: Account Address ( A )
Contents: Sui::Coin::Coin<Sui::SUI::SUI> {id: Sui::ID::VersionedID {id: Sui::ID::UniqueID {id: Sui::ID::ID {bytes: fake(100)}}, version: 1u64}, balance: Sui::Balance::Balance<Sui::SUI::SUI> {value: 99990u64}}
Contents: sui::coin::Coin<sui::sui::SUI> {id: sui::id::VersionedID {id: sui::id::UniqueID {id: sui::id::ID {bytes: fake(100)}}, version: 1u64}, balance: sui::balance::Balance<sui::sui::SUI> {value: 99990u64}}

task 4 'view-object'. lines 14-14:
Owner: Account Address ( B )
Contents: Sui::Coin::Coin<Sui::SUI::SUI> {id: Sui::ID::VersionedID {id: Sui::ID::UniqueID {id: Sui::ID::ID {bytes: fake(106)}}, version: 1u64}, balance: Sui::Balance::Balance<Sui::SUI::SUI> {value: 10u64}}
Contents: sui::coin::Coin<sui::sui::SUI> {id: sui::id::VersionedID {id: sui::id::UniqueID {id: sui::id::ID {bytes: fake(106)}}, version: 1u64}, balance: sui::balance::Balance<sui::sui::SUI> {value: 10u64}}

task 5 'run'. lines 16-16:
written: object(100), object(107)

task 6 'view-object'. lines 18-18:
Owner: Account Address ( C )
Contents: Sui::Coin::Coin<Sui::SUI::SUI> {id: Sui::ID::VersionedID {id: Sui::ID::UniqueID {id: Sui::ID::ID {bytes: fake(100)}}, version: 2u64}, balance: Sui::Balance::Balance<Sui::SUI::SUI> {value: 99990u64}}
Contents: sui::coin::Coin<sui::sui::SUI> {id: sui::id::VersionedID {id: sui::id::UniqueID {id: sui::id::ID {bytes: fake(100)}}, version: 2u64}, balance: sui::balance::Balance<sui::sui::SUI> {value: 99990u64}}

task 7 'view-object'. lines 20-20:
Owner: Account Address ( B )
Contents: Sui::Coin::Coin<Sui::SUI::SUI> {id: Sui::ID::VersionedID {id: Sui::ID::UniqueID {id: Sui::ID::ID {bytes: fake(107)}}, version: 1u64}, balance: Sui::Balance::Balance<Sui::SUI::SUI> {value: 99600u64}}
Contents: sui::coin::Coin<sui::sui::SUI> {id: sui::id::VersionedID {id: sui::id::UniqueID {id: sui::id::ID {bytes: fake(107)}}, version: 1u64}, balance: sui::balance::Balance<sui::sui::SUI> {value: 99593u64}}
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

//# view-object 100

//# run Sui::Coin::split_and_transfer --type-args Sui::SUI::SUI --args object(100) 10 @B --sender A
//# run sui::coin::split_and_transfer --type-args sui::sui::SUI --args object(100) 10 @B --sender A

//# view-object 100

//# view-object 106

//# run Sui::Coin::transfer --type-args Sui::SUI::SUI --args object(100) @C --sender B
//# run sui::coin::transfer --type-args sui::sui::SUI --args object(100) @C --sender B

//# view-object 100

Expand Down
8 changes: 4 additions & 4 deletions crates/sui-adapter-transactional-tests/tests/sui/freeze.move
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

//# init --accounts A

//# run Sui::ObjectBasics::create --args 10 @A
//# run sui::object_basics::create --args 10 @A

//# run Sui::ObjectBasics::freeze_object --args object(104)
//# run sui::object_basics::freeze_object --args object(104)

//# run Sui::ObjectBasics::transfer --args object(104) @A
//# run sui::object_basics::transfer --args object(104) @A

//# run Sui::ObjectBasics::set_value --args object(104) 1
//# run sui::object_basics::set_value --args object(104) 1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
processed 2 tasks

task 0 'run'. lines 7-9:
Error: Failed to verify the Move module, reason: "VMError with status LINKER_ERROR at location UNDEFINED and message Cannot find ModuleId { address: _, name: Identifier(\"ObjectBasics\") } in data cache".
Error: Failed to verify the Move module, reason: "VMError with status LINKER_ERROR at location UNDEFINED and message Cannot find ModuleId { address: _, name: Identifier(\"object_basics\") } in data cache".

task 1 'run'. lines 10-10:
Error: Function resolution failure: "Could not resolve function 'foo' in module Sui::ObjectBasics".
Error: Function resolution failure: "Could not resolve function 'foo' in module sui::object_basics".
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// These functions do not exist

// Instead of calling on the Sui package, we are calling a non-existant package
//# run 0x242::ObjectBasics::create
//# run 0x242::object_basics::create

// Calling a non-existant function.
//# run Sui::ObjectBasics::foo
//# run sui::object_basics::foo
Loading

0 comments on commit ca37ecc

Please sign in to comment.