From 5544ed21ec07aaad683fa2d2e3f594960203bc6b Mon Sep 17 00:00:00 2001 From: Satoshi Otomakan Date: Mon, 9 Sep 2024 19:24:52 +0200 Subject: [PATCH] feat(ton): Fix C++ build --- tests/common/Keystore/StoredKeyTests.cpp | 16 ++++++++-------- tests/common/Keystore/StoredKeyTonTests.cpp | 18 +++++++++--------- tests/interface/TWStoredKeyTests.cpp | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/common/Keystore/StoredKeyTests.cpp b/tests/common/Keystore/StoredKeyTests.cpp index 633fcbd99ba..9329c7d1827 100644 --- a/tests/common/Keystore/StoredKeyTests.cpp +++ b/tests/common/Keystore/StoredKeyTests.cpp @@ -20,14 +20,14 @@ namespace TW::Keystore::tests { using namespace std; -const auto passwordString = "password"; -const auto gPassword = TW::data(string(passwordString)); -const auto gMnemonic = "team engine square letter hero song dizzy scrub tornado fabric divert saddle"; -const TWCoinType coinTypeBc = TWCoinTypeBitcoin; -const TWCoinType coinTypeBnb = TWCoinTypeBinance; -const TWCoinType coinTypeBsc = TWCoinTypeSmartChain; -const TWCoinType coinTypeEth = TWCoinTypeEthereum; -const TWCoinType coinTypeBscLegacy = TWCoinTypeSmartChainLegacy; +static const auto passwordString = "password"; +static const auto gPassword = TW::data(string(passwordString)); +static const auto gMnemonic = "team engine square letter hero song dizzy scrub tornado fabric divert saddle"; +static const TWCoinType coinTypeBc = TWCoinTypeBitcoin; +static const TWCoinType coinTypeBnb = TWCoinTypeBinance; +static const TWCoinType coinTypeBsc = TWCoinTypeSmartChain; +static const TWCoinType coinTypeEth = TWCoinTypeEthereum; +static const TWCoinType coinTypeBscLegacy = TWCoinTypeSmartChainLegacy; static std::string testDataPath(const char* subpath) { return TESTS_ROOT + "/common/Keystore/Data/" + subpath; diff --git a/tests/common/Keystore/StoredKeyTonTests.cpp b/tests/common/Keystore/StoredKeyTonTests.cpp index 9b4268a4cdb..ef37738f31c 100644 --- a/tests/common/Keystore/StoredKeyTonTests.cpp +++ b/tests/common/Keystore/StoredKeyTonTests.cpp @@ -20,16 +20,16 @@ namespace TW::Keystore::tests { using namespace std; -const auto gName = "name"; -const auto passwordString = "password"; -const auto gPassword = TW::data(string(passwordString)); -const auto gTonMnemonic = "protect drill sugar gallery note admit input wrist chicken swarm scheme hedgehog orbit ritual glove ski buddy slogan fragile sun delay toy lucky require"; +static const auto gName = "name"; +static const auto gPasswordString = "password"; +static const auto gPassword = TW::data(string(gPasswordString)); +static const auto gTonMnemonic = "protect drill sugar gallery note admit input wrist chicken swarm scheme hedgehog orbit ritual glove ski buddy slogan fragile sun delay toy lucky require"; // The following TON mnemonic requires a passphrase to be used that we don't support right now. -const auto gInvalidMnemonic = "mimic close sibling chair shuffle goat fashion chunk increase tennis scene ceiling divert cross treat happy soccer sample umbrella oyster advance quality perfect call"; -const auto gPrivateKey = "cdcea50b87d3f1ca859e7b2bdf9a5339b7b6804b5c70ac85198829f9607dc43b"; -const auto gPublicKey = "9016f03f9cfa4e183707761f25407e0e1975194a33a56b3e8d2c26f2438fa3d1"; -const auto gBounceableAddress = "EQBlm676c6vy6Q9Js732pvf3ivfmIkVc0MVDQy-F6NAFJYPh"; -const auto gNonBounceableAddress = "UQBlm676c6vy6Q9Js732pvf3ivfmIkVc0MVDQy-F6NAFJd4k"; +static const auto gInvalidMnemonic = "mimic close sibling chair shuffle goat fashion chunk increase tennis scene ceiling divert cross treat happy soccer sample umbrella oyster advance quality perfect call"; +static const auto gPrivateKey = "cdcea50b87d3f1ca859e7b2bdf9a5339b7b6804b5c70ac85198829f9607dc43b"; +static const auto gPublicKey = "9016f03f9cfa4e183707761f25407e0e1975194a33a56b3e8d2c26f2438fa3d1"; +static const auto gBounceableAddress = "EQBlm676c6vy6Q9Js732pvf3ivfmIkVc0MVDQy-F6NAFJYPh"; +static const auto gNonBounceableAddress = "UQBlm676c6vy6Q9Js732pvf3ivfmIkVc0MVDQy-F6NAFJd4k"; static std::string testDataPath(const char* subpath) { return TESTS_ROOT + "/common/Keystore/Data/" + subpath; diff --git a/tests/interface/TWStoredKeyTests.cpp b/tests/interface/TWStoredKeyTests.cpp index 8ba375c98da..ebb52d6b676 100644 --- a/tests/interface/TWStoredKeyTests.cpp +++ b/tests/interface/TWStoredKeyTests.cpp @@ -289,7 +289,7 @@ TEST(TWStoredKey, TONWalletExportJSON) { const auto jsonStr = WRAPS(TWStringCreateWithRawBytes(TWDataBytes(jsonData.get()), TWDataSize(jsonData.get()))); const auto json = nlohmann::json::parse(string(TWStringUTF8Bytes(jsonStr.get()))); EXPECT_EQ(json["type"], "ton-mnemonic"); - EXPECT_EQ(json["activeAccounts"].size(), 1); + EXPECT_EQ(json["activeAccounts"].size(), 1ul); } TEST(TWStoredKey, storeAndImportJSONAES256) {