Skip to content

Duplicate cheatcode call in SetAuthority test #20

@jberthold

Description

@jberthold

// accounts[0] can be either Account or Mint based on its data_len
// accounts[1] is Authority
// Note: We cannot determine the type at compile time, so we call both cheatcodes
cheatcode_is_account(&accounts[0]); // Could be Account
cheatcode_is_mint(&accounts[0]); // Could be Mint

Cheatcodes are mutually exclusive because they mutate the stored data according to which object is referred to (Account, Mint, Rent, Multisig). Therefore we cannot run a test that would branch on which kind of object we have.
According to the comment, the data_len field is used to determine whether a Mint or an Account is present in this test, we will have to split the test.

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