Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
upgrade move to Move 2024 (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
teohaik authored May 21, 2024
1 parent b687483 commit 74bdfd9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
3 changes: 2 additions & 1 deletion move_examples/nft_app/Move.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "cms"
version = "0.0.1"
edition = "2024.beta"

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" }
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet" }

[addresses]
cms = "0x0"
12 changes: 5 additions & 7 deletions move_examples/nft_app/sources/genesis.move
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@
module cms::genesis {

// Sui imports.
use sui::transfer;
use sui::package::{Self};
use sui::object::{Self, UID};
use sui::tx_context::{sender, TxContext};
use sui::tx_context::{sender};

// Manager capability assigned to whoever deploys the contract
// AdminCap is transferrable in case the owner needs to change addresses.
struct AdminCap has key, store {
public struct AdminCap has key, store {
id: UID
}

// OTW to create the publisher
struct GENESIS has drop {}
public struct GENESIS has drop {}

struct SharedItem has key {
public struct SharedItem has key {
id: UID
}

Expand All @@ -36,7 +34,7 @@ module cms::genesis {
});

// Generate 20 Admin Caps, for parallelization of transactions
let i = 0;
let mut i = 0;
while (i <= 20) {
// Transfer Admin Cap to sender
transfer::public_transfer(AdminCap {
Expand Down
6 changes: 1 addition & 5 deletions move_examples/nft_app/sources/hero_nft.move
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ module cms::hero_nft {
// Std library imports
use std::string::{String};

// Sui imports
use sui::tx_context::{TxContext};
use sui::object::{Self, UID};

// Module dependency
use cms::genesis::{AdminCap, SharedItem};
use sui::transfer;

/// The Hero NFT struct
struct Hero has key, store
public struct Hero has key, store
{
id: UID,
name: String,
Expand Down
5 changes: 5 additions & 0 deletions test/unit/pool-tx-execution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ describe('🌊 Basic flow of sign & execute tx block', () => {
jest.clearAllMocks();
const helper = new SetupTestsHelper();
await helper.setupAdmin(2, 5);

console.log("Admin Address: ", env.ADMIN_ADDRESS);
console.log("Test User Address: ", env.TEST_USER_ADDRESS);
console.log("NFT_APP_PACKAGE_ID: ", env.NFT_APP_PACKAGE_ID);
console.log("NFT_APP_ADMIN_CAP: ", env.NFT_APP_ADMIN_CAP);
await sleep(5000);
});

Expand Down

0 comments on commit 74bdfd9

Please sign in to comment.