mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-21 09:05:10 +00:00
Merge 5fc79e1651 into 94c21eb9bd
This commit is contained in:
commit
f6b95670de
1 changed files with 3 additions and 1 deletions
|
|
@ -88,7 +88,9 @@ var Chaincode = class {
|
||||||
if (typeof amount !== 'number') {
|
if (typeof amount !== 'number') {
|
||||||
throw new Error('Expecting integer value for amount to be transaferred');
|
throw new Error('Expecting integer value for amount to be transaferred');
|
||||||
}
|
}
|
||||||
|
if (!(Aval > amount)) {
|
||||||
|
throw new Error(util.format('amount in account A must must be greater then amount (%d) but found %d', amount, Aval));
|
||||||
|
}
|
||||||
Aval = Aval - amount;
|
Aval = Aval - amount;
|
||||||
Bval = Bval + amount;
|
Bval = Bval + amount;
|
||||||
console.info(util.format('Aval = %d, Bval = %d\n', Aval, Bval));
|
console.info(util.format('Aval = %d, Bval = %d\n', Aval, Bval));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue