From d05c339b0a6ed493231f14bf40fdf894525ea271 Mon Sep 17 00:00:00 2001 From: Kulpreet Singh <13216+kulpreet@users.noreply.github.com> Date: Fri, 18 Aug 2023 10:32:42 +0200 Subject: [PATCH] Remove entropy from geenrate.xml The seed src and test files were already there and echo the seed command obsolete message --- data/bx | 1 - include/bitcoin/explorer/commands/entropy.hpp | 235 ------------------ include/bitcoin/explorer/generated.hpp | 2 +- model/generate.xml | 5 - src/commands/entropy.cpp | 49 ---- src/generated.cpp | 8 +- test/commands/entropy.cpp | 73 ------ test/generated__find.cpp | 10 +- test/generated__formerly.cpp | 5 - test/generated__symbol.cpp | 10 +- 10 files changed, 14 insertions(+), 384 deletions(-) delete mode 100644 include/bitcoin/explorer/commands/entropy.hpp delete mode 100644 src/commands/entropy.cpp delete mode 100644 test/commands/entropy.cpp diff --git a/data/bx b/data/bx index 4009e13a..1f68b9e7 100644 --- a/data/bx +++ b/data/bx @@ -50,7 +50,6 @@ _bx() electrum-decode electrum-new electrum-to-seed - entropy fetch-balance fetch-block fetch-block-hashes diff --git a/include/bitcoin/explorer/commands/entropy.hpp b/include/bitcoin/explorer/commands/entropy.hpp deleted file mode 100644 index ab31a1f1..00000000 --- a/include/bitcoin/explorer/commands/entropy.hpp +++ /dev/null @@ -1,235 +0,0 @@ -/** - * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS) - * - * This file is part of libbitcoin. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -#ifndef BX_ENTROPY_HPP -#define BX_ENTROPY_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/********* GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY **********/ - -namespace libbitcoin { -namespace explorer { -namespace commands { - -/** - * Various localizable strings. - */ -#define BX_ENTROPY_SHORT_BIT_LENGTH \ - "The entropy bit length is not at least 128." - -/** - * Class to implement the entropy command. - */ -class BCX_API entropy - : public command -{ -public: - - /** - * The symbolic (not localizable) command name, lower case. - */ - static const char* symbol() - { - return "entropy"; - } - - /** - * The symbolic (not localizable) former command name, lower case. - */ - static const char* formerly() - { - return "seed"; - } - - /** - * Destructor. - */ - virtual ~entropy() - { - } - - /** - * The member symbolic (not localizable) command name, lower case. - */ - virtual const char* name() - { - return entropy::symbol(); - } - - /** - * The localizable command category name, upper case. - */ - virtual const char* category() - { - return "WALLET"; - } - - /** - * The localizable command description. - */ - virtual const char* description() - { - return "Generate pseudorandom entropy."; - } - - /** - * Load program argument definitions. - * A value of -1 indicates that the number of instances is unlimited. - * @return The loaded program argument definitions. - */ - virtual system::arguments_metadata& load_arguments() - { - return get_argument_metadata(); - } - - /** - * Load parameter fallbacks from file or input as appropriate. - * @param[in] input The input stream for loading the parameters. - * @param[in] The loaded variables. - */ - virtual void load_fallbacks(std::istream& input, - po::variables_map& variables) - { - } - - /** - * Load program option definitions. - * BUGBUG: see boost bug/fix: svn.boost.org/trac/boost/ticket/8009 - * @return The loaded program option definitions. - */ - virtual system::options_metadata& load_options() - { - using namespace po; - options_description& options = get_option_metadata(); - options.add_options() - ( - BX_HELP_VARIABLE ",h", - value()->zero_tokens(), - "Get a description and instructions for this command." - ) - ( - BX_CONFIG_VARIABLE ",c", - value(), - "The path to the configuration settings file." - ) - ( - "bits,b", - value(&option_.bits)->default_value(192), - "The length of the entropy in bits. The value must be at least 128 and is rounded up to a whole byte, defaults to 192." - ); - - return options; - } - - /** - * Set variable defaults from configuration variable values. - * @param[in] variables The loaded variables. - */ - virtual void set_defaults_from_config(po::variables_map& variables) - { - } - - /** - * Invoke the command. - * @param[out] output The input stream for the command execution. - * @param[out] error The input stream for the command execution. - * @return The appropriate console return code { -1, 0, 1 }. - */ - virtual system::console_result invoke(std::ostream& output, - std::ostream& cerr); - - /* Properties */ - - /** - * Get the value of the bits option. - */ - virtual uint16_t& get_bits_option() - { - return option_.bits; - } - - /** - * Set the value of the bits option. - */ - virtual void set_bits_option( - const uint16_t& value) - { - option_.bits = value; - } - -private: - - /** - * Command line argument bound variables. - * Uses cross-compiler safe constructor-based zeroize. - * Zeroize for unit test consistency with program_options initialization. - */ - struct argument - { - argument() - { - } - - } argument_; - - /** - * Command line option bound variables. - * Uses cross-compiler safe constructor-based zeroize. - * Zeroize for unit test consistency with program_options initialization. - */ - struct option - { - option() - : bits() - { - } - - uint16_t bits; - } option_; -}; - -} // namespace commands -} // namespace explorer -} // namespace libbitcoin - -#endif diff --git a/include/bitcoin/explorer/generated.hpp b/include/bitcoin/explorer/generated.hpp index 260d206a..a9f09168 100644 --- a/include/bitcoin/explorer/generated.hpp +++ b/include/bitcoin/explorer/generated.hpp @@ -68,7 +68,6 @@ #include #include #include -#include #include #include #include @@ -114,6 +113,7 @@ #include #include #include +#include #include #include #include diff --git a/model/generate.xml b/model/generate.xml index d301587c..6785d76b 100644 --- a/model/generate.xml +++ b/model/generate.xml @@ -332,11 +332,6 @@ - - -