Reputation: 377
Before marking it duplicate because of this post
Why does transaction give this error I want to mention this post have`nt solved my problem.
my issue is that I am defining transaction in model file and then using it in js script but it throws an error " Error: Could not find any functions to execute for transaction." when i try to execute it.
my cto code` /** * New model file */
namespace org.acme.model
participant Trader identified by email {
o String email
o Double balance
}
transaction simpleDemo {
}`
js file
/**
* @param {org.acme.model.simpleDemo} SimpleDemo
* @transaction
*/
function SimpleDemo (SimpleDemo)
{
console.log('hello');
}
picture is attached for reference. enter image description here
Upvotes: 0
Views: 2254
Reputation: 377
In above stated case if there is a space between where our param is ending and where we define our function, hyperledger composer will throw the error.
You have to write it like this without any space.
/**
* @param {org.acme.model.simpleDemo} SimpleDemo
* @transaction
*/
function SimpleDemo (SimpleDemo)
{
console.log('hello');
}
Thank you @lakshay gaur for solving this issue.
Upvotes: 4