Skip to content

Commit

Permalink
feat(ton): Fix C++ build
Browse files Browse the repository at this point in the history
  • Loading branch information
satoshiotomakan committed Sep 9, 2024
1 parent 098d541 commit 5544ed2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions tests/common/Keystore/StoredKeyTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
18 changes: 9 additions & 9 deletions tests/common/Keystore/StoredKeyTonTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/interface/TWStoredKeyTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5544ed2

Please sign in to comment.