Skip to content

feat: stylus parse price feed updates fxn #2840

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

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4cc13db
removed extra get fee function
ayushboss Jul 7, 2025
088d0d8
setting up internal parse fxn
ayushboss Jul 7, 2025
82783ec
removed price ids input
ayushboss Jul 7, 2025
9453d7b
removed price ids input 2
ayushboss Jul 7, 2025
22ebbd3
feat: modify parse functions to return HashMap internally and matchin…
devin-ai-integration[bot] Jul 7, 2025
ce8a378
feat: modify parse functions to return map internally and handle arra…
devin-ai-integration[bot] Jul 7, 2025
bc242c7
fix: parse_price_feed_updates_internal now processes incoming price f…
devin-ai-integration[bot] Jul 7, 2025
31a8bbb
formatted
ayushboss Jul 7, 2025
7f2407d
Merge branch 'pyth-stylus-update-and-initialize' into pyth-stylus-par…
ayushboss Jul 8, 2025
9e45927
getting publish time filtering working
ayushboss Jul 8, 2025
3e39a40
feat: add publish time validation in parse_price_feed_updates_internal
devin-ai-integration[bot] Jul 8, 2025
55658af
feat: implement check_uniqueness validation in parse_price_feed_updat…
devin-ai-integration[bot] Jul 8, 2025
47d535a
removed extraneous parameters
ayushboss Jul 8, 2025
b4bb65f
Merge branch 'main' into pyth-stylus-parse-updates
ayushboss 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
cc10bd0
Merge branch 'pyth-stylus-update-and-initialize' into pyth-stylus-par…
ayushboss Jul 11, 2025
99998e4
removed parentheses
ayushboss Jul 11, 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
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 @@ -17,6 +17,8 @@ pub enum PythReceiverError {
InsufficientFee,
InvalidEmitterAddress,
TooManyUpdates,
PriceFeedNotFoundWithinRange,
NoFreshUpdate,
}

impl core::fmt::Debug for PythReceiverError {
Expand All @@ -43,6 +45,8 @@ impl From<PythReceiverError> for Vec<u8> {
PythReceiverError::InsufficientFee => 13,
PythReceiverError::InvalidEmitterAddress => 14,
PythReceiverError::TooManyUpdates => 15,
PythReceiverError::PriceFeedNotFoundWithinRange => 16,
PythReceiverError::NoFreshUpdate => 17,
}]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -342,4 +342,14 @@ mod test {
multiple_updates_diff_vaa_results()[1]
);
}

#[motsu::test]
fn test_multiple_updates_same_id_updates_latest(
Copy link
Contributor

Choose a reason for hiding this comment

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

unfinished tests?

pyth_contract: Contract<PythReceiver>,
wormhole_contract: Contract<WormholeContract>,
alice: Address,
) {
pyth_wormhole_init(&pyth_contract, &wormhole_contract, &alice);
alice.fund(U256::from(200));
}
}
Loading