Skip to content

Prefer Address::new_unique() in tests #69

Description

@fedgiac

(Inspired by this comment.)

Unless the actual byte representation of an account is important, it makes sense to avoid manually specifying the address bytes to make sure we don't create overlapping accounts by accident. We could also use something like account_from_string("purpose"), though I'm a bit skeptical since for debugging we'd realistically still cause a test failure to see the relevant address and see if it matches with the expected one. It would be great if the test output would be using the given string like in Foundry, but I don't think there's anything like this.

This issue is solved if we rewrite the relevant part of the tests to not specify the bytes except for the tests that explicitly represent encoded and decoded bytes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions