-
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.
move: dump-bytecode-as-base64 uses Move.lock addresses (#18794)
## Description `sui move build` does not ordinarily require a network connection because it doesn't need to know about a chain's ID. The exception is when `--dump-bytecode-as-base64` is specified: In this case, we should resolve the correct addresses for the respective chain (e.g., testnet, mainnet) from the `Move.lock` under automated address management. Two options to fix `sui move build --dump-bytecode-as-base64` to work with automated addresses / by resolving from the `Move.lock`: 1. Require an extra `--chain-id` flag on `sui move build`, which a user must specify along with `--dump-bytecode-as-base64`. E.g., ``` sui move build --dump-bytecode-as-base64 --chain-id "$(sui client chain-identifier)" ``` OR 2. Require a network connection _only when_ `--dump-bytecode-as-base64` is set and and resolve the chain-id without requiring a flag. This PR opts for **(2)**, but it is trivial to change the implementation and test to do **(1)** instead. **(1)** should come with an accompanying doc change though. Context: encountered when running, e.g., ``` execSync(`${SUI} move build --dump-bytecode-as-base64 --path ${packagePath}` ``` ## Test plan Added 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: - [x] CLI: Fixed an issue where `--dump-bytecode-as-base64` did not work as expected if [package addresses are automatically managed](https://docs.sui.io/concepts/sui-move-concepts/packages/automated-address-management#adopting-automated-address-management-for-published-packages). - [ ] Rust SDK: - [ ] REST API:
- Loading branch information
1 parent
db844c3
commit 2501733
Showing
10 changed files
with
140 additions
and
11 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
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,9 @@ | ||
[package] | ||
name = "depends_on_simple" | ||
edition = "2024.beta" | ||
|
||
[dependencies] | ||
simple = { local = "../simple" } | ||
|
||
[addresses] | ||
depends_on_simple = "0x0" |
4 changes: 4 additions & 0 deletions
4
crates/sui/tests/data/depends_on_simple/sources/depends_on_simple.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,4 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module depends_on_simple::depends_on_simple {} |
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,8 @@ | ||
[package] | ||
name = "simple" | ||
edition = "2024.beta" | ||
|
||
[dependencies] | ||
|
||
[addresses] | ||
simple = "0x0" |
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,4 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module simple::simple {} |
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