-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sui-adapter] Resolve Move abort locations to package ID instead of r…
…untime ID
- Loading branch information
Showing
12 changed files
with
1,043 additions
and
38 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
crates/sui-adapter-transactional-tests/tests/upgrade/abort_code_resolution.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,31 @@ | ||
processed 7 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: 5084400, storage_rebate: 0, non_refundable_storage_fee: 0 | ||
|
||
task 2 'upgrade'. lines 14-19: | ||
created: object(2,0) | ||
mutated: object(0,0), object(1,1) | ||
gas summary: computation_cost: 1000000, storage_cost: 5084400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 | ||
|
||
task 3 'upgrade'. lines 21-26: | ||
created: object(3,0) | ||
mutated: object(0,0), object(1,1) | ||
gas summary: computation_cost: 1000000, storage_cost: 5084400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 | ||
|
||
task 4 'run'. lines 28-30: | ||
Error: Transaction Effects Status: Move Runtime Abort. Location: Test1::M1::f1 (function index 0) at offset 1, Abort Code: 0 | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: Test1, name: Identifier("M1") }, function: 0, instruction: 1, function_name: Some("f1") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("Test1::M1::f1 at offset 1"), exec_state: None, location: Module(ModuleId { address: Test1, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } | ||
|
||
task 5 'run'. lines 31-33: | ||
Error: Transaction Effects Status: Move Runtime Abort. Location: Test2::M1::f1 (function index 0) at offset 1, Abort Code: 0 | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: Test2, name: Identifier("M1") }, function: 0, instruction: 1, function_name: Some("f1") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("Test1::M1::f1 at offset 1"), exec_state: None, location: Module(ModuleId { address: Test1, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } | ||
|
||
task 6 'run'. lines 34-34: | ||
Error: Transaction Effects Status: Move Runtime Abort. Location: Test3::M1::f1 (function index 0) at offset 1, Abort Code: 0 | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: Test3, name: Identifier("M1") }, function: 0, instruction: 1, function_name: Some("f1") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("Test1::M1::f1 at offset 1"), exec_state: None, location: Module(ModuleId { address: Test1, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } |
34 changes: 34 additions & 0 deletions
34
crates/sui-adapter-transactional-tests/tests/upgrade/abort_code_resolution.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,34 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# init --addresses Test1=0x0 Test2=0x0 Test3=0x0 --accounts A | ||
|
||
//# publish --upgradeable --sender A | ||
module Test1::M1 { | ||
public fun f1() { | ||
abort 0 | ||
} | ||
} | ||
|
||
|
||
//# upgrade --package Test1 --upgrade-capability 1,1 --sender A | ||
module Test2::M1 { | ||
public fun f1() { | ||
abort 0 | ||
} | ||
} | ||
|
||
//# upgrade --package Test2 --upgrade-capability 1,1 --sender A | ||
module Test3::M1 { | ||
public fun f1() { | ||
abort 0 | ||
} | ||
} | ||
|
||
//# run Test1::M1::f1 | ||
|
||
// Location will show up as Test2::M1::f1 since the runtime module ID is resolved to the upgraded version | ||
//# run Test2::M1::f1 | ||
|
||
// Location will show up as Test3::M1::f1 as the runtime module ID is resolved to the upgraded version | ||
//# run Test3::M1::f1 |
31 changes: 31 additions & 0 deletions
31
crates/sui-adapter-transactional-tests/tests/upgrade/abort_code_resolution_v46.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,31 @@ | ||
processed 7 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: 5084400, storage_rebate: 0, non_refundable_storage_fee: 0 | ||
|
||
task 2 'upgrade'. lines 14-19: | ||
created: object(2,0) | ||
mutated: object(0,0), object(1,1) | ||
gas summary: computation_cost: 1000000, storage_cost: 5084400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 | ||
|
||
task 3 'upgrade'. lines 21-26: | ||
created: object(3,0) | ||
mutated: object(0,0), object(1,1) | ||
gas summary: computation_cost: 1000000, storage_cost: 5084400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 | ||
|
||
task 4 'run'. lines 28-30: | ||
Error: Transaction Effects Status: Move Runtime Abort. Location: Test1::M1::f1 (function index 0) at offset 1, Abort Code: 0 | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: Test1, name: Identifier("M1") }, function: 0, instruction: 1, function_name: Some("f1") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("Test1::M1::f1 at offset 1"), exec_state: None, location: Module(ModuleId { address: Test1, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } | ||
|
||
task 5 'run'. lines 31-33: | ||
Error: Transaction Effects Status: Move Runtime Abort. Location: Test1::M1::f1 (function index 0) at offset 1, Abort Code: 0 | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: Test1, name: Identifier("M1") }, function: 0, instruction: 1, function_name: Some("f1") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("Test1::M1::f1 at offset 1"), exec_state: None, location: Module(ModuleId { address: Test1, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } | ||
|
||
task 6 'run'. lines 34-34: | ||
Error: Transaction Effects Status: Move Runtime Abort. Location: Test1::M1::f1 (function index 0) at offset 1, Abort Code: 0 | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: Test1, name: Identifier("M1") }, function: 0, instruction: 1, function_name: Some("f1") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("Test1::M1::f1 at offset 1"), exec_state: None, location: Module(ModuleId { address: Test1, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } |
34 changes: 34 additions & 0 deletions
34
crates/sui-adapter-transactional-tests/tests/upgrade/abort_code_resolution_v46.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,34 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# init --addresses Test1=0x0 Test2=0x0 Test3=0x0 --accounts A --protocol-version 46 | ||
|
||
//# publish --upgradeable --sender A | ||
module Test1::M1 { | ||
public fun f1() { | ||
abort 0 | ||
} | ||
} | ||
|
||
|
||
//# upgrade --package Test1 --upgrade-capability 1,1 --sender A | ||
module Test2::M1 { | ||
public fun f1() { | ||
abort 0 | ||
} | ||
} | ||
|
||
//# upgrade --package Test2 --upgrade-capability 1,1 --sender A | ||
module Test3::M1 { | ||
public fun f1() { | ||
abort 0 | ||
} | ||
} | ||
|
||
//# run Test1::M1::f1 | ||
|
||
// Location will show up as Test1::M1::f1 since the module ID is not resolved to the upgraded version | ||
//# run Test2::M1::f1 | ||
|
||
// Location will show up as Test1::M1::f1 since the module ID is not resolved to the upgraded version | ||
//# run Test3::M1::f1 |
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.