Use MnemonicSeed instead of HDSeed where appropriate.

This commit is contained in:
Kris Nuttycombe 2021-11-07 10:56:43 -05:00
parent f31b3c2190
commit 6e6359229a
2 changed files with 5 additions and 5 deletions

View File

@ -76,7 +76,7 @@ namespace libzcash {
// Transparent // Transparent
// //
std::optional<std::pair<CExtKey, HDKeyPath>> DeriveBip44TransparentAccountKey(const HDSeed& seed, uint32_t bip44CoinType, uint32_t accountId) { std::optional<std::pair<CExtKey, HDKeyPath>> DeriveBip44TransparentAccountKey(const MnemonicSeed& seed, uint32_t bip44CoinType, uint32_t accountId) {
auto rawSeed = seed.RawSeed(); auto rawSeed = seed.RawSeed();
auto m = CExtKey::Master(rawSeed.data(), rawSeed.size()); auto m = CExtKey::Master(rawSeed.data(), rawSeed.size());
@ -242,7 +242,7 @@ SaplingExtendedSpendingKey SaplingExtendedSpendingKey::Derive(uint32_t i) const
return xsk_i; return xsk_i;
} }
std::pair<SaplingExtendedSpendingKey, HDKeyPath> SaplingExtendedSpendingKey::ForAccount(const HDSeed& seed, uint32_t bip44CoinType, uint32_t accountId) { std::pair<SaplingExtendedSpendingKey, HDKeyPath> SaplingExtendedSpendingKey::ForAccount(const MnemonicSeed& seed, uint32_t bip44CoinType, uint32_t accountId) {
auto m = Master(seed); auto m = Master(seed);
// We use a fixed keypath scheme of m/32'/coin_type'/account' // We use a fixed keypath scheme of m/32'/coin_type'/account'
@ -260,7 +260,7 @@ std::pair<SaplingExtendedSpendingKey, HDKeyPath> SaplingExtendedSpendingKey::For
return std::make_pair(xsk, hdKeypath); return std::make_pair(xsk, hdKeypath);
} }
std::pair<SaplingExtendedSpendingKey, HDKeyPath> SaplingExtendedSpendingKey::Legacy(const HDSeed& seed, uint32_t bip44CoinType, uint32_t addressIndex) { std::pair<SaplingExtendedSpendingKey, HDKeyPath> SaplingExtendedSpendingKey::Legacy(const MnemonicSeed& seed, uint32_t bip44CoinType, uint32_t addressIndex) {
auto m = Master(seed); auto m = Master(seed);
// We use a fixed keypath scheme of m/32'/coin_type'/0x7FFFFFFF'/addressIndex' // We use a fixed keypath scheme of m/32'/coin_type'/0x7FFFFFFF'/addressIndex'

View File

@ -287,8 +287,8 @@ struct SaplingExtendedSpendingKey {
} }
static SaplingExtendedSpendingKey Master(const HDSeed& seed); static SaplingExtendedSpendingKey Master(const HDSeed& seed);
static std::pair<SaplingExtendedSpendingKey, HDKeyPath> ForAccount(const HDSeed& seed, uint32_t bip44CoinType, uint32_t accountId); static std::pair<SaplingExtendedSpendingKey, HDKeyPath> ForAccount(const MnemonicSeed& seed, uint32_t bip44CoinType, uint32_t accountId);
static std::pair<SaplingExtendedSpendingKey, HDKeyPath> Legacy(const HDSeed& seed, uint32_t bip44CoinType, uint32_t addressIndex); static std::pair<SaplingExtendedSpendingKey, HDKeyPath> Legacy(const MnemonicSeed& seed, uint32_t bip44CoinType, uint32_t addressIndex);
SaplingExtendedSpendingKey Derive(uint32_t i) const; SaplingExtendedSpendingKey Derive(uint32_t i) const;