From dbc58a922d38e1ae6bc241f891d0a38e9e66f9fb Mon Sep 17 00:00:00 2001 From: Eric Bolten Date: Mon, 21 Aug 2023 09:52:52 -0700 Subject: [PATCH] DSR for RYUSD (#218) * DSR for RYUSD * bump to v3.4.1 * Fix unit test, also DAI is using cellar adaptor * Ignore unit tests for empty lists * Saner unit test update --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- steward/Cargo.toml | 2 +- steward/src/cellars.rs | 28 ++++++++++------------------ steward_abi/Cargo.toml | 2 +- steward_proto_rust/Cargo.toml | 2 +- 6 files changed, 18 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9dc6f7e2..16173a56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4688,7 +4688,7 @@ dependencies = [ [[package]] name = "sommelier_steward" -version = "3.4.0" +version = "3.4.1" dependencies = [ "lazy_static", "steward", @@ -4779,7 +4779,7 @@ checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" [[package]] name = "steward" -version = "3.4.0" +version = "3.4.1" dependencies = [ "abscissa_core", "abscissa_tokio", @@ -4832,7 +4832,7 @@ dependencies = [ [[package]] name = "steward_abi" -version = "3.4.0" +version = "3.4.1" dependencies = [ "ethers", "serde", @@ -4852,7 +4852,7 @@ dependencies = [ [[package]] name = "steward_proto" -version = "3.4.0" +version = "3.4.1" dependencies = [ "prost 0.7.0", "prost-types 0.7.0", diff --git a/Cargo.toml b/Cargo.toml index ca086f67..f4564369 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sommelier_steward" -version = "3.4.0" +version = "3.4.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/steward/Cargo.toml b/steward/Cargo.toml index 7d8899f4..0cdf2c2e 100644 --- a/steward/Cargo.toml +++ b/steward/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "steward" authors = [] -version = "3.4.0" +version = "3.4.1" edition = "2018" [dependencies] diff --git a/steward/src/cellars.rs b/steward/src/cellars.rs index 5e8f3fab..51ca5aeb 100644 --- a/steward/src/cellars.rs +++ b/steward/src/cellars.rs @@ -18,20 +18,10 @@ pub(crate) mod cellar_v2_5; // allow/block lists. -pub const ALLOWED_CATALOGUE_ADAPTORS: [(&str, &str); 2] = [ - (CELLAR_RYETH, ADAPTOR_UNIV3_V3), - (CELLAR_RYBTC, ADAPTOR_UNIV3_V3), -]; -pub const ALLOWED_CATALOGUE_POSITIONS: [(&str, u32); 6] = [ - (CELLAR_RYETH, 185), - (CELLAR_RYETH, 186), - (CELLAR_RYETH, 187), - (CELLAR_RYBTC, 185), - (CELLAR_RYBTC, 186), - (CELLAR_RYBTC, 187), -]; -pub const ALLOWED_SETUP_ADAPTORS: [(&str, &str); 1] = - [(CELLAR_RYUSD, ADAPTOR_MORPHO_AAVE_V2_A_TOKEN_V1)]; +// update catalogue unit tests if adding values to these zero length lists +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_CELLAR_V2)]; pub const BLOCKED_ADAPTORS: [&str; 3] = [ ADAPTOR_UNIV3_V1, ADAPTOR_VESTING_SIMPLE_V1, @@ -230,7 +220,8 @@ mod tests { fn test_validate_add_adaptor_to_catalogue() { // allows approved cellar/adaptor ID pairs let (cellar_id, approved_adaptor_id) = (CELLAR_RYETH, ADAPTOR_UNIV3_V3); - assert!(validate_add_adaptor_to_catalogue(cellar_id, approved_adaptor_id).is_ok()); + // "approved" assertion commented out since the list is empty, update if any elements are added + //assert!(validate_add_adaptor_to_catalogue(cellar_id, approved_adaptor_id).is_ok()); let error_prefix = "SP call error: ".to_string(); @@ -264,7 +255,8 @@ mod tests { fn test_validate_add_position_to_catalogue() { // allows approved cellar/position ID pairs let (cellar_id, approved_pos) = (CELLAR_RYETH, 185); - assert!(validate_add_position_to_catalogue(cellar_id, approved_pos).is_ok()); + // "approved" assertion commented out since the list is empty, update if any elements are added + //assert!(validate_add_position_to_catalogue(cellar_id, approved_pos).is_ok()); let error_prefix = "SP call error: ".to_string(); @@ -298,7 +290,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(); @@ -312,7 +304,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}"); diff --git a/steward_abi/Cargo.toml b/steward_abi/Cargo.toml index 4e679c5f..926f19c4 100644 --- a/steward_abi/Cargo.toml +++ b/steward_abi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "steward_abi" -version = "3.4.0" +version = "3.4.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/steward_proto_rust/Cargo.toml b/steward_proto_rust/Cargo.toml index 012b0603..ba1ddb43 100644 --- a/steward_proto_rust/Cargo.toml +++ b/steward_proto_rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "steward_proto" -version = "3.4.0" +version = "3.4.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html