forked from rooch-network/rooch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '5c4f49d911ef44975a6de8e2bc8ff8f8b181314c'
* 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
Showing
284 changed files
with
19,463 additions
and
1,642 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
crates/rooch-framework-tests/tests/cases/account_storage/exists_and_move_from.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
44 changes: 44 additions & 0 deletions
44
crates/rooch-framework-tests/tests/cases/account_storage/exists_and_move_from.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
19 changes: 13 additions & 6 deletions
19
crates/rooch-framework-tests/tests/cases/entry_function/entry_function_invalid_struct.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 │ │ } | ||
│ ╰─────^ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
crates/rooch-framework-tests/tests/cases/entry_function/entry_function_valid_reference.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 │ │ } | ||
│ ╰─────^ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
crates/rooch-framework-tests/tests/cases/entry_function/entry_function_valid_struct.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.