Skip to content

Commit c7a0700

Browse files
committed
fix sign
1 parent d208b2f commit c7a0700

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/common/sign_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ utility::string_t sha1_sign(const utility::string_t& context, const utility::str
220220
int ret = RSA_sign(NID_sha1, hash, SHA_DIGEST_LENGTH,
221221
encrypted, &encrypted_length, rsa);
222222
if (ret == 1) {
223-
utility::string_t s(reinterpret_cast<char*>(encrypted));
223+
utility::string_t s(encrypted, encrypted + encrypted_length);
224224
return s;
225225
}
226226
return "";

src/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ class TestQuoteClient {
296296
}
297297

298298
static void test_quote(const std::shared_ptr<QuoteClient> quote_client) {
299-
TestQuoteClient::test_get_option_brief(quote_client);
299+
TestQuoteClient::test_get_timeline(quote_client);
300300
}
301301
};
302302

@@ -354,15 +354,15 @@ int main(int argc, char *args[]) {
354354
/**
355355
* 使用封装后的行情接口 QuoteClient
356356
*/
357-
// std::shared_ptr<QuoteClient> quote_client = std::make_shared<QuoteClient>(config);
358-
// quote_client->grab_quote_permission();
359-
// TestQuoteClient::test_quote(quote_client);
357+
std::shared_ptr<QuoteClient> quote_client = std::make_shared<QuoteClient>(config);
358+
quote_client->grab_quote_permission();
359+
TestQuoteClient::test_quote(quote_client);
360360

361361
/**
362362
* 使用封装后的交易接口 TradeClient
363363
*/
364-
std::shared_ptr<TradeClient> trade_client = std::make_shared<TradeClient>(config);
365-
TestTradeClient::test_trade(trade_client);
364+
// std::shared_ptr<TradeClient> trade_client = std::make_shared<TradeClient>(config);
365+
// TestTradeClient::test_trade(trade_client);
366366

367367
/**
368368
* 直接使用未封装的 TigerApi

0 commit comments

Comments
 (0)