Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Make insufficient tokens message more helpful
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Nov 28, 2018
1 parent 83c0711 commit 8fb5d72
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/system_program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ pub fn process_instruction(
Err(Error::InvalidArgument)?;
}
if tokens > accounts[0].tokens {
info!("Insufficient tokens in account[0]");
info!(
"Insufficient tokens in account[0] ({} > {})",
tokens, accounts[0].tokens
);
Err(Error::ResultWithNegativeTokens)?;
}
accounts[0].tokens -= tokens;
Expand Down

0 comments on commit 8fb5d72

Please sign in to comment.