mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
Fix error that occurs with go CC and javascript app (#399)
Signed-off-by: Nikhil Gupta <ngupta@symbridge.com>
This commit is contained in:
parent
08aaaf0313
commit
6fd327a347
1 changed files with 4 additions and 9 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue