summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmir Taaki <genjix@riseup.net>2014-05-09 12:26:02 (GMT)
committer Amir Taaki <genjix@riseup.net>2014-05-09 12:26:02 (GMT)
commit981fe788e15a35b9498cedaeab062bab5810a0da (patch)
tree93d1a901b4ed8cf55723413ae44a07525ce5da6f
parent32097799d8fef40b0d871298f388e891cc6bb85c (diff)
decode_hex_digest is removed from libbitcoin, replace with decode_hash/decode_short_hash instead.
-rw-r--r--src/ec_util.hpp2
-rw-r--r--src/encode-addr.cpp2
-rw-r--r--src/fetch-block-header.cpp2
-rw-r--r--src/fetch-transaction-index.cpp2
-rw-r--r--src/fetch-transaction.cpp2
-rw-r--r--src/mktx.cpp2
-rw-r--r--src/secret-to-wif.cpp2
-rw-r--r--src/stealth-initiate.cpp2
-rw-r--r--src/stealth-uncover-secret.cpp4
-rw-r--r--src/stealth-uncover.cpp2
-rw-r--r--src/util.hpp2
11 files changed, 12 insertions, 12 deletions
diff --git a/src/ec_util.hpp b/src/ec_util.hpp
index fe2fcbe..301f968 100644
--- a/src/ec_util.hpp
+++ b/src/ec_util.hpp
@@ -3,7 +3,7 @@ using namespace bc;
bool set_ec_secret(ec_secret& secret, const std::string& arg)
{
- ec_secret result = decode_hex_digest<ec_secret>(arg);
+ ec_secret result = decode_hash(arg);
if (result == null_hash)
return false;
secret = result;
diff --git a/src/encode-addr.cpp b/src/encode-addr.cpp
index a40a6d5..1bde366 100644
--- a/src/encode-addr.cpp
+++ b/src/encode-addr.cpp
@@ -36,7 +36,7 @@ int main(int argc, char** argv)
addr_str = argv[1];
}
- short_hash hashdata = decode_hex_digest<short_hash>(addr_str);
+ short_hash hashdata = decode_short_hash(addr_str);
if (hashdata == null_short_hash)
{
std::cerr << "Incorrect HASH passed in." << std::endl;
diff --git a/src/fetch-block-header.cpp b/src/fetch-block-header.cpp
index c96c29e..aa99923 100644
--- a/src/fetch-block-header.cpp
+++ b/src/fetch-block-header.cpp
@@ -37,7 +37,7 @@ int main(int argc, char** argv)
config["client-certificate"], config["server-public-key"]);
// Try first to interpret index as hash, if that fails then
// interpret the index as a height instead.
- hash_digest blk_hash = decode_hex_digest<hash_digest>(index_str);
+ hash_digest blk_hash = decode_hash(index_str);
if (blk_hash == null_hash)
{
size_t height = 0;
diff --git a/src/fetch-transaction-index.cpp b/src/fetch-transaction-index.cpp
index 4fe650b..32dbc67 100644
--- a/src/fetch-transaction-index.cpp
+++ b/src/fetch-transaction-index.cpp
@@ -28,7 +28,7 @@ int main(int argc, char** argv)
tx_hash_str = argv[1];
else
tx_hash_str = read_stdin();
- hash_digest tx_hash = decode_hex_digest<hash_digest>(tx_hash_str);
+ hash_digest tx_hash = decode_hash(tx_hash_str);
config_map_type config;
load_config(config);
threadpool pool(1);
diff --git a/src/fetch-transaction.cpp b/src/fetch-transaction.cpp
index 694abef..ce99972 100644
--- a/src/fetch-transaction.cpp
+++ b/src/fetch-transaction.cpp
@@ -44,7 +44,7 @@ int main(int argc, char** argv)
tx_hash_str = argv[1];
else
tx_hash_str = read_stdin();
- hash_digest tx_hash = decode_hex_digest<hash_digest>(tx_hash_str);
+ hash_digest tx_hash = decode_hash(tx_hash_str);
config_map_type config;
load_config(config);
threadpool pool(1);
diff --git a/src/mktx.cpp b/src/mktx.cpp
index 7ac3fc6..13b5f1d 100644
--- a/src/mktx.cpp
+++ b/src/mktx.cpp
@@ -47,7 +47,7 @@ bool load_outpoint(output_point& prevout, const std::string& parameter)
std::cerr << "mktx: Incorrect TXHASH." << std::endl;
return false;
}
- prevout.hash = decode_hex_digest<hash_digest>(hex_string);
+ prevout.hash = decode_hash(hex_string);
const std::string& index_string = strs[1];
try
{
diff --git a/src/secret-to-wif.cpp b/src/secret-to-wif.cpp
index a37a811..1dd082f 100644
--- a/src/secret-to-wif.cpp
+++ b/src/secret-to-wif.cpp
@@ -15,7 +15,7 @@ std::string dump_file(std::istream& in_file)
int main()
{
std::string secret_str = dump_file(std::cin);
- secret_parameter secret = decode_hex_digest<hash_digest>(secret_str);
+ secret_parameter secret = decode_hash(secret_str);
std::cout << secret_to_wif(secret) << std::endl;
return 0;
}
diff --git a/src/stealth-initiate.cpp b/src/stealth-initiate.cpp
index 92aeca9..682ccee 100644
--- a/src/stealth-initiate.cpp
+++ b/src/stealth-initiate.cpp
@@ -11,7 +11,7 @@ int main(int argc, char** argv)
"SPEND_PUBKEY" << std::endl;
return -1;
}
- ec_secret ephem_secret = decode_hex_digest<ec_secret>(argv[1]);
+ ec_secret ephem_secret = decode_hash(argv[1]);
ec_point scan_pubkey = decode_hex(argv[2]);
ec_point spend_pubkey = decode_hex(argv[3]);
ec_point pubkey = initiate_stealth(ephem_secret, scan_pubkey, spend_pubkey);
diff --git a/src/stealth-uncover-secret.cpp b/src/stealth-uncover-secret.cpp
index 1904550..51d9be3 100644
--- a/src/stealth-uncover-secret.cpp
+++ b/src/stealth-uncover-secret.cpp
@@ -12,8 +12,8 @@ int main(int argc, char** argv)
return -1;
}
ec_point ephem_pubkey = decode_hex(argv[1]);
- ec_secret scan_secret = decode_hex_digest<ec_secret>(argv[2]);
- ec_secret spend_secret = decode_hex_digest<ec_secret>(argv[3]);
+ ec_secret scan_secret = decode_hash(argv[2]);
+ ec_secret spend_secret = decode_hash(argv[3]);
ec_secret secret = uncover_stealth_secret(
ephem_pubkey, scan_secret, spend_secret);
std::cout << secret << std::endl;
diff --git a/src/stealth-uncover.cpp b/src/stealth-uncover.cpp
index 87717b4..bd1b999 100644
--- a/src/stealth-uncover.cpp
+++ b/src/stealth-uncover.cpp
@@ -12,7 +12,7 @@ int main(int argc, char** argv)
return -1;
}
ec_point ephem_pubkey = decode_hex(argv[1]);
- ec_secret scan_secret = decode_hex_digest<ec_secret>(argv[2]);
+ ec_secret scan_secret = decode_hash(argv[2]);
ec_point spend_pubkey = decode_hex(argv[3]);
ec_point pubkey = uncover_stealth(ephem_pubkey, scan_secret, spend_pubkey);
std::cout << pubkey << std::endl;
diff --git a/src/util.hpp b/src/util.hpp
index c0dc272..778b9e9 100644
--- a/src/util.hpp
+++ b/src/util.hpp
@@ -53,7 +53,7 @@ std::string read_stdin()
bool read_private_key(elliptic_curve_key& key, const std::string& arg,
int is_compressed=-1)
{
- secret_parameter secret = decode_hex_digest<secret_parameter>(arg);
+ secret_parameter secret = decode_hash(arg);
bool compressed_flag = true;
if (secret == null_hash)
{