mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-26 03:25:09 +00:00
DeleteAsset chaincode does not check for ownership of asset. Will fix chaincode in different PR
Signed-off-by: Sijo Cherian <sijo@ibm.com>
This commit is contained in:
parent
45c20a8aae
commit
ac86011683
1 changed files with 0 additions and 13 deletions
|
|
@ -235,19 +235,6 @@ async function main() {
|
|||
|
||||
console.log('\n********* Demo deleting asset **************');
|
||||
let dataForDelete = { assetID: assetID2 };
|
||||
try {
|
||||
//Non-owner Org2 should not be able to DeleteAsset. Expect an error from DeleteAsset
|
||||
console.log('--> Attempt Transaction: as Org2 DeleteAsset ' + assetID2);
|
||||
statefulTxn = contractOrg2.createTransaction('DeleteAsset');
|
||||
tmapData = Buffer.from(JSON.stringify(dataForDelete));
|
||||
statefulTxn.setTransient({
|
||||
asset_delete: tmapData
|
||||
});
|
||||
result = await statefulTxn.submit();
|
||||
console.log('******** FAILED : expected to return an error');
|
||||
} catch (error) {
|
||||
console.log(` Successfully caught the error: \n ${error}`);
|
||||
}
|
||||
// Delete Asset2 as Org1
|
||||
console.log('--> Submit Transaction: as Org1 DeleteAsset ' + assetID2);
|
||||
statefulTxn = contractOrg1.createTransaction('DeleteAsset');
|
||||
|
|
|
|||
Loading…
Reference in a new issue