Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Inconsistency between Move.toml and source code addresses #141

Open
mkurnikov opened this issue Mar 22, 2022 · 1 comment
Open

[Bug] Inconsistency between Move.toml and source code addresses #141

mkurnikov opened this issue Mar 22, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@mkurnikov
Copy link
Contributor

🐛 Bug

Addresses parsing in the Move.toml performed by the https://github.com/diem/move/blob/main/language/tools/move-package/src/source_package/manifest_parser.rs#L278 and allows addresses in the form of

A1 = "0xefff111" # with prefix
A2 = "efffefffefffefffefff" # without prefix

On the other hand, in Move source code, parsing is performed by the https://github.com/diem/move/blob/main/language/move-compiler/src/shared/mod.rs#L67 and allows for the

let a = @0xAAFFEE;  // hex with 0x prefix
let b = @111222; // decimal without any prefix

It all basically means that

// Move.toml
HelloBlockchain = "11111111111111111111111111111111"
// main.move
assert!(@HelloBlockchain == @11111111111111111111111111111111, 1);

fails with assert, as those address values are of different bases.

Is this intentional?

@mkurnikov mkurnikov added the bug Something isn't working label Mar 22, 2022
@tnowacki
Copy link
Contributor

The package system should be matching Move's syntax, so I'd call that a bug (of sorts)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants