Below is the code I am working on:
**Sample.cto**
/**
* Sample business network definition.
*/
namespace org.acme.seller
asset Car identified by carNumber{
o String carNumber
o String carName
--> Owner oldOwner
}
participant Owner identified by ownerId{
o String ownerId
o String fname
o String lname
}
transaction Transfer{
--> Car car
--> Owner newOwner
}
----------------------
**Sample.js**
/**
* Sample transaction processor function.
* @param {org.acme.seller.Transfer} tx The sample transaction instance.
* @transaction
*/
function Transfer(tx) {
// Save the old value of the asset.
tx.car.oldOwner = tx.car.newOwner;
// Update the asset with the new value.
// tx.car1.value = tx.newValue;
// Get the asset registry for the asset.
return getAssetRegistry('org.acme.seller.Car')
.then(function (assetRegistry) {
// Update the asset in the asset registry.
return assetRegistry.update(tx.car);
});
}
------------------------------------------------
**Permissions.acl**
/**
* Sample access control list.
*/
rule EverybodyCanReadEverything {
description: "Allow all participants read access to all resources"
participant: "ANY"
operation: ALL
resource: "org.acme.seller.*"
action: ALLOW
}
rule EverybodyCanSubmitTransactions {
description: "Allow all participants to submit transactions"
participant: "ANY"
operation: ALL
resource: "org.acme.seller.*"
action: ALLOW
}
rule OwnerHasFullAccessToTheirAssets {
description: "Allow all participants full access to their assets"
participant(p): "org.acme.seller.*"
operation: ALL
resource(r): "org.acme.seller.*"
condition: (r.owner.getIdentifier() === p.getIdentifier())
action: ALLOW
}
rule SystemACL {
description: "System ACL to permit all access"
participant: "org.hyperledger.composer.system.Participant"
operation: ALL
resource: "org.hyperledger.composer.system.**"
action: ALLOW
}
I'm receiving this error while submitting transaction:
t: Instance org.acme.seller.Car#HW7722 missing required field oldOwner
I am fairly new to Blockchain development and unable to resolve this error. Can anyone help?