neoneo-go/pkg/crypto/address_test.go
Anthony De Meulemeester a67728628e
Persist blockchain with leveldb on disk (#48)
* Created test_data folder with block json files for testing + create separate file for block base.

* Fixed bug in WriteVarUint + Trim logic + unit tests

* Refactored store and add more tests for it.

* restore headerList from chain file

* Fix tx decode bug + lots of housekeeping.

* Implemented Node restore state from chain file.

* Created standalone package for storage. Added couple more methods to Batch and Store interfaces.

* Block persisting + tests

* bumped version -> 0.31.0
2018-03-17 12:53:21 +01:00

22 lines
430 B
Go

package crypto
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestUint160DecodeAddress(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, AddressFromUint160(val))
}
}