From 6dddb2bee40dc97c37f91b451050b799c7342482 Mon Sep 17 00:00:00 2001 From: chromatic Date: Sun, 9 Jun 2024 17:37:45 -0700 Subject: [PATCH] Make getDerivedHDAddress return address, not key Addresses GH #217. --- src/address.c | 3 +-- test/address_tests.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/address.c b/src/address.c index 8057bfda6..d7d814ec5 100644 --- a/src/address.c +++ b/src/address.c @@ -486,8 +486,7 @@ int getDerivedHDAddress(const char* masterkey, uint32_t account, bool ischange, return false; } - int ret = getDerivedHDKeyByPath(masterkey, derived_path, outaddress, outprivkey); - return ret; + return getDerivedHDAddressByPath(masterkey, derived_path, outaddress); } /** diff --git a/test/address_tests.c b/test/address_tests.c index 7c674a287..6c71e81c8 100644 --- a/test/address_tests.c +++ b/test/address_tests.c @@ -111,10 +111,10 @@ void test_address() char* masterkey_main_ext = "dgpv51eADS3spNJh8h13wso3DdDAw3EJRqWvftZyjTNCFEG7gqV6zsZmucmJR6xZfvgfmzUthVC6LNicBeNNDQdLiqjQJjPeZnxG8uW3Q3gCA3e"; int res = getDerivedHDAddress(masterkey_main_ext, 0, false, 0, extout, true); u_assert_int_eq(res, true); - u_assert_str_eq(extout, "dgpv5BeiZXttUioRMzXUhD3s2uE9F23EhAwFu9meZeY9G99YS6hJCsQ9u6PRsAG3qfVwB1T7aQTVGLsmpxMiczV1dRDgzpbUxR7utpTRmN41iV7"); + u_assert_str_eq(extout, "DCm7oSg95sxwn3sWxYUDHgKKbB2mDmuR3B"); res = getDerivedHDAddress(masterkey_main_ext, 0, true, 0, extout, true); u_assert_int_eq(res, true); - u_assert_str_eq(extout, "dgpv5B5FdsPKQH8hK3vUo5ZR9ZXktfUxv1PStiM2TfnwH9oct5nJwAUx28356eNXoUwcNwzvfVRSDVh85aV3CQdKpQo2Vm8MKyz7KsNAXTEMbeS"); + u_assert_str_eq(extout, "D91jVi3CVGhRmyt83fhMdL4UJWtDuiTZET"); res = getDerivedHDAddress(masterkey_main_ext, 0, false, 0, extout, false); u_assert_int_eq(res, true); u_assert_str_eq(extout, "dgub8vXjuDpn2sTkerBdjSfq9kmjhaQsXHxyBkYrikw84GCYz9ozcdwvYPo5SSDWqZUVT5d4jrG8CHiGsC1M7pdETPhoKiQa92znT2vG9YaytBH");