2017-09-12 18:02:30 +02:00
|
|
|
package address
|
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
2017-11-20 19:44:19 +01:00
|
|
|
func TestDecodeAddressLBRYCrdMain(t *testing.T) {
|
2017-09-12 18:02:30 +02:00
|
|
|
addr := "bUc9gyCJPKu2CBYpTvJ98MdmsLb68utjP6"
|
|
|
|
correct := [25]byte{85, 174, 41, 64, 245, 110, 91, 239, 43, 208, 32, 73, 115, 20, 70, 204, 83, 199, 3,
|
|
|
|
206, 210, 176, 194, 188, 193}
|
2017-11-20 19:44:19 +01:00
|
|
|
result, err := DecodeAddress(addr, "lbrycrd_main")
|
2017-09-12 18:02:30 +02:00
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
}
|
|
|
|
if result != correct {
|
|
|
|
t.Error("Mismatch")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-20 19:44:19 +01:00
|
|
|
func TestEncodeAddressLBRYCrdMain(t *testing.T) {
|
2017-09-12 18:02:30 +02:00
|
|
|
addr := [25]byte{85, 174, 41, 64, 245, 110, 91, 239, 43, 208, 32, 73, 115, 20, 70, 204, 83, 199, 3,
|
|
|
|
206, 210, 176, 194, 188, 193}
|
|
|
|
correct := "bUc9gyCJPKu2CBYpTvJ98MdmsLb68utjP6"
|
2017-11-20 19:44:19 +01:00
|
|
|
result, err := EncodeAddress(addr, "lbrycrd_main")
|
2017-09-12 18:02:30 +02:00
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
}
|
|
|
|
if result != correct {
|
|
|
|
t.Error("Mismatch")
|
|
|
|
}
|
|
|
|
}
|