2018-03-02 15:24:09 +00:00
|
|
|
package util
|
2018-03-04 13:56:49 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestUint160FromToAddress(t *testing.T) {
|
|
|
|
addrs := []string{
|
|
|
|
"AMLr1CpPQtbEdiJdriX1HpRNMZUwbU2Huj",
|
|
|
|
"AKtwd3DRXj3nL5kHMUoNsdnsCEVjnuuTFF",
|
|
|
|
"AMxkaxFVG8Q1BhnB4fjTA5ZmUTEnnTMJMa",
|
|
|
|
}
|
|
|
|
for _, addr := range addrs {
|
|
|
|
val, err := Uint160DecodeAddress(addr)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
assert.Equal(t, addr, val.Address())
|
|
|
|
}
|
|
|
|
}
|