forked from MystenLabs/sui
-
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.
[move][transactional tests] Add advance-epoch support (MystenLabs#18325)
## Description - Added advance epoch support to normal sui-adapter-transactional-tests ## Test plan - added a test --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
- Loading branch information
Showing
4 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
crates/sui-adapter-transactional-tests/tests/epoch/advance.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,22 @@ | ||
processed 6 tasks | ||
|
||
task 1 'publish'. lines 6-24: | ||
created: object(1,0) | ||
mutated: object(0,0) | ||
gas summary: computation_cost: 1000000, storage_cost: 5639200, storage_rebate: 0, non_refundable_storage_fee: 0 | ||
|
||
task 2 'run'. lines 26-26: | ||
created: object(2,0) | ||
mutated: object(0,0) | ||
gas summary: computation_cost: 1000000, storage_cost: 2257200, storage_rebate: 978120, non_refundable_storage_fee: 9880 | ||
|
||
task 3 'run'. lines 28-28: | ||
mutated: object(0,0), object(2,0) | ||
gas summary: computation_cost: 1000000, storage_cost: 2257200, storage_rebate: 2234628, non_refundable_storage_fee: 22572 | ||
|
||
task 4 'advance-epoch'. lines 30-30: | ||
Epoch advanced: 1 | ||
|
||
task 5 'run'. lines 32-32: | ||
mutated: object(0,0), object(2,0) | ||
gas summary: computation_cost: 1000000, storage_cost: 2257200, storage_rebate: 2234628, non_refundable_storage_fee: 22572 |
32 changes: 32 additions & 0 deletions
32
crates/sui-adapter-transactional-tests/tests/epoch/advance.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,32 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# init --addresses test=0x0 | ||
|
||
//# publish | ||
|
||
module test::m { | ||
public struct S has key, store { | ||
id: UID, | ||
value: u64 | ||
} | ||
|
||
public fun create(ctx: &mut TxContext) { | ||
transfer::public_share_object(S { | ||
id: object::new(ctx), | ||
value: ctx.epoch(), | ||
}) | ||
} | ||
|
||
public fun check(s: &S, epoch_diff: u64, ctx: &TxContext) { | ||
assert!(s.value + epoch_diff == ctx.epoch()); | ||
} | ||
} | ||
|
||
//# run test::m::create | ||
|
||
//# run test::m::check --args object(2,0) 0 | ||
|
||
//# advance-epoch | ||
|
||
//# run test::m::check --args object(2,0) 1 |
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