diff --git a/internal/db/db.go b/internal/db/db.go index 9d65db0..ef63108 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -8,7 +8,7 @@ type DB interface { GetUser(id string) (*api.User, error) // Devices. - PutDevice(pubKey, userId string) (string, error) + PutDevice(pubKey []byte, userId string) (string, error) GetDevice(id string) (*api.Device, error) GetUserDevices(userId string) ([]*api.Device, error) GetDeviceUser(deviceId string) (*api.User, error) diff --git a/internal/db/local.go b/internal/db/local.go index 840d699..2ee60b5 100644 --- a/internal/db/local.go +++ b/internal/db/local.go @@ -43,7 +43,7 @@ func (d *localDB) GetUser(id string) (*api.User, error) { return u, nil } -func (d *localDB) PutDevice(pubKey, userId string) (string, error) { +func (d *localDB) PutDevice(pubKey []byte, userId string) (string, error) { id := ulid.Make().String() if _, ok := d.users[userId]; !ok { return "", errors.New("user does not exist")