-
Notifications
You must be signed in to change notification settings - Fork 66
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 an Orca oracle type #813
Conversation
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'll need another more detailed review pass...
let whirlpool = Whirlpool::try_deserialize(&mut &data[..]).unwrap(); | ||
require!( | ||
whirlpool.token_mint_a == usdc_mint_mainnet::ID | ||
|| whirlpool.token_mint_b == usdc_mint_mainnet::ID, |
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.
ah, you flip implicitly based on what USDC is, smart!
I'd like to see an integration test that uses an orca oracle. It's reasonably easy to do now that ProgramTestContext has set_account(). (our solana.rs has a new set_account() for anchor-style accounts, added fairly recently in dev - but ProgramTestContext::set_account() can also set some bytes you read from a file to a chosen address) |
dcd2abb
to
38143d0
Compare
programs/mango-v4/src/instructions/perp_liq_negative_pnl_or_bankruptcy.rs
Show resolved
Hide resolved
account.set_data(data); | ||
let mut program_test_context = solana.context.borrow_mut(); | ||
program_test_context.set_account(&Pubkey::from_str(fixture.0).unwrap(), &account); | ||
} |
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.
👍
9a58fa1
to
0e82de1
Compare
@@ -344,7 +344,7 @@ async fn test_health_compute_tokens_fallback_oracles() -> Result<(), TransportEr | |||
#[tokio::test] | |||
async fn test_health_compute_serum() -> Result<(), TransportError> { | |||
let mut test_builder = TestContextBuilder::new(); | |||
test_builder.test().set_compute_max_units(130_500); | |||
test_builder.test().set_compute_max_units(135_000); |
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.
huh, how did this patch raise the CU cost this much?
if the index thing is a real issue, then this code is undertested (and has been before); would much appreciate adding a test that would at least detect essential issues like this one (Resolved: was not a real issue) |
3fa1535
to
09484b1
Compare
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.
(please squash-merge)
No description provided.