Skip to content

Commit

Permalink
fix: add explcit fee_payer
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbpvsc committed Nov 29, 2023
1 parent 5166374 commit a6f3949
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions programs/marginfi/src/instructions/marginfi_group/add_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,15 @@ pub struct LendingPoolAddBank<'info> {
)]
pub admin: Signer<'info>,

#[account(mut)]
pub fee_payer: Signer<'info>,

pub bank_mint: Box<Account<'info, Mint>>,

#[account(
init,
space = 8 + std::mem::size_of::<Bank>(),
payer = admin,
payer = fee_payer,
)]
pub bank: AccountLoader<'info, Bank>,

Expand All @@ -101,7 +104,7 @@ pub struct LendingPoolAddBank<'info> {

#[account(
init,
payer = admin,
payer = fee_payer,
token::mint = bank_mint,
token::authority = liquidity_vault_authority,
seeds = [
Expand All @@ -124,7 +127,7 @@ pub struct LendingPoolAddBank<'info> {

#[account(
init,
payer = admin,
payer = fee_payer,
token::mint = bank_mint,
token::authority = insurance_vault_authority,
seeds = [
Expand All @@ -147,7 +150,7 @@ pub struct LendingPoolAddBank<'info> {

#[account(
init,
payer = admin,
payer = fee_payer,
token::mint = bank_mint,
token::authority = fee_vault_authority,
seeds = [
Expand Down
1 change: 1 addition & 0 deletions test-utils/src/marginfi_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ impl MarginfiGroupFixture {
let mut accounts = marginfi::accounts::LendingPoolAddBank {
marginfi_group: self.key,
admin: self.ctx.borrow().payer.pubkey(),
fee_payer: self.ctx.borrow().payer.pubkey(),
bank_mint,
bank: bank_key.pubkey(),
liquidity_vault_authority: bank_fixture.get_vault_authority(BankVaultType::Liquidity).0,
Expand Down

0 comments on commit a6f3949

Please sign in to comment.