From 8d4e3615a20962ae8f8b039d45988a4cfa3b9eec Mon Sep 17 00:00:00 2001 From: JordyRo1 Date: Mon, 23 Oct 2023 20:57:33 +0200 Subject: [PATCH] fix: fmt --- src/oracle/oracle.cairo | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/oracle/oracle.cairo b/src/oracle/oracle.cairo index 5f3892dc..5e9a17fb 100644 --- a/src/oracle/oracle.cairo +++ b/src/oracle/oracle.cairo @@ -191,7 +191,7 @@ mod Oracle { const MAX_FELT: u256 = 3618502788666131213697322783095070105623107215331596699973092056135872020480; //max felt value const TIMESTAMP_SHIFT_U32: felt252 = 0x100000000; - const TIMESTAMP_SHIFT_MASK_U32 : u128 = 0xffffffff; + const TIMESTAMP_SHIFT_MASK_U32: u128 = 0xffffffff; const VOLUME_SHIFT_U132: felt252 = 0x1000000000000000000000000000000000; const VOLUME_SHIFT_MASK_U100: u128 = 0xfffffffffffffffffffffffff; @@ -373,8 +373,14 @@ mod Oracle { impl EntryStorePacking of StorePacking { fn pack(value: EntryStorage) -> felt252 { // entries verifications (no overflow) - assert(value.timestamp.into() == value.timestamp.into() & TIMESTAMP_SHIFT_MASK_U32, 'EntryStorePack:tmp too big'); - assert(value.volume.into() == value.volume.into() & VOLUME_SHIFT_MASK_U100, 'EntryStorePack:volume too big'); + assert( + value.timestamp.into() == value.timestamp.into() & TIMESTAMP_SHIFT_MASK_U32, + 'EntryStorePack:tmp too big' + ); + assert( + value.volume.into() == value.volume.into() & VOLUME_SHIFT_MASK_U100, + 'EntryStorePack:volume too big' + ); let pack_value: felt252 = value.timestamp.into() + value.volume.into() * TIMESTAMP_SHIFT_U32 + value.price.into() * VOLUME_SHIFT_U132;