forked from solana-program/token
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
solana-token/p-token/src/entrypoint-runtime-verification.rs
Lines 2091 to 2095 in 0f37d6b
// 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
Labels
No labels