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: upgrade command in transactional tests (MystenLabs#10128)
## Description Enables `#upgrade` in transactional tests. ## Test Plan It is tests.
1 parent
3cbf585
commit b60adff
Showing
7 changed files
with
296 additions
and
7 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
crates/sui-adapter-transactional-tests/tests/upgrade/basic.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,13 @@ | ||
processed 3 tasks | ||
|
||
init: | ||
A: object(0,0) | ||
|
||
task 1 'publish'. lines 6-11: | ||
created: object(1,0), object(1,1) | ||
mutated: object(0,0) | ||
gas summary: computation_cost: 1000000, storage_cost: 6194000, storage_rebate: 0, non_refundable_storage_fee: 0 | ||
|
||
task 2 'upgrade'. lines 13-17: | ||
Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } |
17 changes: 17 additions & 0 deletions
17
crates/sui-adapter-transactional-tests/tests/upgrade/basic.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,17 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# init --addresses Test=0x0 --accounts A | ||
|
||
//# publish --upgradeable --sender A | ||
module Test::M1 { | ||
use sui::tx_context::TxContext; | ||
fun init(_ctx: &mut TxContext) { } | ||
public fun f1() { } | ||
} | ||
|
||
//# upgrade --package Test --upgrade-capability 1,1 --sender A | ||
module Test::M1 { | ||
use sui::tx_context::TxContext; | ||
fun init(_ctx: &mut TxContext) { } | ||
} |
18 changes: 18 additions & 0 deletions
18
crates/sui-adapter-transactional-tests/tests/upgrade/multi_version.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,18 @@ | ||
processed 4 tasks | ||
|
||
init: | ||
A: object(0,0) | ||
|
||
task 1 'publish'. lines 6-10: | ||
created: object(1,0), object(1,1) | ||
mutated: object(0,0) | ||
gas summary: computation_cost: 1000000, storage_cost: 6080000, storage_rebate: 0, non_refundable_storage_fee: 0 | ||
|
||
task 2 'upgrade'. lines 12-17: | ||
created: object(2,0) | ||
mutated: object(0,0), object(1,1) | ||
gas summary: computation_cost: 1000000, storage_cost: 6194000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 | ||
|
||
task 3 'upgrade'. lines 19-23: | ||
Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } |
24 changes: 24 additions & 0 deletions
24
crates/sui-adapter-transactional-tests/tests/upgrade/multi_version.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,24 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# init --addresses Test_V1=0x0 Test_V2=0x0 Test_V3=0x0 --accounts A | ||
|
||
//# publish --upgradeable --sender A | ||
module Test_V1::M1 { | ||
use sui::tx_context::TxContext; | ||
fun init(_ctx: &mut TxContext) { } | ||
} | ||
|
||
//# upgrade --package Test_V1 --upgrade-capability 1,1 --sender A | ||
module Test_V2::M1 { | ||
use sui::tx_context::TxContext; | ||
fun init(_ctx: &mut TxContext) { } | ||
public fun f1() { } | ||
} | ||
|
||
//# upgrade --package Test_V2 --upgrade-capability 1,1 --sender A | ||
module Test_V3::M1 { | ||
use sui::tx_context::TxContext; | ||
fun init(_ctx: &mut TxContext) { } | ||
} | ||
|
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