mirror of
https://github.com/status-im/status-go.git
synced 2025-01-10 06:36:32 +00:00
a08319f615
* fix(sync)_: Improve EnableInstallationAndSync and add EnableInstallationV2 - Refactor EnableInstallationAndSync for better error handling and response merging - Add new EnableInstallationV2 method returning the installation - Update tests to check for installation in response - Deprecate old EnableInstallation method * chore_: remove EnableInstallationV2 * fix(sync)_: create/delete AC notification only when targetInstallationID match - Add targetInstallationID parameter to SendPairInstallation function - Update protobuf SyncPairInstallation struct with TargetInstallationId field - Modify method calls across multiple test files to include new parameter - Update pairing.proto and pairing.pb.go with new field for local pairing * chore_: rename stubEnableInstallationAndPair chore_: move InstallationIDProvider chore_: revert endpoints.go test_: check AC with resp chore_: rename ModifiedInstallationsTargetedToThisDevice test_: add InstallationIDProvider chore_: revert endpoints.go chore_: remove comment test_: add TestNewInstallationCreatedIsNotDeleted
24 lines
489 B
Go
24 lines
489 B
Go
package requests
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
var ErrEnableInstallationAndPairInvalidID = errors.New("enable installation and pair: invalid installation id")
|
|
|
|
type EnableInstallationAndPair struct {
|
|
InstallationID string `json:"installationId"`
|
|
}
|
|
|
|
func (j *EnableInstallationAndPair) Validate() error {
|
|
if len(j.InstallationID) == 0 {
|
|
return ErrEnableInstallationAndPairInvalidID
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (j *EnableInstallationAndPair) GetInstallationID() string {
|
|
return j.InstallationID
|
|
}
|