@@ -46,18 +46,6 @@ pub struct DataSource {
46
46
pub emitter_address : FixedBytes < 32 > ,
47
47
}
48
48
49
- // impl StorageKey for DataSourceStorage {
50
- // fn to_slot(&self, root: B256) -> U256 {
51
- // let chain_id: u16 = self.chain_id.get().to::<u16>();
52
- // let emitter_address = self.emitter_address.get();
53
-
54
- // let bytes = serialize_data_source_to_bytes(chain_id, emitter_address.as_slice().try_into().unwrap())
55
- // .expect("Failed to serialize DataSource");
56
-
57
- // keccak256(bytes).to_slot(root)
58
- // }
59
- // }
60
-
61
49
impl StorageKey for DataSource {
62
50
fn to_slot ( & self , root : B256 ) -> U256 {
63
51
let chain_id: u16 = self . chain_id . to :: < u16 > ( ) ;
@@ -69,24 +57,6 @@ impl StorageKey for DataSource {
69
57
keccak256 ( bytes) . to_slot ( root)
70
58
}
71
59
}
72
-
73
- // pub trait GetDataSource {
74
- // fn data_source(&self) -> DataSourceStorage;
75
- // }
76
-
77
- // impl GetDataSource for VerifiedVM {
78
- // fn data_source(&self) -> DataSourceStorage {
79
- // let mut ds = DataSourceStorage {
80
- // chain_id: StorageU16::new(storage_key!("chain_id")),
81
- // emitter_address: StorageFixedBytes::<32>::new(storage_key!("emitter_address")),
82
- // };
83
- // ds.chain_id.set(self.emitter_chain_id.into());
84
- // ds.emitter_address.set(self.emitter_address);
85
- // ds
86
- // }
87
- // }
88
-
89
- // PriceInfo struct storing price information
90
60
#[ storage]
91
61
pub struct PriceInfoStorage {
92
62
pub publish_time : StorageU64 ,
@@ -109,20 +79,6 @@ pub struct PriceInfoStorage {
109
79
// pub ema_conf: U64,
110
80
// }
111
81
112
- // impl From<&PriceFeedMessage> for PriceInfo {
113
- // fn from(price_feed_message: &PriceFeedMessage) -> Self {
114
- // Self {
115
- // publish_time: U64::from(price_feed_message.publish_time),
116
- // expo: I32::from_be_bytes(price_feed_message.exponent.to_be_bytes()),
117
- // price: I64::from_be_bytes(price_feed_message.price.to_be_bytes()),
118
- // conf: U64::from(price_feed_message.conf),
119
- // ema_price: I64::from_be_bytes(price_feed_message.ema_price.to_be_bytes()),
120
- // ema_conf: U64::from(price_feed_message.ema_conf),
121
- // }
122
- // }
123
- // }
124
-
125
- // PriceInfo struct storing price information
126
82
pub type PriceInfoReturn = ( U64 , I32 , I64 , U64 , I64 , U64 ) ;
127
83
128
84
#[ cfg( test) ]
0 commit comments