Open mshakeg opened 1 month ago
imo there should also be a way to specify the [addresses]
per live network(e.g. mainnet, testnet, devnet or even other custom networks) for example something like:
# ...
[network]
default = "mainnet" # Specify default network (optional)
[network.mainnet]
my_staking = "0x1"
my_staking_resource_account = "0x2"
[network.testnet]
my_staking = "0x4"
my_staking_resource_account = "0x5"
[network.devnet]
my_staking = "0x7"
my_staking_resource_account = "0x8"
[network.customnet]
rpc_url = "https://custom-rpc-url.com" # Custom RPC URL for non-default networks
my_staking = "0xCustom1"
my_staking_resource_account = "0xCustom2"
[dev-addresses]
my_staking = "0xDev1"
my_staking_resource_account = "0xDev2"
# ...
Description
When running tests with
aptos move test
, the CLI attempts to resolve addresses from the[addresses]
section of theMove.toml
file, even when[dev-addresses]
are defined specifically for testing. This causes address conflicts, especially when placeholder values (like_
) are used in the[addresses]
section for production or deployment.The following error occurs when the same named address is used in both sections:
Current Workaround: The current way to avoid this is to either:
[dev-addresses]
section, or[addresses]
with underscores (_
).Proposed Solution
It would be more efficient if
aptos move test
prioritized addresses from[dev-addresses]
when running in dev mode. This would allow for smooth local testing without having to temporarily adjust or remove entries from the[addresses]
or[dev-addresses]
sections.This change would improve the development experience, especially since the typical workflow involves using specific addresses for local testing first and production addresses later on.
Sample
Move.toml
:Versions:
Related Issues:
https://github.com/aptos-labs/aptos-core/issues/7228