-
Notifications
You must be signed in to change notification settings - Fork 28
fabric-mock-stub problem with creation of chaincodeMockStub instance #21
Comments
Could you show me your contract? Are you using the new wrapper around the shim introduced in 1.4? We do not support this yet. This explains your second issue. The first issue might be because your testing library (mocha or other) might not be configured correctly to compile this es6 to es5 syntax. |
This is mycontract:
|
AH, yes. We do not support the Contract from fabric-contract-api (yet). It has been introduced in 1.4 |
Me too! |
+1 looking forward to it. Please can we have any expectation on when :) |
+1 Agreed. |
I am also trying out new contract-api, and found out that mockstub is not available, found this, and looks like contract-api is not supported, are there any workarounds for this, or any plans to implement it? |
Is v1.4 has support for contract-api? |
Does anyone have found a way to unit test their contracts? |
I know how annoying this is to be unable to test own code, I spent a week searching through the web and found nothing. Eventually, I came up with this workaround to use theLedger MockStub with contract API and it works just fine for me.
|
Hi,
I'm trying to test my contract created by IBM blockchain platform VSCIDE extension. My contract is written in typescript. Now in order to test my contract I've used the following code:
and I get 2 errors. first I get "Unexpected token import", and second there is an error with the below line:
const mockStub = new ChaincodeMockStub("MyMockStub", chaincode);
says "Argument of type "MyContract" is not assignable to parameter of type "ChaincodeInterface" ".
Thanks for help.
The text was updated successfully, but these errors were encountered: