Skip to content

Commit

Permalink
DSR for RYUSD (#218)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
EricBolten authored Aug 21, 2023
1 parent 7668856 commit dbc58a9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 26 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion steward/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "steward"
authors = []
version = "3.4.0"
version = "3.4.1"
edition = "2018"

[dependencies]
Expand Down
28 changes: 10 additions & 18 deletions steward/src/cellars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();
Expand All @@ -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}");
Expand Down
2 changes: 1 addition & 1 deletion steward_abi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion steward_proto_rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit dbc58a9

Please sign in to comment.