Skip to content

Commit

Permalink
Review items
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrit committed Sep 19, 2023
1 parent 7681904 commit 3137d37
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 27 deletions.
4 changes: 2 additions & 2 deletions proto/adaptors/frax/collateral_f_token.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ message CollateralFTokenAdaptorV1 {
*/
message AddCollateral {
// The FraxLend pair to add collateral to.
string fraxlend_pair = 2;
string fraxlend_pair = 1;
// The amount of collateral to add to the cellar position.
string collateral_to_deposit = 1;
string collateral_to_deposit = 2;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion proto/adaptors/frax/debt_f_token.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ message DebtFTokenAdaptorV1 {
/*
* Allows a strategist to call `addInterest` on a Frax Pair they are using
*
* Represents `function callAddInterest(IFToken fToken)`
* Represents `function callAddInterest(IFToken _fraxlendPair)`
*/
message CallAddInterest {
// The address of the pair to call addInterest on.
Expand Down
24 changes: 8 additions & 16 deletions steward/src/cellars/adaptors/sommelier.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ethers::{abi::AbiEncode, types::Bytes};
use steward_abi::cellar_adaptor_v1::CellarAdaptorV1Calls as AbiCellarAdaptorV1Calls;
use steward_abi::legacy_cellar_adaptor_v1::LegacyCellarAdaptorV1Calls as AbiLegacyCellarAdaptorV1Calls;
use steward_abi::cellar_adaptor_v1::CellarAdaptorV1Calls;
use steward_abi::legacy_cellar_adaptor_v1::LegacyCellarAdaptorV1Calls;
use steward_proto::steward::{cellar_adaptor_v1, legacy_cellar_adaptor_v1};

use crate::{
Expand All @@ -23,19 +23,15 @@ pub(crate) fn cellar_adaptor_v1_calls(
cellar: sp_call_parse_address(p.cellar)?,
assets: string_to_u256(p.assets)?,
};
calls.push(
AbiCellarAdaptorV1Calls::DepositToCellar(call)
.encode()
.into(),
)
calls.push(CellarAdaptorV1Calls::DepositToCellar(call).encode().into())
}
cellar_adaptor_v1::Function::WithdrawFromCellar(p) => {
let call = steward_abi::cellar_adaptor_v1::WithdrawFromCellarCall {
cellar: sp_call_parse_address(p.cellar)?,
assets: string_to_u256(p.assets)?,
};
calls.push(
AbiCellarAdaptorV1Calls::WithdrawFromCellar(call)
CellarAdaptorV1Calls::WithdrawFromCellar(call)
.encode()
.into(),
)
Expand All @@ -45,11 +41,7 @@ pub(crate) fn cellar_adaptor_v1_calls(
asset: sp_call_parse_address(p.asset)?,
spender: sp_call_parse_address(p.spender)?,
};
calls.push(
AbiCellarAdaptorV1Calls::RevokeApproval(call)
.encode()
.into(),
)
calls.push(CellarAdaptorV1Calls::RevokeApproval(call).encode().into())
}
}
}
Expand All @@ -74,7 +66,7 @@ pub(crate) fn legacy_cellar_adaptor_v1_calls(
oracle: sp_call_parse_address(p.oracle)?,
};
calls.push(
AbiLegacyCellarAdaptorV1Calls::DepositToCellar(call)
LegacyCellarAdaptorV1Calls::DepositToCellar(call)
.encode()
.into(),
)
Expand All @@ -86,7 +78,7 @@ pub(crate) fn legacy_cellar_adaptor_v1_calls(
oracle: sp_call_parse_address(p.oracle)?,
};
calls.push(
AbiLegacyCellarAdaptorV1Calls::WithdrawFromCellar(call)
LegacyCellarAdaptorV1Calls::WithdrawFromCellar(call)
.encode()
.into(),
)
Expand All @@ -97,7 +89,7 @@ pub(crate) fn legacy_cellar_adaptor_v1_calls(
spender: sp_call_parse_address(p.spender)?,
};
calls.push(
AbiLegacyCellarAdaptorV1Calls::RevokeApproval(call)
LegacyCellarAdaptorV1Calls::RevokeApproval(call)
.encode()
.into(),
)
Expand Down
8 changes: 4 additions & 4 deletions steward_proto_go/steward_proto/collateral_f_token.pb.go

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

2 changes: 1 addition & 1 deletion steward_proto_go/steward_proto/debt_f_token.pb.go

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

Binary file modified steward_proto_rust/src/prost/descriptor.bin
Binary file not shown.
6 changes: 3 additions & 3 deletions steward_proto_rust/src/prost/steward.v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1087,10 +1087,10 @@ pub mod collateral_f_token_adaptor_v1 {
#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)]
pub struct AddCollateral {
/// The FraxLend pair to add collateral to.
#[prost(string, tag = "2")]
#[prost(string, tag = "1")]
pub fraxlend_pair: ::prost::alloc::string::String,
/// The amount of collateral to add to the cellar position.
#[prost(string, tag = "1")]
#[prost(string, tag = "2")]
pub collateral_to_deposit: ::prost::alloc::string::String,
}
///
Expand Down Expand Up @@ -1165,7 +1165,7 @@ pub mod debt_f_token_adaptor_v1 {
///
/// Allows a strategist to call `addInterest` on a Frax Pair they are using
///
/// Represents `function callAddInterest(IFToken fToken)`
/// Represents `function callAddInterest(IFToken _fraxlendPair)`
#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)]
pub struct CallAddInterest {
/// The address of the pair to call addInterest on.
Expand Down

0 comments on commit 3137d37

Please sign in to comment.