Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR re-organizes many of the modules in the current Rust rewrite of the oracle contract, in particular:
1: Creates
accounts.rsforPythAccountThis moves
PythAccountinto its own module, and moves methods fromutilsthat are parameterized by unconstrainedT, this allows the methods to be correctly bound to theirimpls, all call-sites change in this way:All account specific helpers from
utils.rsare then moved toaccounts.rsto move away from theutils.rsanti-pattern. Each individual account exists underaccounts/which also means associated data can be colocated with the account, such as thePERMISSIONSseed which now lives inaccounts/permission.rs.2: Moves handlers under
processor/This removes the
rust_oraclemodule and moves handlers under theprocessormodule, each handler has its own module which makes it easier to colocate functions that are only related to specific handlers. For example thec_upd_aggregatefunction now lives inprocessor/upd_price.rsThese two changes nearly empty
c_oracle_header.rswhich was an ad-hoc place for account definitions and utilities. The rest ofutils.rscan also be refactored, but as a separate PR.