Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

safeFetchCandyGuard throws errors on missing #57

Open
sohrab- opened this issue Dec 24, 2023 · 1 comment
Open

safeFetchCandyGuard throws errors on missing #57

sohrab- opened this issue Dec 24, 2023 · 1 comment

Comments

@sohrab-
Copy link
Contributor

sohrab- commented Dec 24, 2023

My understanding of safe* functions was that they return null when the account does not exist. However, it actually throws an UnexpectedAccountError on the empty buffer.

UnexpectedAccountError: The account at the provided address [3ix9kizh1uKa7PEYhWUHLseMRVMtqgu5eSUTZ6LT3Ezt] is not of the expected type [CandyGuard].

Source: SDK

Caused By: DeserializingEmptyBufferError: Serializer [i8] cannot deserialize empty buffers.

    at deserializeAccount (Account.ts:63:11)
    at deserializeCandyGuard (candyGuard.ts:90:10)
    at safeFetchCandyGuard (candyGuard.ts:125:7)

@metaplex-foundation/mpl-candy-machine v6.0.0

@lorisleiva
Copy link
Contributor

Hi there, I think this is to do with an account that exists (i.e. had some lamports) but no data. The "safe" part currently doesn't protect you against accounts that exist but don't have the expected data. I'm in two minds whether it should or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants