forked from TrueCloudLab/neoneo-go
* 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
20 lines
368 B
Go
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)
|
|
}
|
|
}
|