<commit_before>#ifndef ZCOIN_HDCHAIN_H
#define ZCOIN_HDCHAIN_H

#include "key.h"

/* simple HD chain data model */
class CHDChain
{
public:
    uint32_t nExternalChainCounter; // VERSION_BASIC
    vector<uint32_t> nExternalChainCounters; // VERSION_WITH_BIP44: vector index corresponds to account value
    SecureVector seed;
    SecureVector mnemonic;
    SecureVector passPhrase;
    bool fIsCrypted;
    bool f12Words;
    CKeyID masterKeyID; //!< master key hash160

    static const int VERSION_BASIC = 1;
    static const int VERSION_WITH_BIP44 = 10;
    static const int VERSION_WITH_BIP39 = 11;
    static const int CURRENT_VERSION = VERSION_WITH_BIP39;
    static const int N_CHANGES = 3; // standard = 0/1, mint = 2
    int nVersion;

    CHDChain() { SetNull(); }
    ADD_SERIALIZE_METHODS;
    template <typename Stream, typename Operation>
    inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
    {

        READWRITE(this->nVersion);
        nVersion = this->nVersion;
        READWRITE(nExternalChainCounter);
        READWRITE(masterKeyID);
        if(this->nVersion >= VERSION_WITH_BIP44){
            READWRITE(nExternalChainCounters);
        }
        if(this->nVersion >= VERSION_WITH_BIP39) {
            READWRITE(mnemonic);
            READWRITE(passPhrase);
            READWRITE(seed);
            READWRITE(fIsCrypted);
            READWRITE(f12Words);
        }
    }

    void SetNull();

    bool IsNull() const;

    bool IsCrypted() const;

    void SetCrypted(bool crypted);

    bool SetMnemonic(const SecureString& mnemonic, const SecureString& passPhrase, bool setMasterKeyID);

    bool GetMnemonic(SecureString& mnemonic_, SecureString& passPhrase_) const;
<commit_msg>Fixing test failing<commit_after>#ifndef ZCOIN_HDCHAIN_H
#define ZCOIN_HDCHAIN_H

#include "key.h"

/* simple HD chain data model */
class CHDChain
{
public:
    uint32_t nExternalChainCounter; // VERSION_BASIC
    vector<uint32_t> nExternalChainCounters; // VERSION_WITH_BIP44: vector index corresponds to account value
    SecureVector seed;
    SecureVector mnemonic;
    SecureVector passPhrase;
    bool fIsCrypted;
    bool f12Words;
    CKeyID masterKeyID; //!< master key hash160

    static const int VERSION_BASIC = 1;
    static const int VERSION_WITH_BIP44 = 10;
    static const int VERSION_WITH_BIP39 = 11;
    static const int CURRENT_VERSION = VERSION_WITH_BIP39;
    static const int N_CHANGES = 4; // standard = 0/1, mint = 2, exodus = 3
    int nVersion;

    CHDChain() { SetNull(); }
    ADD_SERIALIZE_METHODS;
    template <typename Stream, typename Operation>
    inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
    {

        READWRITE(this->nVersion);
        nVersion = this->nVersion;
        READWRITE(nExternalChainCounter);
        READWRITE(masterKeyID);
        if(this->nVersion >= VERSION_WITH_BIP44){
            READWRITE(nExternalChainCounters);
            nExternalChainCounters.resize(N_CHANGES);
        }
        if(this->nVersion >= VERSION_WITH_BIP39) {
            READWRITE(mnemonic);
            READWRITE(passPhrase);
            READWRITE(seed);
            READWRITE(fIsCrypted);
            READWRITE(f12Words);
        }
    }

    void SetNull();

    bool IsNull() const;

    bool IsCrypted() const;

    void SetCrypted(bool crypted);

    bool SetMnemonic(const SecureString& mnemonic, const SecureString& passPhrase, bool setMasterKeyID);

    bool GetMnemonic(SecureString& mnemonic_, SecureString& passPhrase_) const;

{'fraction_non_alphanumeric': 0.08258426966292134, 'fraction_numerical': 0.018258426966292134, 'mean_word_length': 3.1215277777777777, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1836044', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1130, 'n_words': 267}