diff --git a/commonspace/object/accountdata/accountdata.go b/commonspace/object/accountdata/accountdata.go index 12d3f029..3ad47ca4 100644 --- a/commonspace/object/accountdata/accountdata.go +++ b/commonspace/object/accountdata/accountdata.go @@ -12,6 +12,15 @@ type AccountKeys struct { PeerId string } +func New(peerKey crypto.PrivKey, signKey crypto.PrivKey) *AccountKeys { + peerId, _ := peer.IdFromSigningPubKey(peerKey.GetPublic()) + return &AccountKeys{ + PeerKey: peerKey, + SignKey: signKey, + PeerId: peerId.String(), + } +} + func NewRandom() (*AccountKeys, error) { peerKey, _, err := crypto.GenerateEd25519Key(rand.Reader) if err != nil {