Skip to content

Commit

Permalink
Fix unit test, also DAI is using cellar adaptor
Browse files Browse the repository at this point in the history
  • Loading branch information
EricBolten committed Aug 21, 2023
1 parent bfe8203 commit 40a3772
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions steward/src/cellars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub(crate) mod cellar_v2_5;

pub const ALLOWED_CATALOGUE_ADAPTORS: [(&str, &str); 0] = [];
pub const ALLOWED_CATALOGUE_POSITIONS: [(&str, u32); 0] = [];
pub const ALLOWED_SETUP_ADAPTORS: [(&str, &str); 1] = [(CELLAR_RYUSD, ADAPTOR_DAI_SAVINGS_RATE_V1)];
pub const ALLOWED_SETUP_ADAPTORS: [(&str, &str); 1] = [(CELLAR_RYUSD, ADAPTOR_CELLAR_V2)];
pub const BLOCKED_ADAPTORS: [&str; 3] = [
ADAPTOR_UNIV3_V1,
ADAPTOR_VESTING_SIMPLE_V1,
Expand Down Expand Up @@ -55,7 +55,6 @@ pub const ADAPTOR_MORPHO_AAVE_V3_A_TOKEN_COLLATERAL_V1: &str =
pub const ADAPTOR_MORPHO_AAVE_V3_DEBT_TOKEN_V1: &str = "25a61f771af9a38c10ddd93c2bbab39a88926fa9";
pub const ADAPTOR_MORPHO_AAVE_V3_P2P_V1: &str = "4fe068caad05b82bf3f86e1f7d1a7b8bbf516111";
pub const ADAPTOR_UNIV3_V3: &str = "92611574ec9bc13c6137917481dab7bb7b173c9b";
pub const ADAPTOR_DAI_SAVINGS_RATE_V1: &str = "3b5ca5de4d808cd793d3a7b3a731d3e67e707b27";

// utils

Expand Down Expand Up @@ -288,7 +287,7 @@ mod tests {
#[test]
fn test_validate_setup_adaptor() {
// allows approved cellar/adaptor ID pairs
let (cellar_id, approved_adaptor_id) = (CELLAR_RYUSD, ADAPTOR_MORPHO_AAVE_V2_A_TOKEN_V1);
let (cellar_id, approved_adaptor_id) = (CELLAR_RYUSD, ADAPTOR_CELLAR_V2);
assert!(validate_setup_adaptor(cellar_id, approved_adaptor_id).is_ok());

let error_prefix = "SP call error: ".to_string();
Expand All @@ -302,7 +301,7 @@ mod tests {
assert_eq!(expected_err, res.unwrap_err().to_string());

// rejects unapproved cellar/adaptor ID pair
let unapproved_adaptor_id = ADAPTOR_CELLAR_V2;
let unapproved_adaptor_id = ADAPTOR_UNIV3_V3;
let res = validate_setup_adaptor(cellar_id, unapproved_adaptor_id);
let expected_err = error_prefix.clone()
+ &format!("adaptor {unapproved_adaptor_id} not allowed to be setup for {cellar_id}");
Expand Down

0 comments on commit 40a3772

Please sign in to comment.