How to create a test with asset ownership? #fabric


luizck@...
 

Hi all,

We have a test case where multiple orgs can put assets into a blockchain, but only its "owner" can alter the asset's state. The owner is identified by the MspId of the transaction.
Is there a way to pass (or create) the context of the owner organization to the callback?

To illustrate:

module.exports.run = function() {
let asset = asset_array[count++];
let tx = {
'transaction_type': 'AlterAsset',
'asset': asset.id
};

//contx must be the context of the owner of the asset.
return bc.invokeSmartContract(contx, 'mychannel', '0', [tx], 100);
};

Regards,
Luiz

Join {caliper@lists.hyperledger.org to automatically receive all group messages.