Skip to content
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 ability to update oracle addresses #38

Merged
merged 1 commit into from
Aug 19, 2021
Merged

Conversation

DaSichuan
Copy link

Adds ability to update oracle addresses.

Currently pretty hard to test because of all the validation that happens on the new addresses.
Not really sure the best way to test this yet.

@@ -2034,6 +1991,18 @@ fn process_update_reserve_config(
);
return Err(LendingError::InvalidMarketAuthority.into());
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit hacky, and I don't love it.
The logic is basically

If 1 optional address is supplied, assume it's [switchboard]
If 2 optional addresses are supplied, assume its [pyth_product, pyth price]
If 3 optional addresses are supplied, assume it's [pyth_product, pyth_price, switchboard]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think perhaps it would be better if always had to pass 3 things but we could check if they were like default values

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah thats a better idea.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did something slightly different.
I made it such that if new addresses aren't specified, then it calls the instruction with the old oracle addresses and a bogus address as the pyth product address.

 Please enter the commit message for your changes. Lines starting
@DaSichuan DaSichuan merged commit b51bfa9 into staging Aug 19, 2021
@DaSichuan DaSichuan deleted the WM_update_oracle branch August 19, 2021 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants