Skip to content

Commit

Permalink
Merge pull request #34 from kunta-labs/development
Browse files Browse the repository at this point in the history
added balance check on input tx
  • Loading branch information
Jovonni authored Aug 4, 2020
2 parents 0b75c61 + 979f4f4 commit ce2efe3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ macro_rules! transaction_input_logic {
println!("input: amount_i32_account: {} ", amount_i32_account.clone().unwrap());
println!("input: amount_i32_partner: {} ", amount_i32_partner.clone().unwrap());

// balance check balance >= tx amt
if( amount_i32_account.clone().unwrap() < partner_tx_amount_parse_result.clone().unwrap() ){
return $state;
} else {}

match &state_as_json.insert( &( format!("{}", $tx_sender ).to_string() ),
//format!("{}", JsonValue::from( state_account_amount.unwrap() + partner_tx_amount_parse_result.clone().unwrap() ) ) ) {
format!("{}", JsonValue::from( amount_i32_account.unwrap() + partner_tx_amount_parse_result.clone().unwrap() ) ) ) {
Expand Down

0 comments on commit ce2efe3

Please sign in to comment.