-
Notifications
You must be signed in to change notification settings - Fork 212
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
feat(xc-admin): add price store instructions and executor support #1900
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
export function createPriceStoreInstruction( | ||
data: PriceStoreInstruction | ||
): TransactionInstruction { | ||
if (data.type == "Initialize") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i recommend using switch here, but if not triple equals (===
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored to use switch.
throw new Error("instruction data is too short"); | ||
} | ||
const publisherKey = new PublicKey(instruction.data.subarray(3, 35)); | ||
if (instruction.keys.length != 5) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
de we need to check remaining accounts to be valid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a check that accounts and instruction data match the expected values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
No description provided.