lbry.go/schema/address/address_test.go

30 lines
776 B
Go
Raw Permalink Normal View History

2017-09-12 18:02:30 +02:00
package address
import "testing"
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}
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")
}
}
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"
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")
}
}