I´ve just replaced the Composer default sample ("sampleAsset", "sampleTransaction", etc) by another one I created, for my better understanding. Everything works except for the transaction, which return me the error message: "**Error: Could not find any functions to execute for transaction org.acme.sample.CompraDoVinho#**2b2d0624-bc..."
Find below the source codes.
Model file:
namespace org.acme.sample
asset Vinho identified by IDvinho {
o String IDvinho
--> Participante owner
o String uva
o String nomeVinho
o Integer preco
}
participant Participante identified by IDparticipante {
o String IDparticipante
o String tipo
o String nomeEmpresa
}
transaction CompraDoVinho identified by IDcompra {
o String IDcompra
--> Vinho asset
o Integer precoVenda
}
Logic:
CompraDoVinho.asset.preco = CompraDoVinho.precoVenda;
return getAssetRegistry('org.acme.sample.Vinho')
.then(function (assetRegistry) {
return assetRegistry.update(CompraDoVinho.asset);
});
}
Permissions:
rule Default {
description: "Allow all participants access to all resources"
participant: "ANY"
operation: ALL
resource: "org.acme.sample"
action: ALLOW
}
Could anybody help me finding where is the bug in my code?
Thanks in advance