frostfs-sdk-go/user/test/id.go
Dmitrii Stepanov 157a9930e8 [#190] sdk-go: Pass user.ID by value
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-11-22 19:21:20 +03:00

19 lines
322 B
Go

package usertest
import (
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
)
// 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
}