@@ -26,6 +26,8 @@ const auto mnemonic = "team engine square letter hero song dizzy scrub tornado f
26
26
const TWCoinType coinTypeBc = TWCoinTypeBitcoin;
27
27
const TWCoinType coinTypeBnb = TWCoinTypeBinance;
28
28
const TWCoinType coinTypeBsc = TWCoinTypeSmartChain;
29
+ const TWCoinType coinTypeEth = TWCoinTypeEthereum;
30
+ const TWCoinType coinTypeBscLegacy = TWCoinTypeSmartChainLegacy;
29
31
30
32
TEST (StoredKey, CreateWithMnemonic) {
31
33
auto key = StoredKey::createWithMnemonic (" name" , password, mnemonic);
@@ -142,19 +144,27 @@ TEST(StoredKey, AddRemoveAccount) {
142
144
143
145
{
144
146
const auto derivationPath = DerivationPath (" m/84'/0'/0'/0/0" );
145
- key.addAccount (" bc1q375sq4kl2nv0mlmup3vm8znn4eqwu7mt6hkwhr " , coinTypeBc, derivationPath, " zpub6qbsWdbcKW9sC6shTKK4VEhfWvDCoWpfLnnVfYKHLHt31wKYUwH3aFDz4WLjZvjHZ5W4qVEyk37cRwzTbfrrT1Gnu8SgXawASnkdQ994atn " );
147
+ key.addAccount (" bc1qaucw06s3agez8tyyk4zj9kt0q2934e3mcewdpf " , coinTypeBc, derivationPath, " zpub6rxtad3SPT1C5GUDjPiKQ5oJN5DBeMbdUR7LrdYt12VbU7TBSpGUkdLvfVYGuj1N5edkDoZ3bu1fdN1HprQYfCBdsSH5CaAAygHGsanwtTe " );
146
148
EXPECT_EQ (key.accounts .size (), 1 );
147
149
}
148
150
{
149
151
const auto derivationPath = DerivationPath (" m/714'/0'/0'/0/0" );
150
- key.addAccount (" bnb1devga6q804tx9fqrnx0vtu5r36kxgp9tmk4xkm " , coinTypeBnb, derivationPath, " " );
151
- key.addAccount (" 0xf3d468DBb386aaD46E92FF222adDdf872C8CC064 " , coinTypeBsc, derivationPath, " " );
152
+ key.addAccount (" bnb1utrnnjym7ustgw7pgyvtmnxay4qmt3ahh276nu " , coinTypeBnb, derivationPath, " " );
153
+ key.addAccount (" 0x23b02dC8f67eD6cF8DCa47935791954286ffe7c9 " , coinTypeBsc, derivationPath, " " );
152
154
EXPECT_EQ (key.accounts .size (), 3 );
153
155
}
156
+ {
157
+ const auto derivationPath = DerivationPath (" m/60'/0'/0'/0/0" );
158
+ key.addAccount (" 0xC0d97f61A84A0708225F15d54978D628Fe2C5E62" , coinTypeEth, derivationPath, " " );
159
+ key.addAccount (" 0xC0d97f61A84A0708225F15d54978D628Fe2C5E62" , coinTypeBscLegacy, derivationPath, " " );
160
+ EXPECT_EQ (key.accounts .size (), 5 );
161
+ }
154
162
155
163
key.removeAccount (coinTypeBc);
156
164
key.removeAccount (coinTypeBnb);
157
165
key.removeAccount (coinTypeBsc);
166
+ key.removeAccount (coinTypeEth);
167
+ key.removeAccount (coinTypeBscLegacy);
158
168
EXPECT_EQ (key.accounts .size (), 0 );
159
169
}
160
170
0 commit comments