Skip to content

Commit

Permalink
Merge commit '5c4f49d911ef44975a6de8e2bc8ff8f8b181314c'
Browse files Browse the repository at this point in the history
* commit '5c4f49d911ef44975a6de8e2bc8ff8f8b181314c':
  migration rooch network (rooch-network#364)
  Remove the TxContext in the move test file. (rooch-network#362)
  Rename framework modules (rooch-network#361)
  fix README typo (rooch-network#359)
  [integration-test-runner] private_generics tests. (rooch-network#354)
  [testing] draft cases for private generics (rooch-network#285)
  Remove TxContext from the check in the entry function. (rooch-network#360)
  [Framework Testing] Add test to account_storage exists and move_from (rooch-network#358)
  add rust setup to workflow (rooch-network#356)
  Fix the issue of illegal invocation of private_generics in the module without throwing an error. (rooch-network#345) (rooch-network#351)
  • Loading branch information
wubuku committed Jun 27, 2023
2 parents fba7cb4 + 5c4f49d commit 591afac
Show file tree
Hide file tree
Showing 284 changed files with 19,463 additions and 1,642 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release_asset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
- name: Set LIBCLANG_PATH
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
if: matrix.platform == 'windows-latest'
- name: Rust setup
uses: rooch-network/rooch/.github/actions/rust-setup@main
if: matrix.platform != 'windows-latest' && matrix.platform != 'macos-latest'

- name: build for ${{ matrix.platform }}
uses: actions-rs/cargo@v1
with:
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ derive-syn-parse = "0.1.5"
unescape = "0.1.0"
tempfile = "3.2.0"
regex = "1.8.4"
walkdir = "2.3.3"


# Note: the BEGIN and END comments below are required for external tooling. Do not remove.
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Rooch

[Rooch](https:://rooch.network) is a modular DApp container with the [Move language](https://github.com/move-language/move).

[Rooch](https://rooch.network) is a modular DApp container with the [Move language](https://github.com/move-language/move).

## Usage

1. Rooch Ethereum Layer2: Rooch(Execution) + Layer1s(Settlement) + Ethereum(Arbitration) + DA
2. XChain Modular DApp: Rooch(Execution) + XChain(Settlement + Arbitration) + DA
3. Rooch Layer3 Modular DApp: Rooch(Execution) + Rooch Layer2(Settlement + Arbitration) + DA
Expand Down Expand Up @@ -54,7 +54,8 @@ State DB:
![Rooch Transaction Flow](./docs/static/design/rooch-design-transaction-flow-functional-perspective.svg)

## Components
* [MoveOS](./moveos): MoveOS is a standalone Move runtime environment based on [MoveVM](https://github.com/move-language/move). It provide Move execution environment for rooch.

* [MoveOS](./moveos): MoveOS is a standalone Move runtime environment based on [MoveVM](https://github.com/move-language/move). It provides Move execution environment for rooch.

## How to Contribute

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
processed 3 tasks

task 1 'publish'. lines 3-34:
status EXECUTED

task 2 'run'. lines 36-44:
status EXECUTED
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//# init --addresses test=0x42

//# publish
module test::m {
use std::signer;
use moveos_std::storage_context::{StorageContext};
use moveos_std::account_storage;

struct Test has key{
addr: address,
version: u64
}

fun init(ctx: &mut StorageContext, sender: &signer) {
let sender_addr = signer::address_of(sender);
account_storage::global_move_to(ctx, sender, Test{
addr: sender_addr,
version: 0,
});
}

public fun test_exists_and_move_from(ctx: &mut StorageContext, sender:&signer){
let sender_addr = signer::address_of(sender);
let test_exists = account_storage::global_exists<Test>(ctx, sender_addr);
assert!(test_exists, 1);
let test = account_storage::global_move_from<Test>(ctx, sender_addr);
let test_exists = account_storage::global_exists<Test>(ctx, sender_addr);
assert!(!test_exists, 2);
let Test{
addr: _,
version: _
} = test;
}
}

//# run --signers test
script {
use moveos_std::storage_context::{StorageContext};
use test::m;

fun main(ctx: &mut StorageContext, sender: signer) {
m::test_exists_and_move_from(ctx, &sender);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
processed 2 tasks

task 1 'publish'. lines 3-12:
task 1 'publish'. lines 3-18:
Error: error: type `test::Foo` is not supported as a parameter type
┌─ /tmp/tempfile:8:5
8 │ ╭ entry public fun test_entry_function_invalid_struct( _foo: Foo ){
9 │ │ }
│ ╰─────^
┌─ /tmp/tempfile:9:5
9 │ ╭ entry public fun test_entry_function_invalid_struct( _foo: Foo ){
10 │ │ }
│ ╰─────^

error: type `&tx_context::TxContext` is not supported as a parameter type
┌─ /tmp/tempfile:11:5
11 │ ╭ entry public fun test_entry_function_invalid_struct_txcontext( _: &tx_context::TxContext ){
12 │ │ }
│ ╰─────^


Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

//# publish
module creator::test {
use moveos_std::tx_context;

struct Foo has copy, drop {
x: u64,
}

entry public fun test_entry_function_invalid_struct( _foo: Foo ){

}

entry public fun test_entry_function_invalid_struct_txcontext( _: &tx_context::TxContext ){

}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
processed 2 tasks

task 1 'publish'. lines 3-33:
task 1 'publish'. lines 3-22:
Error: error: type `&mut signer` is not supported as a parameter type
┌─ /tmp/tempfile:9:5
9 │ ╭ entry public fun test_entry_function_valid_reference_mut_signer( _: &mut signer ){
10 │ │ }
│ ╰─────^
┌─ /tmp/tempfile:8:5
8 │ ╭ entry public fun test_entry_function_valid_reference_mut_signer( _: &mut signer ){
9 │ │ }
│ ╰─────^


Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
//# publish
module creator::test {
use moveos_std::storage_context;
use moveos_std::tx_context;


entry public fun test_entry_function_valid_reference_signer( _: & signer ){

Expand All @@ -21,13 +19,4 @@ module creator::test {
entry public fun test_entry_function_valid_reference_mut_storage_context( _: &mut storage_context::StorageContext ){

}

entry public fun test_entry_function_valid_reference_tx_context( _: & tx_context::TxContext ){

}

entry public fun test_entry_function_valid_reference_mut_tx_context( _: &mut tx_context::TxContext ){

}

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

task 1 'publish'. lines 3-32:
task 1 'publish'. lines 3-25:
status EXECUTED
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ module creator::test {
use std::ascii;
use moveos_std::storage_context;
use moveos_std::object_id;
use moveos_std::tx_context;


entry public fun test_entry_function_valid_struct_string( _str: string::String ){

Expand All @@ -24,9 +22,4 @@ module creator::test {
entry public fun test_entry_function_valid_struct_object_id( _id: object_id::ObjectID ){

}

entry public fun test_entry_function_valid_struct_tx_context( _ctx: &mut tx_context::TxContext ){

}

}
4 changes: 2 additions & 2 deletions crates/rooch-framework-tests/tests/cases/event/basic.move
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ module test::m {
script {
use moveos_std::storage_context::{Self, StorageContext};
use moveos_std::tx_context;
use moveos_std::events;
use moveos_std::event;
use test::m::{Self, WithdrawEvent};

fun main(ctx: &mut StorageContext) {
let sender_addr = tx_context::sender(storage_context::tx_context(ctx));
let withdraw_event = m::new_test_struct(sender_addr, 100);
events::emit_event<WithdrawEvent>(ctx, withdraw_event);
event::emit_event<WithdrawEvent>(ctx, withdraw_event);
}
}
Loading

0 comments on commit 591afac

Please sign in to comment.