Skip to content

Instantly share code, notes, and snippets.

@gabrielbiga
Created February 11, 2019 02:11
Show Gist options
  • Save gabrielbiga/5fe69175504e4a60b2230109c3bdc21b to your computer and use it in GitHub Desktop.
Save gabrielbiga/5fe69175504e4a60b2230109c3bdc21b to your computer and use it in GitHub Desktop.
The global file - Reusing functions in Hyperledger Composer chaincode
/**
* Check if the given amount is valid. 
* @param {number} amount The amount 
*/ 
function is AmountValid(amount) 
{
assert(amount >= 0, 'Invalid amount! Should be >= 0'); 
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment