Skip to content

Commit

Permalink
fix: review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MishkaRogachev committed Nov 7, 2023
1 parent 8b359bd commit d7f3d9d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions protocol/identity_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/status-im/status-go/protocol/protobuf"
)

const CipherMessageAutentificationFailed = "cipher: message authentication failed"
var ErrCipherMessageAutentificationFailed = errors.New("cipher: message authentication failed")

func EncryptIdentityImagesWithContactPubKeys(iis map[string]*protobuf.IdentityImage, m *Messenger) (err error) {
// Make AES key
Expand Down Expand Up @@ -79,7 +79,7 @@ image:
// Decrypt the main encryption AES key with AES encryption using the DH key
dAESKey, err := common.Decrypt(empk, sharedKey)
if err != nil {
if err.Error() == CipherMessageAutentificationFailed {
if err == ErrCipherMessageAutentificationFailed {
continue
}
return err
Expand Down
2 changes: 1 addition & 1 deletion protocol/messenger_profile_showcase.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func (m *Messenger) DecryptProfileShowcaseEntriesWithContactPubKeys(senderPubKey
// Decrypt the main encryption AES key with AES encryption using the DH key
dAESKey, err := common.Decrypt(eAESKey, sharedKey)
if err != nil {
if err.Error() == CipherMessageAutentificationFailed {
if err == ErrCipherMessageAutentificationFailed {
continue
}
return nil, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ CREATE TABLE profile_showcase_communities_contacts (
community_id TEXT NOT NULL,
sort_order INT DEFAULT 0,
contact_id TEXT NOT NULL,
PRIMARY KEY (community_id, contact_id)
PRIMARY KEY (contact_id, community_id)
);

CREATE TABLE profile_showcase_accounts_contacts (
Expand All @@ -44,19 +44,19 @@ CREATE TABLE profile_showcase_accounts_contacts (
emoji VARCHAR DEFAULT "",
sort_order INT DEFAULT 0,
contact_id TEXT NOT NULL,
PRIMARY KEY (address, contact_id)
PRIMARY KEY (contact_id, address)
);

CREATE TABLE profile_showcase_collectibles_contacts (
uid TEXT NOT NULL,
sort_order INT DEFAULT 0,
contact_id TEXT NOT NULL,
PRIMARY KEY (uid, contact_id)
PRIMARY KEY (contact_id, uid)
);

CREATE TABLE profile_showcase_assets_contacts (
symbol TEXT NOT NULL,
sort_order INT DEFAULT 0,
contact_id TEXT NOT NULL,
PRIMARY KEY (symbol, contact_id)
PRIMARY KEY (contact_id, symbol)
);

0 comments on commit d7f3d9d

Please sign in to comment.