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

custom program error: 0x0 #2

Closed
easydeveloppement opened this issue Dec 28, 2021 · 5 comments
Closed

custom program error: 0x0 #2

easydeveloppement opened this issue Dec 28, 2021 · 5 comments

Comments

@easydeveloppement
Copy link

Hello,
when i run anchor test, it fails initializing escrow account with error "custom program error: 0x0".
afaik, it means one account lack sols. But i don't know which one...
I have enough SOL in the payer account for sure.
I even have SOL in escrow account...
WHat could it be ? Anyone has an idea ?

@easydeveloppement
Copy link
Author

logs: [
'Program 11111111111111111111111111111111 invoke [1]',
'Create Account: account Address { address: 96HTraVPkEfESnUKjx5oAr1SiaZJw2eHgiKfBc7SXRnE, base: None } already in use',
'Program 11111111111111111111111111111111 failed: custom program error: 0x0'
]

here are the logs

96HTraVPkEfESnUKjx5oAr1SiaZJw2eHgiKfBc7SXRnE => it is the escrowAccount public key

@ironaddicteddog
Copy link
Owner

Hi, it means the account with that address is already created.

Which cluster are you connecting to?

@easydeveloppement
Copy link
Author

Hi, i'm using devnet.
So it means an escrow account can only be used once i guess.
So if i want to test this script, the escrow account must be different every time ? So i just need to change the seed phrase for this account ? (in rust & in JS)

@easydeveloppement
Copy link
Author

what i don't really understand is which account is already created ?
Because it seems to be the escrow account (so my last comment makes no sens about the seed phrase, because it's for PDA)
=> but the escrow account is created for every test with const escrowAccount = anchor.web3.Keypair.generate();

so how could it be already created ? Furthermore, when i check on solana explorer, it displays no activity before my test.

So i think there might be something that i don't get ?

@easydeveloppement
Copy link
Author

Ok, i think i understood.
I modified the JS testing script, and i was airdroping some SOL to the escrow account (i think i had an error that i didn't get, and tried that...), as soon as i removed it, it worked perfectly.
And for information, i could run more than once with the same "escrow" and "token-seed", si no need to update them.

Thank you so much for your help !!!

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