Skip to content

Commit

Permalink
update oracle hash
Browse files Browse the repository at this point in the history
  • Loading branch information
zksemi committed Mar 25, 2024
1 parent 9772b67 commit 1997851
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions types/src/tx_type/contract/prices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,17 @@ impl OraclePrices {

impl GetBytes for OraclePrices {
fn get_bytes(&self) -> Vec<u8> {
let contract_prices_hash = self.contract_prices.rescue_hash();
let margin_prices_hash = self.margin_prices.rescue_hash();
let bytes_len = self.bytes_len();
let mut margins_encode = Vec::with_capacity(bytes_len);
margins_encode.extend(self.contract_prices.get_bytes());
margins_encode.extend(self.margin_prices.get_bytes());
margins_encode.extend(contract_prices_hash);
margins_encode.extend(margin_prices_hash);
assert_eq!(margins_encode.len(), bytes_len);
margins_encode
}

fn bytes_len(&self) -> usize {
self.margin_prices.bytes_len() + self.contract_prices.bytes_len()
62
}
}

0 comments on commit 1997851

Please sign in to comment.