Skip to content

Commit

Permalink
P-54 Binary search for holding time assertion (#2401)
Browse files Browse the repository at this point in the history
Co-authored-by: Kailai Wang <kailai.wang@trustcomputing.de>
Co-authored-by: Zhouhui Tian <zhouhui@liteng.io>
  • Loading branch information
3 people committed Jan 26, 2024
1 parent 8737753 commit f120d87
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 139 deletions.
23 changes: 1 addition & 22 deletions primitives/core/src/assertion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::{
use codec::{Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
use sp_runtime::{traits::ConstU32, BoundedVec};
use sp_std::{str, vec, vec::Vec};
use sp_std::{vec, vec::Vec};

pub type ParameterString = BoundedVec<u8, ConstU32<64>>;

Expand Down Expand Up @@ -313,27 +313,6 @@ impl Assertion {
}
}

pub const ASSERTION_DATE_LEN: usize = 15;
pub const ASSERTION_FROM_DATE: [&str; ASSERTION_DATE_LEN] = [
"2017-01-01",
"2017-07-01",
"2018-01-01",
"2018-07-01",
"2019-01-01",
"2019-07-01",
"2020-01-01",
"2020-07-01",
"2021-01-01",
"2021-07-01",
"2022-01-01",
"2022-07-01",
"2023-01-01",
"2023-07-01",
// In order to address the issue of the community encountering a false query for WBTC in
// November, the product team feels that adding this date temporarily solves this problem.
"2023-12-01",
];

#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq, MaxEncodedLen, TypeInfo)]
pub enum AmountHoldingTimeType {
#[codec(index = 0)]
Expand Down
Loading

0 comments on commit f120d87

Please sign in to comment.