hyperledger-labs / convector

Smart Contract Systems the easy way. Open source development framework.
Other
146 stars 45 forks source link

When unit testing: transaction timestamp is 0 #77

Closed raphabenoi closed 5 years ago

raphabenoi commented 5 years ago

The problem

Just a little problem I came accross. Don't no if it's just happening for me but thought it might be relevant:

When debugging my chaincode as explained in the tutorial from @waltermontes I get a txTimestamp = 0 when using this line in my code: const txTimestamp = this.tx.stub.getTxDate().getTime();

It's not that big of a deal since I can temporarily change it by hand for testing, but maybe it's just a small thing to change that could make life easier in the future :smiley:

Environment

Expected Behavior

Ideally, the txTimetamp returned by this.tx.stub.getTxDate().getTime() equals Date.now() of the moment of invokation of the chaincode and not =0

diestrin commented 5 years ago

This is a problem with the MockStub library. I created an issue in their repo wearetheledger/fabric-mock-stub#24

raphabenoi commented 5 years ago

Ok, thanks! Then this one can be closed!