Skip to content

feat(stylus): implement queryPriceFeed, priceFeedExists functions, clean tests #2849

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

Draft
wants to merge 23 commits into
base: pyth-stylus-additional-update-parse-fxns
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ac3d505
removing extraneous comments
ayushboss Jul 9, 2025
0f9de33
cleaned serialization
ayushboss Jul 9, 2025
ab0b2a3
cleaned up test_data file usage
ayushboss Jul 9, 2025
3a559c0
fixed update and parse functions to take in a vector of vector of u8s…
ayushboss Jul 9, 2025
7f6afc9
added test to verify multiple updates configured
ayushboss Jul 9, 2025
a0310a2
imported mock_instant crate
ayushboss Jul 9, 2025
0681af5
feat: implement mock_instant integration for get_current_timestamp
devin-ai-integration[bot] Jul 9, 2025
ba64927
feat: add cfg(test) attributes to all test_data.rs functions
devin-ai-integration[bot] Jul 9, 2025
02014ab
Merge branch 'pyth-stylus-update-and-initialize' into pyth-stylus-par…
ayushboss Jul 9, 2025
9e144ff
implemented parse_price_feed_updates_unique
ayushboss Jul 9, 2025
6897096
pushing work for now
ayushboss Jul 9, 2025
2c77720
fix: modify parse_price_feed_updates_with_config to preserve existing…
devin-ai-integration[bot] Jul 9, 2025
9f3d809
set up integration tests
ayushboss Jul 10, 2025
7f154ba
feat: modify PriceFeedReturn to use byte arrays and simplify parsing …
devin-ai-integration[bot] Jul 10, 2025
9fe481a
feat: add price_id field to PriceFeedStorage and rename from PriceInf…
devin-ai-integration[bot] Jul 10, 2025
1aee40c
finished adding id back to return type, distinguishing between get re…
ayushboss Jul 10, 2025
1c82321
format
ayushboss Jul 10, 2025
9bd142d
fixed import name error
ayushboss Jul 10, 2025
fce2f10
finished query price feeds function
ayushboss Jul 10, 2025
d6b04e0
formatted
ayushboss Jul 10, 2025
fcd55c4
finished price_feed_exists method
ayushboss Jul 10, 2025
cef812a
trying to clean up testing framework
ayushboss Jul 10, 2025
a762be9
fixed test error, all passing
ayushboss Jul 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions target_chains/stylus/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions target_chains/stylus/contracts/pyth-receiver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ stylus-sdk = { version = "0.9.0", features = ["stylus-test"] }
dotenv = "0.15.0"
motsu = "0.9.0"
wormhole-contract = { path = "../wormhole" }
mock_instant = "0.6.0"

[features]
default = ["mini-alloc"]
Expand Down
4 changes: 4 additions & 0 deletions target_chains/stylus/contracts/pyth-receiver/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ pub enum PythReceiverError {
InvalidEmitterAddress,
TooManyUpdates,
PriceFeedNotFoundWithinRange,
NoFreshUpdate,
PriceFeedNotFound,
}

impl core::fmt::Debug for PythReceiverError {
Expand Down Expand Up @@ -45,6 +47,8 @@ impl From<PythReceiverError> for Vec<u8> {
PythReceiverError::InvalidEmitterAddress => 14,
PythReceiverError::TooManyUpdates => 15,
PythReceiverError::PriceFeedNotFoundWithinRange => 16,
PythReceiverError::NoFreshUpdate => 17,
PythReceiverError::PriceFeedNotFound => 18,
}]
}
}
Loading