aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[BLK-203] [CLI] --named-addresses CLI flag should take precedence over addresses in move.toml

Open geekflyer opened this issue 2 years ago • 2 comments

encountered a potential bug in the CLI: trying to publish via: aptos move publish --package-dir ./ --max-gas 10000 --named-addresses hero_demo=default with this move.toml

name = 'hero_demo'
version = '1.0.0'
upgrade_policy = "compatible"
[dependencies.AptosFramework]
git = '<https://github.com/aptos-labs/aptos-core.git>'
rev = 'main'
subdir = 'aptos-move/framework/aptos-framework'

[addresses]
AptosFramework = '0x1'
hero_demo = "0xCAFE"```
but getting this error:
```aptos move publish --package-dir ./ --max-gas 10000 --named-addresses hero_demo=default
Compiling, may take a little while to download git dependencies...
{
  "Error": "Unexpected error: Unable to resolve packages for package 'hero_demo'"
}```
If I replace the `0xCAFE` in the move.toml with my account address it works, but I would expect the CLI override to take precedence?

[Slack Message](https://aptos-org.slack.com/archives/C03N83P7QUC/p1669027677562379?thread_ts=1669027677.562379&cid=C03N83P7QUC)

From SyncLinear.com

geekflyer avatar Nov 21 '22 11:11 geekflyer

This isn't a bug, but intended behavior by the Move packaging system. The original name of the input variable was --additional-named-addresses, but it seemed too long to put and additionally, confusing.

The only thing that could probably be done here is check if the address already exists in the Move.toml, and provide an error message

gregnazario avatar Dec 08 '22 20:12 gregnazario

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.

github-actions[bot] avatar Jan 23 '23 02:01 github-actions[bot]

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.

github-actions[bot] avatar Aug 08 '23 01:08 github-actions[bot]

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.

github-actions[bot] avatar Oct 09 '23 01:10 github-actions[bot]

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.

github-actions[bot] avatar Nov 24 '23 01:11 github-actions[bot]

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.

github-actions[bot] avatar Jan 09 '24 01:01 github-actions[bot]