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 @@
-
-
-
-
-
diff --git a/src/commands/entropy.cpp b/src/commands/entropy.cpp
deleted file mode 100644
index 03e7a51d..00000000
--- a/src/commands/entropy.cpp
+++ /dev/null
@@ -1,49 +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 .
- */
-#include
-
-namespace libbitcoin {
-namespace explorer {
-namespace commands {
-
-using namespace bc::system;
-using namespace bc::system::config;
-
-console_result entropy::invoke(std::ostream& output, std::ostream& error)
-{
- const auto bits = get_bits_option();
-
- const auto size = ceilinged_divide(bits, byte_bits);
-
- if (size < minimum_seed_size)
- {
- error << BX_ENTROPY_SHORT_BIT_LENGTH << std::endl;
- return console_result::failure;
- }
-
- data_chunk entropy(size);
- pseudo_random::fill(entropy);
-
- output << base16(entropy) << std::endl;
- return console_result::okay;
-}
-
-} //namespace commands
-} //namespace explorer
-} //namespace libbitcoin
diff --git a/src/generated.cpp b/src/generated.cpp
index 4d8fd56c..84b7724c 100644
--- a/src/generated.cpp
+++ b/src/generated.cpp
@@ -81,7 +81,6 @@ void broadcast(const function)> func)
func(make_shared());
func(make_shared());
func(make_shared());
- func(make_shared());
func(make_shared());
func(make_shared());
func(make_shared());
@@ -127,6 +126,7 @@ void broadcast(const function)> func)
func(make_shared());
func(make_shared());
func(make_shared());
+ func(make_shared());
func(make_shared());
func(make_shared());
func(make_shared());
@@ -248,8 +248,6 @@ shared_ptr find(const string& symbol)
return make_shared();
if (symbol == electrum_to_seed::symbol())
return make_shared();
- if (symbol == entropy::symbol())
- return make_shared();
if (symbol == fetch_balance::symbol())
return make_shared();
if (symbol == fetch_block::symbol())
@@ -340,6 +338,8 @@ shared_ptr find(const string& symbol)
return make_shared();
if (symbol == seed::symbol())
return make_shared();
+ if (symbol == seed::symbol())
+ return make_shared();
if (symbol == send_tx::symbol())
return make_shared();
if (symbol == settings::symbol())
@@ -426,8 +426,6 @@ std::string formerly(const string& former)
return ec_to_ek::symbol();
if (former == ec_to_public::formerly())
return ec_to_public::symbol();
- if (former == entropy::formerly())
- return entropy::symbol();
if (former == fetch_height::formerly())
return fetch_height::symbol();
if (former == fetch_public_key::formerly())
diff --git a/test/commands/entropy.cpp b/test/commands/entropy.cpp
deleted file mode 100644
index 464cf0ba..00000000
--- a/test/commands/entropy.cpp
+++ /dev/null
@@ -1,73 +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 .
- */
-
-#include "command.hpp"
-
-BX_USING_NAMESPACES()
-
-BOOST_AUTO_TEST_SUITE(offline)
-BOOST_AUTO_TEST_SUITE(entropy__invoke)
-
-#define BX_ENTROPY_BITS_TO_TERMINATED_BASE16(bits) (2 * (bits / 8) + 1)
-
-BOOST_AUTO_TEST_CASE(entropy__invoke__minimum_size__okay_output)
-{
- BX_DECLARE_COMMAND(entropy);
-
- // Here we must explicitly set the default value, since we are bypassing
- // the boost parser and variable bindings which implement defaults.
- command.set_bits_option(128);
- BX_REQUIRE_OKAY(command.invoke(output, error));
- BOOST_REQUIRE(output.str().size() == BX_ENTROPY_BITS_TO_TERMINATED_BASE16(128));
-}
-
-BOOST_AUTO_TEST_CASE(entropy__invoke__good_size__okay_output)
-{
- BX_DECLARE_COMMAND(entropy);
- command.set_bits_option(256);
- BX_REQUIRE_OKAY(command.invoke(output, error));
- BOOST_REQUIRE(output.str().size() == BX_ENTROPY_BITS_TO_TERMINATED_BASE16(256));
-}
-
-BOOST_AUTO_TEST_CASE(entropy__invoke_big_size_okay_output)
-{
- BX_DECLARE_COMMAND(entropy);
- command.set_bits_option(512);
- BX_REQUIRE_OKAY(command.invoke(output, error));
- BOOST_REQUIRE(output.str().size() == BX_ENTROPY_BITS_TO_TERMINATED_BASE16(512));
-}
-
-BOOST_AUTO_TEST_CASE(entropy__invoke__too_short__failure_error)
-{
- BX_DECLARE_COMMAND(entropy);
- command.set_bits_option(64);
- BX_REQUIRE_FAILURE(command.invoke(output, error));
- BX_REQUIRE_ERROR(BX_ENTROPY_SHORT_BIT_LENGTH "\n");
-}
-
-BOOST_AUTO_TEST_CASE(entropy__invoke__not_byte_aligned__failure_error)
-{
- BX_DECLARE_COMMAND(entropy);
- command.set_bits_option(129);
- BX_REQUIRE_FAILURE(command.invoke(output, error));
- BX_REQUIRE_ERROR(BX_ENTROPY_SHORT_BIT_LENGTH "\n");
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-BOOST_AUTO_TEST_SUITE_END()
diff --git a/test/generated__find.cpp b/test/generated__find.cpp
index cea35ac3..e3329c40 100644
--- a/test/generated__find.cpp
+++ b/test/generated__find.cpp
@@ -253,11 +253,6 @@ BOOST_AUTO_TEST_CASE(generated__find__electrum_to_seed__returns_object)
BOOST_REQUIRE(find("electrum-to-seed") != nullptr);
}
-BOOST_AUTO_TEST_CASE(generated__find__entropy__returns_object)
-{
- BOOST_REQUIRE(find("entropy") != nullptr);
-}
-
BOOST_AUTO_TEST_CASE(generated__find__fetch_balance__returns_object)
{
BOOST_REQUIRE(find("fetch-balance") != nullptr);
@@ -483,6 +478,11 @@ BOOST_AUTO_TEST_CASE(generated__find__seed__returns_object)
BOOST_REQUIRE(find("seed") != nullptr);
}
+BOOST_AUTO_TEST_CASE(generated__find__seed__returns_object)
+{
+ BOOST_REQUIRE(find("seed") != nullptr);
+}
+
BOOST_AUTO_TEST_CASE(generated__find__send_tx__returns_object)
{
BOOST_REQUIRE(find("send-tx") != nullptr);
diff --git a/test/generated__formerly.cpp b/test/generated__formerly.cpp
index 0be31851..c21cc59f 100644
--- a/test/generated__formerly.cpp
+++ b/test/generated__formerly.cpp
@@ -93,11 +93,6 @@ BOOST_AUTO_TEST_CASE(generated__formerly__ec_to_public_was_pubkey__returns_objec
BOOST_REQUIRE_EQUAL(formerly("pubkey"), ec_to_public::symbol());
}
-BOOST_AUTO_TEST_CASE(generated__formerly__entropy_was_seed__returns_object)
-{
- BOOST_REQUIRE_EQUAL(formerly("seed"), entropy::symbol());
-}
-
BOOST_AUTO_TEST_CASE(generated__formerly__fetch_height_was_fetch_last_height__returns_object)
{
BOOST_REQUIRE_EQUAL(formerly("fetch-last-height"), fetch_height::symbol());
diff --git a/test/generated__symbol.cpp b/test/generated__symbol.cpp
index d080723a..5c4c554b 100644
--- a/test/generated__symbol.cpp
+++ b/test/generated__symbol.cpp
@@ -253,11 +253,6 @@ BOOST_AUTO_TEST_CASE(generated__symbol__electrum_to_seed__returns_expected_value
BOOST_REQUIRE_EQUAL(electrum_to_seed::symbol(), "electrum-to-seed");
}
-BOOST_AUTO_TEST_CASE(generated__symbol__entropy__returns_expected_value)
-{
- BOOST_REQUIRE_EQUAL(entropy::symbol(), "entropy");
-}
-
BOOST_AUTO_TEST_CASE(generated__symbol__fetch_balance__returns_expected_value)
{
BOOST_REQUIRE_EQUAL(fetch_balance::symbol(), "fetch-balance");
@@ -483,6 +478,11 @@ BOOST_AUTO_TEST_CASE(generated__symbol__seed__returns_expected_value)
BOOST_REQUIRE_EQUAL(seed::symbol(), "seed");
}
+BOOST_AUTO_TEST_CASE(generated__symbol__seed__returns_expected_value)
+{
+ BOOST_REQUIRE_EQUAL(seed::symbol(), "seed");
+}
+
BOOST_AUTO_TEST_CASE(generated__symbol__send_tx__returns_expected_value)
{
BOOST_REQUIRE_EQUAL(send_tx::symbol(), "send-tx");