-
Notifications
You must be signed in to change notification settings - Fork 1
Description
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.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: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.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- Test commands require
--named-addresses mvmt_intent=0x123flag - Deployment scripts use
--named-addresses mvmt_intent=$ACTUAL_ADDRESSto override
Possible Solutions (Future)
- Separate Move.toml for tests: Use a different
Move.tomlfile for tests (if Aptos supports this) - Accept the limitation: Keep the flag as a necessary part of the workflow
References
- PR refactor: remove --named-addresses flag from test commands #21: refactor: remove --named-addresses flag from test commands #21
- Deployment scripts:
testing-infra/chain-hub/deploy-contracts.sh,testing-infra/chain-connected-apt/deploy-contracts.sh - Current test command:
aptos move test --dev --named-addresses mvmt_intent=0x123