add gt 0 checks
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
parent
fce4edb79f
commit
9e2d5de914
|
@ -52,6 +52,8 @@ impl<'info> Deposit<'info> {
|
|||
// That would save a lot of computation that needs to go into finding the
|
||||
// right index for the mint.
|
||||
pub fn deposit(ctx: Context<Deposit>, amount: u64) -> Result<()> {
|
||||
require!(amount > 0, MangoError::SomeError);
|
||||
|
||||
let token_index = ctx.accounts.bank.load()?.token_index;
|
||||
|
||||
// Get the account's position for that token index
|
||||
|
|
|
@ -53,6 +53,8 @@ impl<'info> Withdraw<'info> {
|
|||
// That would save a lot of computation that needs to go into finding the
|
||||
// right index for the mint.
|
||||
pub fn withdraw(ctx: Context<Withdraw>, amount: u64, allow_borrow: bool) -> Result<()> {
|
||||
require!(amount > 0, MangoError::SomeError);
|
||||
|
||||
let group = ctx.accounts.group.load()?;
|
||||
let token_index = ctx.accounts.bank.load()?.token_index;
|
||||
|
||||
|
|
Loading…
Reference in New Issue