From 8fb5d72b13f6b28bb76ee6beb795ce4f19fabaf4 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 27 Nov 2018 17:11:37 -0800 Subject: [PATCH] Make insufficient tokens message more helpful --- src/system_program.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/system_program.rs b/src/system_program.rs index 896ac77c1d..a503ff4510 100644 --- a/src/system_program.rs +++ b/src/system_program.rs @@ -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;