From 3e4818137fea690252c2077dac4a4c0788d1d47f 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 896ac77c1d7fcf..a503ff4510e8ab 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;