-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add 'new_from_bytes' function and update dependencies #75
Conversation
fn discriminator() -> [u8; 8] { | ||
[50, 35, 51, 115, 169, 219, 158, 52] | ||
} | ||
const DISCRIMINATOR: [u8; 8] = [50, 35, 51, 115, 169, 219, 158, 52]; |
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.
anchor made a breaking change here.
solana-program = "~1.10.29" | ||
anchor-lang = { git = "https://github.com/coral-xyz/anchor.git" } | ||
anchor-spl = { git = "https://github.com/coral-xyz/anchor.git" } | ||
rust_decimal = "1.26.0" |
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.
this rust decimal change isn't necessary
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.
lgtm
solana-program = "~1.10.29" | ||
anchor-lang = { git = "https://github.com/coral-xyz/anchor.git" } | ||
anchor-spl = { git = "https://github.com/coral-xyz/anchor.git" } | ||
rust_decimal = "1.26.0" |
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.
lgtm
/// | ||
/// let data_feed = AggregatorAccountData::new(feed_account_info.try_borrow_data()?)?; | ||
/// ``` | ||
pub fn new_from_bytes(data: &[u8]) -> anchor_lang::Result<&AggregatorAccountData> { |
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.
LGTM
AggregatorAccountData::new(account_info)
that currently seem unfixable. I can get you an error snippet if you need one. The easy solution is to make a similar function that takes in a slice of bytes (instead of an account info), which avoids the lifetime stuff entirely.(1) should probably be merged, (2) probably not