Skip to content

Commit ebec41a

Browse files
committed
config => rate limiter config
1 parent 275e509 commit ebec41a

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

token-lending/program/src/processor.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,17 @@ pub fn process_instruction(
5454
msg!("Instruction: Init Lending Market");
5555
process_init_lending_market(program_id, owner, quote_currency, accounts)
5656
}
57-
LendingInstruction::SetLendingMarketOwnerAndConfig { new_owner, config } => {
57+
LendingInstruction::SetLendingMarketOwnerAndConfig {
58+
new_owner,
59+
rate_limiter_config,
60+
} => {
5861
msg!("Instruction: Set Lending Market Owner");
59-
process_set_lending_market_owner_and_config(program_id, new_owner, config, accounts)
62+
process_set_lending_market_owner_and_config(
63+
program_id,
64+
new_owner,
65+
rate_limiter_config,
66+
accounts,
67+
)
6068
}
6169
LendingInstruction::InitReserve {
6270
liquidity_amount,

token-lending/program/tests/set_lending_market_owner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async fn test_owner_not_signer() {
101101
],
102102
data: LendingInstruction::SetLendingMarketOwnerAndConfig {
103103
new_owner,
104-
config: RateLimiterConfig::default(),
104+
rate_limiter_config: RateLimiterConfig::default(),
105105
}
106106
.pack(),
107107
}],

token-lending/sdk/src/instruction.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub enum LendingInstruction {
4545
/// The new owner
4646
new_owner: Pubkey,
4747
/// The new config
48-
config: RateLimiterConfig,
48+
rate_limiter_config: RateLimiterConfig,
4949
},
5050

5151
// 2
@@ -487,7 +487,7 @@ impl LendingInstruction {
487487
let (max_outflow, _rest) = Self::unpack_u64(rest)?;
488488
Self::SetLendingMarketOwnerAndConfig {
489489
new_owner,
490-
config: RateLimiterConfig {
490+
rate_limiter_config: RateLimiterConfig {
491491
window_duration,
492492
max_outflow,
493493
},
@@ -709,7 +709,10 @@ impl LendingInstruction {
709709
buf.extend_from_slice(owner.as_ref());
710710
buf.extend_from_slice(quote_currency.as_ref());
711711
}
712-
Self::SetLendingMarketOwnerAndConfig { new_owner, config } => {
712+
Self::SetLendingMarketOwnerAndConfig {
713+
new_owner,
714+
rate_limiter_config: config,
715+
} => {
713716
buf.push(1);
714717
buf.extend_from_slice(new_owner.as_ref());
715718
buf.extend_from_slice(&config.window_duration.to_le_bytes());
@@ -885,15 +888,19 @@ pub fn set_lending_market_owner_and_config(
885888
lending_market_pubkey: Pubkey,
886889
lending_market_owner: Pubkey,
887890
new_owner: Pubkey,
888-
config: RateLimiterConfig,
891+
rate_limiter_config: RateLimiterConfig,
889892
) -> Instruction {
890893
Instruction {
891894
program_id,
892895
accounts: vec![
893896
AccountMeta::new(lending_market_pubkey, false),
894897
AccountMeta::new_readonly(lending_market_owner, true),
895898
],
896-
data: LendingInstruction::SetLendingMarketOwnerAndConfig { new_owner, config }.pack(),
899+
data: LendingInstruction::SetLendingMarketOwnerAndConfig {
900+
new_owner,
901+
rate_limiter_config,
902+
}
903+
.pack(),
897904
}
898905
}
899906

0 commit comments

Comments
 (0)