<commit_before>#ifndef TX_H
#define TX_H
/*! \mainpage Developer documentation
 *
 * \section intro_sec Introduction
 *
 * This is the developer documentation of the reference client for an experimental new digital currency called Bitcoin (http://www.bitcoin.org/),
 * which enables instant payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer technology to operate
 * with no central authority: managing transactions and issuing money are carried out collectively by the network.
 *
 * The software is a community-driven open source project, released under the MIT license.
 *
 Testing automatic link generation.

 * \section FuntionList
 *    bool CAccount::AddMoney(OperType type, const CFund &fund).\n
 *    bool CAccount::MinusMoney(OperType type, int nHeight, const CFund &fund, const vector_unsigned_char& scriptID); \n
 *	  bool CAccount::HasAuthorityToMinus(uint64_t nMoney,int nHeight,const vector_unsigned_char& scriptID); \n

 \section Navigation
 * Use the buttons <code>Namespaces</code>, <code>Classes</code> or <code>Files</code> at the top of the page to start navigating the code.
 */
#include "serialize.h"
#include <memory>
#include "uint256.h"
#include "key.h"
#include "hash.h"
#include <vector>
#include <string>

using namespace std;

class CTxUndo;
class CValidationState;
class CAccountViewCache;
class CScriptDB;
class CBlock;
class CTransactionCacheDB;
class CTransactionCache;
class CScriptDBViewCache;
typedef vector<unsigned char> vector_unsigned_char;

class CRegID {
public:
	vector<unsigned char> vRegID;

	CRegID(string strRegID);

	CRegID(uint32_t nHeight = 0, uint16_t nIndex = 0);

	string ToString() const;

	IMPLEMENT_SERIALIZE
	(
			READWRITE(vRegID);
	)
};

enum TxType {
	REG_ACCT_TX = 1,
	NORMAL_TX = 2,
	CONTRACT_TX = 3,
	FREEZE_TX = 4,
	REWARD_TX = 5,
	REG_SCRIPT_TX = 6,
	NULL_TX,
};

enum RegScriptType {
	SCRIPT_ID = 0, SCRIPT_CONTENT = 1, NULL_TYPE,
};

class CNetAuthorizate {
public:
	uint32_t GetAuthorizeTime() const {
		return nAuthorizeTime;
	}
	uint64_t GetMaxMoneyPerTime() const {
		return nMaxMoneyPerTime;
	}
	uint64_t GetMaxMoneyTotal() const {
		return nMaxMoneyTotal;
	}
	uint64_t GetMaxMoneyPerDay() const {
		return nMaxMoneyPerDay;
	}

	void SetAuthorizeTime(uint32_t nTime) {
		nAuthorizeTime = nTime;
	}
	void SetMaxMoneyPerTime(uint64_t nMoney) {
		nMaxMoneyPerTime = nMoney;
	}
	void SetMaxMoneyTotal(uint64_t nMoney) {
		nMaxMoneyTotal = nMoney;
	}
	void SetMaxMoneyPerDay(uint64_t nMoney) {
		nMaxMoneyPerDay = nMoney;
	}

	IMPLEMENT_SERIALIZE
	(
		READWRITE(VARINT(nAuthorizeTime));
		READWRITE(VARINT(nUserDefine));
		READWRITE(VARINT(nMaxMoneyPerTime));
		READWRITE(VARINT(nMaxMoneyTotal));
		READWRITE(VARINT(nMaxMoneyPerDay));
	)

protected:
	uint64_t nAuthorizeTime;
	uint32_t nUserDefine;
	uint64_t nMaxMoneyPerTime;
	uint64_t nMaxMoneyTotal;
	uint64_t nMaxMoneyPerDay;
};

class CAuthorizate :public CNetAuthorizate{
public:
	uint64_t GetCurMaxMoneyPerDay() const {
		return nCurMaxMoneyPerDay;
	}
	uint32_t GetLastOperHeight() const {
		return nLastOperHeight;
	}

	void SetCurMaxMoneyPerDay(uint64_t nMoney) {
		nCurMaxMoneyPerDay = nMoney;
	}
	void SetLastOperHeight(uint32_t nHeight) {
		nLastOperHeight = nHeight;
	}

	IMPLEMENT_SERIALIZE
	(
		READWRITE(VARINT(nLastOperHeight));
		READWRITE(VARINT(nAuthorizeTime));
		READWRITE(VARINT(nMaxMoneyPerTime));
		READWRITE(VARINT(nUserDefine));
		READWRITE(VARINT(nMaxMoneyTotal));
		READWRITE(VARINT(nMaxMoneyPerDay));
		READWRITE(VARINT(nCurMaxMoneyPerDay));
	)

private:
	uint32_t nLastOperHeight;
	uint64_t nCurMaxMoneyPerDay;
};
<commit_msg>optimize CAuthorizate<commit_after>#ifndef TX_H
#define TX_H
/*! \mainpage Developer documentation
 *
 * \section intro_sec Introduction
 *
 * This is the developer documentation of the reference client for an experimental new digital currency called Bitcoin (http://www.bitcoin.org/),
 * which enables instant payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer technology to operate
 * with no central authority: managing transactions and issuing money are carried out collectively by the network.
 *
 * The software is a community-driven open source project, released under the MIT license.
 *
 Testing automatic link generation.

 * \section FuntionList
 *    bool CAccount::AddMoney(OperType type, const CFund &fund).\n
 *    bool CAccount::MinusMoney(OperType type, int nHeight, const CFund &fund, const vector_unsigned_char& scriptID); \n
 *	  bool CAccount::HasAuthorityToMinus(uint64_t nMoney,int nHeight,const vector_unsigned_char& scriptID); \n

 \section Navigation
 * Use the buttons <code>Namespaces</code>, <code>Classes</code> or <code>Files</code> at the top of the page to start navigating the code.
 */
#include "serialize.h"
#include <memory>
#include "uint256.h"
#include "key.h"
#include "hash.h"
#include <vector>
#include <string>

using namespace std;

class CTxUndo;
class CValidationState;
class CAccountViewCache;
class CScriptDB;
class CBlock;
class CTransactionCacheDB;
class CTransactionCache;
class CScriptDBViewCache;
typedef vector<unsigned char> vector_unsigned_char;

class CRegID {
public:
	vector<unsigned char> vRegID;

	CRegID(string strRegID);

	CRegID(uint32_t nHeight = 0, uint16_t nIndex = 0);

	string ToString() const;

	IMPLEMENT_SERIALIZE
	(
			READWRITE(vRegID);
	)
};

enum TxType {
	REG_ACCT_TX = 1,
	NORMAL_TX = 2,
	CONTRACT_TX = 3,
	FREEZE_TX = 4,
	REWARD_TX = 5,
	REG_SCRIPT_TX = 6,
	NULL_TX,
};

enum RegScriptType {
	SCRIPT_ID = 0, SCRIPT_CONTENT = 1, NULL_TYPE,
};

class CNetAuthorizate {
public:
	uint32_t GetAuthorizeTime() const {
		return nAuthorizeTime;
	}
	uint64_t GetMaxMoneyPerTime() const {
		return nMaxMoneyPerTime;
	}
	uint64_t GetMaxMoneyTotal() const {
		return nMaxMoneyTotal;
	}
	uint64_t GetMaxMoneyPerDay() const {
		return nMaxMoneyPerDay;
	}

	void SetAuthorizeTime(uint32_t nTime) {
		nAuthorizeTime = nTime;
	}
	void SetMaxMoneyPerTime(uint64_t nMoney) {
		nMaxMoneyPerTime = nMoney;
	}
	void SetMaxMoneyTotal(uint64_t nMoney) {
		nMaxMoneyTotal = nMoney;
	}
	void SetMaxMoneyPerDay(uint64_t nMoney) {
		nMaxMoneyPerDay = nMoney;
	}

	IMPLEMENT_SERIALIZE
	(
		READWRITE(VARINT(nAuthorizeTime));
		READWRITE(VARINT(nUserDefine));
		READWRITE(VARINT(nMaxMoneyPerTime));
		READWRITE(VARINT(nMaxMoneyTotal));
		READWRITE(VARINT(nMaxMoneyPerDay));
	)

protected:
	uint64_t nAuthorizeTime;
	uint32_t nUserDefine;
	uint64_t nMaxMoneyPerTime;
	uint64_t nMaxMoneyTotal;
	uint64_t nMaxMoneyPerDay;
};

class CAuthorizate :public CNetAuthorizate{
public:
	uint64_t GetCurMaxMoneyPerDay() const {
		return nCurMaxMoneyPerDay;
	}
	uint32_t GetLastOperHeight() const {
		return nLastOperHeight;
	}

	void SetCurMaxMoneyPerDay(uint64_t nMoney) {
		nCurMaxMoneyPerDay = nMoney;
	}
	void SetLastOperHeight(uint32_t nHeight) {
		nLastOperHeight = nHeight;
	}

	IMPLEMENT_SERIALIZE
	(
		READWRITE(*(CNetAuthorizate*)this);
		READWRITE(VARINT(nLastOperHeight));
		READWRITE(VARINT(nCurMaxMoneyPerDay));
	)

private:
	uint32_t nLastOperHeight;
	uint64_t nCurMaxMoneyPerDay;
};

{'fraction_non_alphanumeric': 0.08968355328508586, 'fraction_numerical': 0.016177096636866752, 'mean_word_length': 5.489871086556169, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3445888', 'n_tokens_mistral': 2704, 'n_tokens_neox': 2472, 'n_words': 597}