diem/move

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

Opened this issue ยท 1 comments

๐Ÿ› 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?

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