From 89223ffef3c5bc9dc572572610fa8f31da490b3c Mon Sep 17 00:00:00 2001 From: zhengtianyue_v Date: Thu, 26 Dec 2024 17:16:02 +0800 Subject: [PATCH] task1 --- .../code/task1/hello_move/.gitignore | 1 + .../beisheng7/code/task1/hello_move/Move.lock | 34 +++++++++++++++++ .../beisheng7/code/task1/hello_move/Move.toml | 37 +++++++++++++++++++ .../task1/hello_move/sources/hello_move.move | 19 ++++++++++ .../hello_move/tests/hello_move_tests.move | 18 +++++++++ 5 files changed, 109 insertions(+) create mode 100644 mover/beisheng7/code/task1/hello_move/.gitignore create mode 100644 mover/beisheng7/code/task1/hello_move/Move.lock create mode 100644 mover/beisheng7/code/task1/hello_move/Move.toml create mode 100644 mover/beisheng7/code/task1/hello_move/sources/hello_move.move create mode 100644 mover/beisheng7/code/task1/hello_move/tests/hello_move_tests.move diff --git a/mover/beisheng7/code/task1/hello_move/.gitignore b/mover/beisheng7/code/task1/hello_move/.gitignore new file mode 100644 index 000000000..a007feab0 --- /dev/null +++ b/mover/beisheng7/code/task1/hello_move/.gitignore @@ -0,0 +1 @@ +build/* diff --git a/mover/beisheng7/code/task1/hello_move/Move.lock b/mover/beisheng7/code/task1/hello_move/Move.lock new file mode 100644 index 000000000..f43c5cd35 --- /dev/null +++ b/mover/beisheng7/code/task1/hello_move/Move.lock @@ -0,0 +1,34 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "8B7DC3EDF1D81F9E2D46D8251E70F4B8D7097878F02438454C30AEF9F05D81D0" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" +dependencies = [ + { id = "Sui", name = "Sui" }, +] + +[[move.package]] +id = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/move-stdlib" } + +[[move.package]] +id = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, +] + +[move.toolchain-version] +compiler-version = "1.39.4" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0x3b73bab1315d0e7c13180a33ab2bcac11ef42b6a385e15a8483810af3ca3c0a8" +latest-published-id = "0x3b73bab1315d0e7c13180a33ab2bcac11ef42b6a385e15a8483810af3ca3c0a8" +published-version = "1" diff --git a/mover/beisheng7/code/task1/hello_move/Move.toml b/mover/beisheng7/code/task1/hello_move/Move.toml new file mode 100644 index 000000000..f99a76a8d --- /dev/null +++ b/mover/beisheng7/code/task1/hello_move/Move.toml @@ -0,0 +1,37 @@ +[package] +name = "hello_move" +edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move +# license = "" # e.g., "MIT", "GPL", "Apache 2.0" +# authors = ["..."] # e.g., ["Joe Smith (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"] + +[dependencies] +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" } + +# For remote import, use the `{ git = "...", subdir = "...", rev = "..." }`. +# Revision can be a branch, a tag, and a commit hash. +# MyRemotePackage = { git = "https://some.remote/host.git", subdir = "remote/path", rev = "main" } + +# For local dependencies use `local = path`. Path is relative to the package root +# Local = { local = "../path/to" } + +# To resolve a version conflict and force a specific version for dependency +# override use `override = true` +# Override = { local = "../conflicting/version", override = true } + +[addresses] +hello_move = "0x0" + +# Named addresses will be accessible in Move as `@name`. They're also exported: +# for example, `std = "0x1"` is exported by the Standard Library. +# alice = "0xA11CE" + +[dev-dependencies] +# The dev-dependencies section allows overriding dependencies for `--test` and +# `--dev` modes. You can introduce test-only dependencies here. +# Local = { local = "../path/to/dev-build" } + +[dev-addresses] +# The dev-addresses section allows overwriting named addresses for the `--test` +# and `--dev` modes. +# alice = "0xB0B" + diff --git a/mover/beisheng7/code/task1/hello_move/sources/hello_move.move b/mover/beisheng7/code/task1/hello_move/sources/hello_move.move new file mode 100644 index 000000000..265a06718 --- /dev/null +++ b/mover/beisheng7/code/task1/hello_move/sources/hello_move.move @@ -0,0 +1,19 @@ +module hello_move::hello { + use std::ascii::{String, string}; + use sui::object::{Self,UID}; + use sui::transfer::transfer; + use sui::tx_context::{TxContext, sender}; + + public struct Hello has key{ + id:UID, + say: String + } + + fun init(ctx: &mut TxContext) { + let hello_move = Hello { + id:object::new(ctx), + say: string(b"beisheng7"), + }; + transfer(hello_move, sender(ctx)); + } +} \ No newline at end of file diff --git a/mover/beisheng7/code/task1/hello_move/tests/hello_move_tests.move b/mover/beisheng7/code/task1/hello_move/tests/hello_move_tests.move new file mode 100644 index 000000000..7798d8dda --- /dev/null +++ b/mover/beisheng7/code/task1/hello_move/tests/hello_move_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module hello_move::hello_move_tests; +// uncomment this line to import the module +// use hello_move::hello_move; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_hello_move() { + // pass +} + +#[test, expected_failure(abort_code = ::hello_move::hello_move_tests::ENotImplemented)] +fun test_hello_move_fail() { + abort ENotImplemented +} +*/