Skip to content

Cannot remove --named-addresses flag from test commands #22

@apenzk

Description

@apenzk

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:

  1. 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.

  2. 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...'
    
  3. 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)

  1. Separate Move.toml for tests: Use a different Move.toml file for tests (if Aptos supports this)
  2. Accept the limitation: Keep the flag as a necessary part of the workflow

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions