neoneo-go/pkg/crypto/public_key_test.go
Anthony De Meulemeester 52fa41a12a
Persist transactions (#51)
* added account_state + changed ECPoint to PublicKey

* account state persist

* in depth test for existing accounts.

* implemented GetTransaction.

* added enrollment TX

* added persist of accounts and unspent coins

* bumped version -> 0.32.0
2018-03-21 17:11:04 +01:00

20 lines
368 B
Go

package crypto
import (
"bytes"
"testing"
"github.com/stretchr/testify/assert"
)
func TestEncodeDecodePublicKey(t *testing.T) {
for i := 0; i < 4; i++ {
p := &PublicKey{RandomECPoint()}
buf := new(bytes.Buffer)
assert.Nil(t, p.EncodeBinary(buf))
pDecode := &PublicKey{}
assert.Nil(t, pDecode.DecodeBinary(buf))
assert.Equal(t, p.X, pDecode.X)
}
}