I have a chaincode with two contracts such that the second contract invoke a transaction of the first one as follows:
class ContractA implements ContractInterface{
.....
@Transaction
public boolean trans1(MyContext ctx, String data) {
...
return result;
}
}
class ContractB implements ContractInterface{
.....
@Transaction
public boolean trans2(MyContext ctx, String data) {
...
Chaincode.Response response = ctx.getStub().invokeChaincode(chaincodeId,
new String[]{ContractA:trans1, "data"});
...
}
}
During the execution of trans2, the invokeChaincode fails with the error: "INVOKE_CHAINCODE failed: transaction ID exists". According to the documentation, no other transaction will be created by calling invokeChaincode, therefore, it is correct that the invocation is created with the same transaction ID.
Is it a bug or am I doing something incorrect in my design?
Many thanks in advance, Roxana