From cef307c87ef28d19565e8bbb7cfffef0730d2ea4 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Mon, 22 Dec 2014 10:56:00 -0600 Subject: [PATCH] Complete base58 migration to new package. --- base58.go | 19 ------------------- base58/base58_test.go | 6 +++--- doc.go | 11 ----------- 3 files changed, 3 insertions(+), 33 deletions(-) delete mode 100644 base58.go diff --git a/base58.go b/base58.go deleted file mode 100644 index ea21eb0..0000000 --- a/base58.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2013-2014 Conformal Systems LLC. -// Use of this source code is governed by an ISC -// license that can be found in the LICENSE file. - -package btcutil - -import "github.com/conformal/btcutil/base58" - -// Base58Decode wraps the new base58 package for backwards compatibility. -// TODO: Remove as soon as the other repos have been updated to use the new package. -func Base58Decode(b string) []byte { - return base58.Decode(b) -} - -// Base58Encode wraps the new base58 package for backwards compatibility. -// TODO: Remove as soon as the other repos have been updated to use the new package. -func Base58Encode(b []byte) string { - return base58.Encode(b) -} diff --git a/base58/base58_test.go b/base58/base58_test.go index 4669077..0356f1c 100644 --- a/base58/base58_test.go +++ b/base58/base58_test.go @@ -63,7 +63,7 @@ var hexTests = []struct { } func TestBase58(t *testing.T) { - // Base58Encode tests + // Encode tests for x, test := range stringTests { tmp := []byte(test.in) if res := base58.Encode(tmp); res != test.out { @@ -73,7 +73,7 @@ func TestBase58(t *testing.T) { } } - // Base58Decode tests + // Decode tests for x, test := range hexTests { b, err := hex.DecodeString(test.in) if err != nil { @@ -87,7 +87,7 @@ func TestBase58(t *testing.T) { } } - // Base58Decode with invalid input + // Decode with invalid input for x, test := range invalidStringTests { if res := base58.Decode(test.in); string(res) != test.out { t.Errorf("Decode invalidString test #%d failed: got: %q want: %q", diff --git a/doc.go b/doc.go index 3042aa7..74811a1 100644 --- a/doc.go +++ b/doc.go @@ -18,16 +18,5 @@ A Tx defines a bitcoin transaction that provides more efficient manipulation of raw wire protocol transactions. It memoizes the hash for the transaction on its first access so subsequent accesses don't have to repeat the relatively expensive hashing operations. - -Base58 Usage - -To decode a base58 string: - - rawData := btcutil.Base58Decode(encodedData) - -Similarly, to encode the same data: - - encodedData := btcutil.Base58Encode(rawData) - */ package btcutil