mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-23 03:41:34 +00:00
crypto: adjust TestPublicKeys_Copy
Since the AllowedGroups []*keys.PublicKey slice is used in the initialization, the test should use the same structures. Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
parent
7c8d2c3ec5
commit
1292a00ef9
1 changed files with 7 additions and 3 deletions
|
@ -42,14 +42,18 @@ func TestEncodeDecodePublicKey(t *testing.T) {
|
|||
func TestPublicKeys_Copy(t *testing.T) {
|
||||
require.Nil(t, (PublicKeys)(nil).Copy())
|
||||
|
||||
pubs := make(PublicKeys, 5)
|
||||
for i := range pubs {
|
||||
pubz := make([]*PublicKey, 5)
|
||||
for i := range pubz {
|
||||
priv, err := NewPrivateKey()
|
||||
require.NoError(t, err)
|
||||
pubs[i] = priv.PublicKey()
|
||||
pubz[i] = priv.PublicKey()
|
||||
}
|
||||
pubs := PublicKeys(pubz)
|
||||
|
||||
cp := pubs.Copy()
|
||||
var pubx = ([]*PublicKey)(cp)
|
||||
require.Equal(t, pubz, pubx)
|
||||
|
||||
priv, err := NewPrivateKey()
|
||||
require.NoError(t, err)
|
||||
cp[0] = priv.PublicKey()
|
||||
|
|
Loading…
Reference in a new issue