Open EmilRejman opened 1 year ago
How about hello_blockchain = "0x1234"
? Or is this not what you want ?
It doesnt work, at least for aptos: Command:
aptos move compile --named-addresses hello_blockchain=default
Result:
Compiling, may take a little while to download git dependencies...
{
"Error": "Move compilation failed: Unable to resolve packages for package 'Resources': Unable to resolve named address 'hello_blockchain' in package 'Resources' when resolving dependencies: Attempted to assign a different value '0x1234' to an a already-assigned named address '0xf854(...)'"
}
BTW my move-analyzer
module ofter "freezes", eg. I make some changes in the code and there is completly no different output from move-analyzer package/rust-module, it is the same error when for example I deleted whole line.
Tehre are no options to configure move-analyzer
or aquire logs in easy way to see why is it freezing
I see. How about hello_blockchain = "0xf854...YOUR DEFAULT ADDRESS"
What is the point of named-addresses then?
Yeah it works that way, but I just wanted to report the bug, which is names-addresses
is not working correctly with move-analyzer.
Ah, I think I understand now. While it is still not sure this is the "bug of move-analyzer", maybe you want to say is right. Don't you think that "enhancement for integration with aptos cli" sounds better? Because this is nothing to do with other frameworks, right?
I changed move/language/tools/move-package/src/source_package/manifest_parser.rs from line:226
into
if entry_str == EMPTY_ADDR_STR {
// original codes
// if addresses.insert(ident, None).is_some() {
// bail!("Duplicate address name '{}' found.", ident);
// }
// changed codes
if addresses.insert(
ident,
Some(parse_address_literal("0x00").context(
"Error with parsing stubbed address 0x00"
)?),
)
.is_some() {
bail!("Duplicate address name '{}' found.", ident);
}
} else ...
and move-analyzer looks working for now. Please test if you like.
is the fix be merged ?
no.
🐛 Bug
While using named_addresses:
The
move-analyzer
VSCode pacage is throwing error:and not showing any other code errors in VSCode.
There is no other way to make named addresses working in VSCode.
To reproduce
use any named-address with VSCode
move-analyzer
package.Stack trace/error message
Expected Behavior
It handles named-address like any other address, so we can use --named-addresses with cli, eg:
System information
Docker:
aptoslabs/tools:mainnet
Additional context
none