Skip to content

Commit a856bd6

Browse files
committed
Obsolete commands: base58check-*, seed, wrap-* (to be replaced).
1 parent 3e9cd68 commit a856bd6

15 files changed

+104
-528
lines changed

include/bitcoin/explorer/commands/base58check-decode.hpp

Lines changed: 16 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ namespace libbitcoin {
5050
namespace explorer {
5151
namespace commands {
5252

53+
/**
54+
* Various localizable strings.
55+
*/
56+
#define BX_BASE58CHECK_DECODE_OBSOLETE \
57+
"This command is obsolete. Use combination of checked-encode and base58-encode instead."
58+
5359
/**
5460
* Class to implement the base58check-decode command.
5561
*/
@@ -97,15 +103,23 @@ class BCX_API base58check_decode
97103
return "Convert a Base58Check value to its component parts.";
98104
}
99105

106+
/**
107+
* Declare whether the command has been obsoleted.
108+
* @return True if the command is obsolete
109+
*/
110+
virtual bool obsolete()
111+
{
112+
return true;
113+
}
114+
100115
/**
101116
* Load program argument definitions.
102117
* A value of -1 indicates that the number of instances is unlimited.
103118
* @return The loaded program argument definitions.
104119
*/
105120
virtual system::arguments_metadata& load_arguments()
106121
{
107-
return get_argument_metadata()
108-
.add("BASE58CHECK", 1);
122+
return get_argument_metadata();
109123
}
110124

111125
/**
@@ -116,8 +130,6 @@ class BCX_API base58check_decode
116130
virtual void load_fallbacks(std::istream& input,
117131
po::variables_map& variables)
118132
{
119-
const auto raw = requires_raw_input();
120-
load_input(get_base58check_argument(), "BASE58CHECK", variables, input, raw);
121133
}
122134

123135
/**
@@ -139,16 +151,6 @@ class BCX_API base58check_decode
139151
BX_CONFIG_VARIABLE ",c",
140152
value<boost::filesystem::path>(),
141153
"The path to the configuration settings file."
142-
)
143-
(
144-
"format,f",
145-
value<explorer::config::encoding>(&option_.format),
146-
"The output format. Options are 'info', 'json' and 'xml', defaults to 'info'."
147-
)
148-
(
149-
"BASE58CHECK",
150-
value<system::config::base58>(&argument_.base58check),
151-
"The Base58Check value to decode. If not specified the value is read from STDIN."
152154
);
153155

154156
return options;
@@ -173,40 +175,6 @@ class BCX_API base58check_decode
173175

174176
/* Properties */
175177

176-
/**
177-
* Get the value of the BASE58CHECK argument.
178-
*/
179-
virtual system::config::base58& get_base58check_argument()
180-
{
181-
return argument_.base58check;
182-
}
183-
184-
/**
185-
* Set the value of the BASE58CHECK argument.
186-
*/
187-
virtual void set_base58check_argument(
188-
const system::config::base58& value)
189-
{
190-
argument_.base58check = value;
191-
}
192-
193-
/**
194-
* Get the value of the format option.
195-
*/
196-
virtual explorer::config::encoding& get_format_option()
197-
{
198-
return option_.format;
199-
}
200-
201-
/**
202-
* Set the value of the format option.
203-
*/
204-
virtual void set_format_option(
205-
const explorer::config::encoding& value)
206-
{
207-
option_.format = value;
208-
}
209-
210178
private:
211179

212180
/**
@@ -217,11 +185,9 @@ class BCX_API base58check_decode
217185
struct argument
218186
{
219187
argument()
220-
: base58check()
221188
{
222189
}
223190

224-
system::config::base58 base58check;
225191
} argument_;
226192

227193
/**
@@ -232,11 +198,9 @@ class BCX_API base58check_decode
232198
struct option
233199
{
234200
option()
235-
: format()
236201
{
237202
}
238203

239-
explorer::config::encoding format;
240204
} option_;
241205
};
242206

include/bitcoin/explorer/commands/base58check-encode.hpp

Lines changed: 16 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ namespace libbitcoin {
5050
namespace explorer {
5151
namespace commands {
5252

53+
/**
54+
* Various localizable strings.
55+
*/
56+
#define BX_BASE58CHECK_ENCODE_OBSOLETE \
57+
"This command is obsolete. Use combination of base58-encode and checked-decode instead."
58+
5359
/**
5460
* Class to implement the base58check-encode command.
5561
*/
@@ -97,15 +103,23 @@ class BCX_API base58check_encode
97103
return "Convert a Base16 value to Base58Check.";
98104
}
99105

106+
/**
107+
* Declare whether the command has been obsoleted.
108+
* @return True if the command is obsolete
109+
*/
110+
virtual bool obsolete()
111+
{
112+
return true;
113+
}
114+
100115
/**
101116
* Load program argument definitions.
102117
* A value of -1 indicates that the number of instances is unlimited.
103118
* @return The loaded program argument definitions.
104119
*/
105120
virtual system::arguments_metadata& load_arguments()
106121
{
107-
return get_argument_metadata()
108-
.add("BASE16", 1);
122+
return get_argument_metadata();
109123
}
110124

111125
/**
@@ -116,8 +130,6 @@ class BCX_API base58check_encode
116130
virtual void load_fallbacks(std::istream& input,
117131
po::variables_map& variables)
118132
{
119-
const auto raw = requires_raw_input();
120-
load_input(get_base16_argument(), "BASE16", variables, input, raw);
121133
}
122134

123135
/**
@@ -139,16 +151,6 @@ class BCX_API base58check_encode
139151
BX_CONFIG_VARIABLE ",c",
140152
value<boost::filesystem::path>(),
141153
"The path to the configuration settings file."
142-
)
143-
(
144-
"version,v",
145-
value<explorer::config::byte>(&option_.version)->default_value(0),
146-
"The desired version number."
147-
)
148-
(
149-
"BASE16",
150-
value<system::config::base16>(&argument_.base16),
151-
"The Base16 value to Base58Check encode. If not specified the value is read from STDIN."
152154
);
153155

154156
return options;
@@ -160,12 +162,6 @@ class BCX_API base58check_encode
160162
*/
161163
virtual void set_defaults_from_config(po::variables_map& variables)
162164
{
163-
const auto& option_version = variables["version"];
164-
const auto& option_version_config = variables["wallet.pay_to_public_key_hash_version"];
165-
if (option_version.defaulted() && !option_version_config.defaulted())
166-
{
167-
option_.version = option_version_config.as<explorer::config::byte>();
168-
}
169165
}
170166

171167
/**
@@ -179,40 +175,6 @@ class BCX_API base58check_encode
179175

180176
/* Properties */
181177

182-
/**
183-
* Get the value of the BASE16 argument.
184-
*/
185-
virtual system::config::base16& get_base16_argument()
186-
{
187-
return argument_.base16;
188-
}
189-
190-
/**
191-
* Set the value of the BASE16 argument.
192-
*/
193-
virtual void set_base16_argument(
194-
const system::config::base16& value)
195-
{
196-
argument_.base16 = value;
197-
}
198-
199-
/**
200-
* Get the value of the version option.
201-
*/
202-
virtual explorer::config::byte& get_version_option()
203-
{
204-
return option_.version;
205-
}
206-
207-
/**
208-
* Set the value of the version option.
209-
*/
210-
virtual void set_version_option(
211-
const explorer::config::byte& value)
212-
{
213-
option_.version = value;
214-
}
215-
216178
private:
217179

218180
/**
@@ -223,11 +185,9 @@ class BCX_API base58check_encode
223185
struct argument
224186
{
225187
argument()
226-
: base16()
227188
{
228189
}
229190

230-
system::config::base16 base16;
231191
} argument_;
232192

233193
/**
@@ -238,11 +198,9 @@ class BCX_API base58check_encode
238198
struct option
239199
{
240200
option()
241-
: version()
242201
{
243202
}
244203

245-
explorer::config::byte version;
246204
} option_;
247205
};
248206

include/bitcoin/explorer/commands/seed.hpp

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ namespace commands {
5353
/**
5454
* Various localizable strings.
5555
*/
56-
#define BX_SEED_BIT_LENGTH_UNSUPPORTED \
57-
"The seed size is not supported."
56+
#define BX_SEED_OBSOLETE \
57+
"This command is obsolete. Use the entropy command instead."
5858

5959
/**
6060
* Class to implement the seed command.
@@ -103,6 +103,15 @@ class BCX_API seed
103103
return "Generate a pseudorandom seed.";
104104
}
105105

106+
/**
107+
* Declare whether the command has been obsoleted.
108+
* @return True if the command is obsolete
109+
*/
110+
virtual bool obsolete()
111+
{
112+
return true;
113+
}
114+
106115
/**
107116
* Load program argument definitions.
108117
* A value of -1 indicates that the number of instances is unlimited.
@@ -142,11 +151,6 @@ class BCX_API seed
142151
BX_CONFIG_VARIABLE ",c",
143152
value<boost::filesystem::path>(),
144153
"The path to the configuration settings file."
145-
)
146-
(
147-
"bit_length,b",
148-
value<uint16_t>(&option_.bit_length)->default_value(192),
149-
"The length of the seed in bits. Must be divisible by 8 and must not be less than 128, defaults to 192."
150154
);
151155

152156
return options;
@@ -171,23 +175,6 @@ class BCX_API seed
171175

172176
/* Properties */
173177

174-
/**
175-
* Get the value of the bit_length option.
176-
*/
177-
virtual uint16_t& get_bit_length_option()
178-
{
179-
return option_.bit_length;
180-
}
181-
182-
/**
183-
* Set the value of the bit_length option.
184-
*/
185-
virtual void set_bit_length_option(
186-
const uint16_t& value)
187-
{
188-
option_.bit_length = value;
189-
}
190-
191178
private:
192179

193180
/**
@@ -211,11 +198,9 @@ class BCX_API seed
211198
struct option
212199
{
213200
option()
214-
: bit_length()
215201
{
216202
}
217203

218-
uint16_t bit_length;
219204
} option_;
220205
};
221206

0 commit comments

Comments
 (0)