frostfs-sdk-go/user/test/id.go
Leonard Lyubich 1ed426b8a6 [#199] owner: Rename to user, refactor and doc
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-04-19 18:44:02 +03:00

19 lines
313 B
Go

package usertest
import (
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neofs-sdk-go/user"
)
// ID returns random user.ID.
func ID() *user.ID {
key, err := keys.NewPrivateKey()
if err != nil {
panic(err)
}
var x user.ID
user.IDFromKey(&x, key.PrivateKey.PublicKey)
return &x
}