Fix error that occurs with go CC and javascript app (#399)

Signed-off-by: Nikhil Gupta <ngupta@symbridge.com>
This commit is contained in:
nikhil550 2021-01-13 15:37:34 -05:00 committed by GitHub
parent 08aaaf0313
commit 6fd327a347
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -129,15 +129,10 @@ async function main() {
// to the orderer to be committed by each of the peer's to the channel ledger.
console.log('\n--> Submit Transaction: CreateAsset, creates new asset with ID, color, owner, size, and appraisedValue arguments');
result = await contract.submitTransaction('CreateAsset', 'asset13', 'yellow', '5', 'Tom', '1300');
// The "submitTransaction" returns the value generated by the chaincode. Notice how we normally do not
// look at this value as the chaincodes are not returning a value. So for demonstration purposes we
// have the javascript version of the chaincode return a value on the function 'CreateAsset'.
// This value will be the same as the 'ReadAsset' results for the newly created asset.
// The other chaincode versions could be updated to also return a value.
// Having the chaincode return a value after after doing a create or update could avoid the application
// from making an "evaluateTransaction" call to get information on the asset added by the chaincode
// during the create or update.
console.log(`*** Result committed: ${prettyJSONString(result.toString())}`);
console.log('*** Result: committed');
if (`${result}` !== '') {
console.log(`*** Result: ${prettyJSONString(result.toString())}`);
}
console.log('\n--> Evaluate Transaction: ReadAsset, function returns an asset with a given assetID');
result = await contract.evaluateTransaction('ReadAsset', 'asset13');