Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBreath committed Sep 13, 2024
1 parent 2e39d56 commit c068f9f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3,606 deletions.
12 changes: 10 additions & 2 deletions programs/drift_vaults/src/state/vault.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ impl Vault {
ts: now,
action: VaultDepositorAction::Deposit,
amount: 0,
depositor_authority: self.manager,
vault_equity_before: vault_equity,
vault_shares_before,
user_vault_shares_before,
Expand Down Expand Up @@ -546,6 +547,7 @@ impl Vault {
ts: now,
action: VaultDepositorAction::WithdrawRequest,
amount: self.last_manager_withdraw_request.value,
depositor_authority: self.manager,
vault_equity_before: vault_equity,
vault_shares_before,
user_vault_shares_before,
Expand Down Expand Up @@ -599,6 +601,7 @@ impl Vault {
ts: now,
action: VaultDepositorAction::CancelWithdrawRequest,
amount: 0,
depositor_authority: self.manager,
vault_equity_before: vault_equity,
vault_shares_before,
user_vault_shares_before,
Expand Down Expand Up @@ -687,6 +690,7 @@ impl Vault {
ts: now,
action: VaultDepositorAction::Withdraw,
amount: 0,
depositor_authority: self.manager,
vault_equity_before: vault_equity,
vault_shares_before,
user_vault_shares_before,
Expand Down Expand Up @@ -801,6 +805,7 @@ impl Vault {
ts: now,
action: VaultDepositorAction::WithdrawRequest,
amount,
depositor_authority: vault_protocol.as_ref().unwrap().protocol,
vault_equity_before: vault_equity,
vault_shares_before,
user_vault_shares_before,
Expand Down Expand Up @@ -872,6 +877,7 @@ impl Vault {
ts: now,
action: VaultDepositorAction::CancelWithdrawRequest,
amount: 0,
depositor_authority: vault_protocol.as_ref().unwrap().protocol,
vault_equity_before: vault_equity,
vault_shares_before,
user_vault_shares_before,
Expand Down Expand Up @@ -974,6 +980,7 @@ impl Vault {
ts: now,
action: VaultDepositorAction::Withdraw,
amount: 0,
depositor_authority: vault_protocol.as_ref().unwrap().protocol,
vault_equity_before: vault_equity,
vault_shares_before,
user_vault_shares_before,
Expand Down Expand Up @@ -1053,7 +1060,7 @@ impl Vault {
emit!(VaultDepositorRecord {
ts: params.ts,
vault: self.pubkey,
depositor_authority: self.manager,
depositor_authority: params.depositor_authority,
action: params.action,
amount: params.amount,
spot_market_index: self.spot_market_index,
Expand All @@ -1073,7 +1080,7 @@ impl Vault {
emit!(VaultDepositorV1Record {
ts: params.ts,
vault: self.pubkey,
depositor_authority: self.manager,
depositor_authority: params.depositor_authority,
action: params.action,
amount: params.amount,
spot_market_index: self.spot_market_index,
Expand Down Expand Up @@ -1102,6 +1109,7 @@ struct VaultDepositorRecordParams {
pub ts: i64,
pub action: VaultDepositorAction,
pub amount: u64,
pub depositor_authority: Pubkey,

pub vault_shares_before: u128,
pub vault_shares_after: u128,
Expand Down
2 changes: 1 addition & 1 deletion ts/sdk/src/idl/drift_vaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@
"type": {
"array": [
"u64",
4
7
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions ts/sdk/src/types/drift_vaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,7 @@ export type DriftVaults = {
{
name: 'padding';
type: {
array: ['u64', 4];
array: ['u64', 7];
};
}
];
Expand Down Expand Up @@ -3476,7 +3476,7 @@ export const IDL: DriftVaults = {
{
name: 'padding',
type: {
array: ['u64', 4],
array: ['u64', 7],
},
},
],
Expand Down
Loading

0 comments on commit c068f9f

Please sign in to comment.