File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
target_chains/stylus/contracts/pyth-receiver/src Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -389,6 +389,16 @@ impl PythReceiver {
389
389
return Err ( PythReceiverError :: PriceFeedNotFoundWithinRange ) ;
390
390
}
391
391
392
+ if check_uniqueness {
393
+ let price_id_fb = FixedBytes :: < 32 > :: from ( price_feed_message. feed_id ) ;
394
+ let prev_price_info = self . latest_price_info . get ( price_id_fb) ;
395
+ let prev_publish_time = prev_price_info. publish_time . get ( ) . to :: < u64 > ( ) ;
396
+
397
+ if prev_publish_time > 0 && min_allowed_publish_time <= prev_publish_time {
398
+ return Err ( PythReceiverError :: PriceFeedNotFoundWithinRange ) ;
399
+ }
400
+ }
401
+
392
402
let price_info_return = (
393
403
U64 :: from ( publish_time) ,
394
404
I32 :: from_be_bytes ( price_feed_message. exponent . to_be_bytes ( ) ) ,
You can’t perform that action at this time.
0 commit comments