Open mentalrob opened 2 years ago
closing for now...might be a local issue, cannot reproduce. consider rimraffing and getting a fresh clone of the repository.
feel free to reopen if the issue persists.
@mentalrob Hello, did you figure the issue? I am getting the same issue as above.
).accounts({
player: provider.wallet.publicKey,
playerStats: playerStatsPDA,
game: playerGamePDA,
depositWallet: depositWallet,
slotHashes: anchor.web3.SYSVAR_SLOT_HASHES_PUBKEY,
}).rpc().catch((err) => {
pub system_program: Program<'info, System>,
pub slot_hashes: Sysvar<'info, SlotHashes>
}
Is initialized!:
Error: AnchorError caused by account: slot_hashes. Error Code: AccountSysvarMismatch. Error Number: 3015. Error Message: The given public key does not match the required sysvar.
I couldn't fixed it, used a nasty workaround
@mentalrob thanks for quick reply. Is it possible to share the workaround?
@callensm Can we reopen this ticket?
I get the slothash offchain and giving it to the program as a parameter
I get the slothash offchain and giving it to the program as a parameter
oh okay, is there a way to validate/verify the hash sent from client offchain is not fake?
I am still getting this error when trying to use Sysvar SlotHashes
> Program log: AnchorError caused by account: recent_slothashes. Error Code: AccountSysvarMismatch. Error Number: 3015. Error Message: The given public key does not match the required sysvar.```
Getting this error as well. Only for this sysvar.
Ah, here is why. SlotHashes doesn't support from_account_info
.
The goal of this sysvar is to be used off chain
Program:
Test:
throws an error
Error: AnchorError caused by account: slot_hashes. Error Code: AccountSysvarMismatch. Error Number: 3015. Error Message: The given public key does not match the required sysvar.
while usinganchor-test
. If i removeSYSVAR_SLOT_HASHES_PUBKEY
andslot_hashes
it works.