Skip to content

Commit

Permalink
Remove some debug prints and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ruuda committed Dec 22, 2021
1 parent 83a76a3 commit 04118e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
3 changes: 0 additions & 3 deletions anker/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,6 @@ fn process_send_rewards(
accounts.wormhole_core_bridge_program_id.clone(),
accounts.spl_token.clone(),
];
/*for (x, y) in accounts[6..].iter().zip(instr.accounts[6..].iter()) {
msg!("{} <- {}", y.pubkey, x.key);
}*/
// Send UST tokens via Wormhole 🤞.
invoke_signed(&instr, &accounts[..], &[&reserve_seeds[..]])
}
Expand Down
21 changes: 9 additions & 12 deletions cli/src/anker_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ impl AnkerState {
) -> Result<Self> {
let anker = config.client.get_anker(&anker_address)?;

//let token_swap_account = config.client.get_account(&anker.token_swap_pool)?;
//let token_swap = spl_token_swap::state::SwapV1::unpack(token_swap_account.data())?;
let token_swap_account = config.client.get_account(&anker.token_swap_pool)?;
let token_swap = spl_token_swap::state::SwapV1::unpack(token_swap_account.data())?;

let (anker_ust_reserve, _anker_ust_reserve_bump_seed) =
find_ust_reserve_account(&anker_program_id, anker_address);
Expand All @@ -58,31 +58,28 @@ impl AnkerState {
let b_sol_mint_account = config.client.get_spl_token_mint(&anker.b_sol_mint)?;
let b_sol_total_supply_amount = BLamports(b_sol_mint_account.supply);

/*let (ust_account, ust_mint, st_sol_account) =
let (pool_ust_account, pool_st_sol_account) =
if token_swap.token_a_mint == solido.st_sol_mint {
(
token_swap.token_b,
token_swap.token_b_mint,
token_swap.token_a,
)
} else {
(
token_swap.token_a,
token_swap.token_a_mint,
token_swap.token_b,
)
};
*/

Ok(AnkerState {
anker_program_id: anker_program_id.clone(),
anker,
b_sol_total_supply_amount,
pool_st_sol_account: Pubkey::new_unique(),
pool_ust_account: Pubkey::new_unique(),
pool_st_sol_account,
pool_ust_account,
ust_mint: ust_account.mint,
pool_mint: Pubkey::new_unique(),
pool_fee_account: Pubkey::new_unique(),
pool_mint: token_swap.pool_mint,
pool_fee_account: token_swap.pool_fee_account,
ust_reserve_balance,
st_sol_reserve_balance,
})
Expand Down Expand Up @@ -139,11 +136,11 @@ impl AnkerState {
maintainer_address: Pubkey,
wormhole_nonce: u32,
) -> (Instruction, Keypair) {
// TODO(ruuda): In our test transaction [1], before the call to Wormhole,
// In our test transaction [1], before the call to Wormhole,
// there is a transfer of 0.000_000_010 SOL to _some_ account ... but
// then the Wormhole call also transfers that amount. So it seems the
// first one is a kind of tip? Can we skip it?
// Also, we shouldn't transfer out of an account which may have more
// TODO(#489): // Also, we shouldn't transfer out of an account which may have more
// balance than we need to spend, because Wormhole may steal it.
// [1]: https://explorer.solana.com/tx/5tSRA1CYLd51sjf7Dd2ZRkLspcqiR8NH51oTd3K34sNc3PZG9uF7euE2AHE95KurrcfKYf2sCQqsEbSRmzQq8oDg?cluster=devnet
let (anker_instance, _anker_bump_seed) =
Expand Down

0 comments on commit 04118e5

Please sign in to comment.