Cannot remove --named-addresses flag from test commands
Problem
We attempted to remove the --named-addresses mvmt_intent=0x123 flag from test commands by setting a default address in Move.toml (see PR #21: #21).
However, this approach fails because:
-
Deployment requires mvmt_intent = "_": The deployment scripts (testing-infra/chain-hub/deploy-contracts.sh and testing-infra/chain-connected-apt/deploy-contracts.sh) need to override the named address with actual deployment addresses using --named-addresses mvmt_intent=$CHAIN_ADDRESS.
-
Address conflict: When Move.toml has mvmt_intent = "0x123" and deployment tries to use --named-addresses mvmt_intent=$ACTUAL_ADDRESS, Aptos Move throws an error:
Unable to resolve named address 'mvmt_intent' in package 'aptos-intent' when resolving dependencies:
Attempted to assign a different value '0x123' to an already-assigned named address '0x...'
-
Move limitation: Named addresses in Move are resolved at the package level via Move.toml or command-line flags. They cannot be set in individual test files or conditionally based on test vs deployment mode.
Current State
Move.toml uses mvmt_intent = "_" (placeholder) for deployment flexibility
- Test commands require
--named-addresses mvmt_intent=0x123 flag
- Deployment scripts use
--named-addresses mvmt_intent=$ACTUAL_ADDRESS to override
Possible Solutions (Future)
- Separate Move.toml for tests: Use a different
Move.toml file for tests (if Aptos supports this)
- Accept the limitation: Keep the flag as a necessary part of the workflow
References
Cannot remove
--named-addressesflag from test commandsProblem
We attempted to remove the
--named-addresses mvmt_intent=0x123flag from test commands by setting a default address inMove.toml(see PR #21: #21).However, this approach fails because:
Deployment requires
mvmt_intent = "_": The deployment scripts (testing-infra/chain-hub/deploy-contracts.shandtesting-infra/chain-connected-apt/deploy-contracts.sh) need to override the named address with actual deployment addresses using--named-addresses mvmt_intent=$CHAIN_ADDRESS.Address conflict: When
Move.tomlhasmvmt_intent = "0x123"and deployment tries to use--named-addresses mvmt_intent=$ACTUAL_ADDRESS, Aptos Move throws an error:Move limitation: Named addresses in Move are resolved at the package level via
Move.tomlor command-line flags. They cannot be set in individual test files or conditionally based on test vs deployment mode.Current State
Move.tomlusesmvmt_intent = "_"(placeholder) for deployment flexibility--named-addresses mvmt_intent=0x123flag--named-addresses mvmt_intent=$ACTUAL_ADDRESSto overridePossible Solutions (Future)
Move.tomlfile for tests (if Aptos supports this)References
testing-infra/chain-hub/deploy-contracts.sh,testing-infra/chain-connected-apt/deploy-contracts.shaptos move test --dev --named-addresses mvmt_intent=0x123