Skip to content

Commit

Permalink
Merge pull request #398 from crypto-chassis/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
cryptochassis authored Jun 22, 2023
2 parents 4ffc8cc + 5c46505 commit 9a42067
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ cmake --build . --target <example-name>
[Python](binding/python/example)
* Python API is nearly identical to C++ API and covers nearly all the functionalities from C++ API.
* Build and install the Python binding as shown [above](#python).
* Run python3 main.py.
* Run `python3 main.py`.

## Documentations

Expand Down
2 changes: 1 addition & 1 deletion include/ccapi_cpp/ccapi_ws_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class WsConnection CCAPI_FINAL {
: url(url), group(group), subscriptionList(subscriptionList), credential(credential), streamPtr(streamPtr) {
this->id = this->url + "||" + this->group + "||" + ccapi::toString(this->subscriptionList) + "||" + ccapi::toString(this->credential);
this->correlationIdList.reserve(subscriptionList.size());
std::transform(subscriptionList.cbegin(), subscriptionList.cend(), this->correlationIdList.begin(),
std::transform(subscriptionList.cbegin(), subscriptionList.cend(), std::back_inserter(this->correlationIdList),
[](Subscription subscription) { return subscription.getCorrelationId(); });
this->setUrlParts();
}
Expand Down
2 changes: 1 addition & 1 deletion include/ccapi_cpp/service/ccapi_market_data_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class MarketDataService : public Service {
CCAPI_LOGGER_TRACE("fail");
std::vector<std::string> correlationIdList;
correlationIdList.reserve(subscriptionListGivenInstrumentGroup.size());
std::transform(subscriptionListGivenInstrumentGroup.cbegin(), subscriptionListGivenInstrumentGroup.cend(), correlationIdList.begin(),
std::transform(subscriptionListGivenInstrumentGroup.cbegin(), subscriptionListGivenInstrumentGroup.cend(), std::back_inserter(correlationIdList),
[](Subscription subscription) { return subscription.getCorrelationId(); });
that->onError(Event::Type::SUBSCRIPTION_STATUS, Message::Type::SUBSCRIPTION_FAILURE, ec, "create stream", correlationIdList);
return;
Expand Down
8 changes: 8 additions & 0 deletions test/test_unit/src/common/util/ccapi_util_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ TEST(UtilStringTest, normalizeDecimalString_5) {
EXPECT_EQ(UtilString::normalizeDecimalString(original), "1.1");
EXPECT_EQ(UtilString::normalizeDecimalString(original.c_str()), "1.1");
}
TEST(UtilStringTest, toUpper) {
std::string original("ab");
EXPECT_EQ(UtilString::toUpper(original), "AB");
}
TEST(UtilStringTest, toLower) {
std::string original("AB");
EXPECT_EQ(UtilString::toLower(original), "ab");
}
TEST(UtilTimeTest, divideSecondsStr_1) {
std::string str("1634929946");
EXPECT_EQ(UtilTime::divide(str), (std::make_pair<long long, long long>(1634929946, 0)));
Expand Down

0 comments on commit 9a42067

Please sign in to comment.