feat: implement handling and execution of oracle data #62
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.
implement handling of oracle data received via the execution API.
see relevant contract for context: https://github.com/astriaorg/astria-oracle-contracts/blob/main/src/AstriaOracle.sol
flow is as follows:
AstriaOracle
contract is deployed on the rollup and the address is set in genesisRollupData.OracleData
via the execution API, which consists of a vector of price updates, it converts these into contract calls toAstriaOracle
.initializeCurrencyPair
before callingupdatePriceData
. this is needed to set the decimals for that pair, which is not updated once the pair has been initialized.other changes:
DepositTx
toInjectedTx
, as the same type is now being used for deposits and oracle updates. it was not necessary to create a new type, as the previous erc20 calls being done by theDepositTx
were generic to what they were calling.grpc/execution/validation.go
validation and conversion function into separate functions for eachRollupData
type, no logic was changed for Deposit/SequencedData.todo:
updatePriceData
will be dependent on the number of prices being updated.