Skip to content

StateKeys reading from state #501

Closed Answered by patrick-ogrady
Andyvargtz asked this question in Q&A
Discussion options

You must be logged in to vote

Context: I’m using hypersdk to create a vm that plays checkers. I’m storing the game related info (players, turn, and status) in a value associated to a BoardID. The structure of the action MovePiece (in charge of moving the pieces) consists of the BoardId and the positions for piece to move.

Can't wait to play ❤️

I know I can make that “actor's opponent” element part of my action struct, but since this is an already stored data, I would like to just retrieve it from the state, instead of providing it and validate. Is that possible? If so, whats the best practice to do so?

Great question! In short, no you cannot "just retrieve it from the state."

Much of the HyperSDK's execution perfo…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by patrick-ogrady
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants