zerodha / cppkiteconnect

C++ Kite Connect API library / SDK
Other
47 stars 22 forks source link

Fix getMFOrdersTest #31

Closed rhnvrm closed 3 years ago

rhnvrm commented 3 years ago

Ref: #30

The unit test for getMFOrdersTest failed locally. We need to investigate what is causing the issue.

2: [ RUN      ] kiteTest.getMFOrdersTest
2: unknown file: Failure
2: C++ exception with description "std::exception" thrown in the test body.
2: [  FAILED  ] kiteTest.getMFOrdersTest (0 ms)
bhumitattarde commented 3 years ago

This test fails because mock responses have quantity as double instead of int. Here, the quantity is a double and here it is an int. What is the correct type and why is quantity double? Is it possible to transact partial quantity now?

bhumitattarde commented 3 years ago

Changed type to double in #33.

rhnvrm commented 3 years ago

According to kite-trade docs it is indeed float. https://kite.trade/docs/connect/v3/mutual-funds/#retrieving-orders

But lets get this checked in parallel.

@ranjanrak can we check if MF float quantity being float is inconsistent elsewhere as well. Also maybe we can consider making the float part bit more prominent as a note. Also, I guess we can also look at the mocks having 0.0 as well as 0.

ranjanrak commented 3 years ago

can we check if MF float quantity being float is inconsistent elsewhere as well.

Yes, it's consistent everywhere including MF holdings, instrument file with minimum_redemption_quantity and all processed MF orders in MF orderbook. Only non-processed MF orders(status like REJECTED, OPEN) have an int qty field. This will be fixed in the new version upgrade. So, I'm changing the qty field for such mock data to float for now :smiley: