Skip to content
This repository was archived by the owner on May 4, 2024. It is now read-only.
This repository was archived by the owner on May 4, 2024. It is now read-only.

[Bug] Unable to generate ABI when feature address20 or feature address32 is enabled. #1033

Open
@jewelzms

Description

@jewelzms

🐛 Bug

To reproduce

Install move-cli
Unable to generate ABI when feature address20 or feature address32 is enabled.

# cargo install --features address20 --path language/tools/move-cli

build move contract
No ABI is generated when building, nor are there any error messages.

# move build --abi

Reason

Module type judgment logic error.

Error code segment

// language/move-model/src/ast.rs
pub fn is_script(&self) -> bool {
    static MAX_ADDR: Lazy<BigUint> = Lazy::new(|| {
        BigUint::from_str_radix("ffffffffffffffffffffffffffffffff", 16).expect("valid hex")
    });
    self.0 == *MAX_ADDR
}

Fix suggestion

// language/move-model/src/ast.rs
pub fn is_script(&self) -> bool {
    static MAX_ADDR: Lazy<BigUint> = Lazy::new(|| {
        use move_core_types::account_address::AccountAddress;
        BigUint::from_bytes_be(&[0xff; AccountAddress::LENGTH].to_vec())
    });
    self.0 == *MAX_ADDR
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions