-
Notifications
You must be signed in to change notification settings - Fork 0
/
base91_2_test.go
37 lines (33 loc) · 1.11 KB
/
base91_2_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) 2017-2020 Denis Subbotin, Philip Schlump,
// Nika Jones, Steven Allen, MoonFruit
// Copyright (c) 2022 Teal.Finance contributors
//
// This file is a modified copy from https://github.com/mr-tron/base58
// The source code has been adapted to support other bases.
// This file is now part of BaseXX under the terms of the MIT License.
// SPDX-License-Identifier: MIT
// See the LICENSE file or https://opensource.org/licenses/MIT
package base91
import (
"testing"
)
func TestBase58_test2(t *testing.T) {
testAddr := []string{
"1QCaxc8hutpdZ62iKZsn1TCG3nh7uPZojq",
"1DhRmSGnhPjUaVPAj48zgPV9e2oRhAQFUb",
"17LN2oPYRYsXS9TdYdXCCDvF2FegshLDU2",
"14h2bDLZSuvRFhUL45VjPHJcW667mmRAAn",
}
for ii, vv := range testAddr {
// num := Base58Decode([]byte(vv))
// chk := Base58Encode(num)
num, err := StdEncoding.DecodeString(vv)
if err != nil {
t.Errorf("Test %d, expected success, got error %s\n", ii, err)
}
chk := StdEncoding.EncodeToString(num)
if vv != chk {
t.Errorf("Test %d, expected=%s got=%s Address did base58 encode/decode correctly.", ii, vv, chk)
}
}
}