Skip to content

Commit

Permalink
Merge pull request #1 from elliotsayes/PE-4727-meta-mask-login-migration
Browse files Browse the repository at this point in the history
Pe 4727 meta mask login migration
  • Loading branch information
elliotsayes authored Oct 13, 2023
2 parents 60a47a2 + 2c506d4 commit 79b54ac
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/blocs/profile/profile_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class ProfileCubit extends Cubit<ProfileState> {
}();

final profileSource = ProfileSource(
type: ProfileSourceType.values[profile.details.profileSourceType ?? 0],
type: ProfileSourceType.values[profile.details.profileSourceType],
address: profile.details.profileSourceAddress,
);

Expand Down
2 changes: 1 addition & 1 deletion lib/models/tables/profiles.drift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ CREATE TABLE profiles (
profileType INTEGER NOT NULL,

-- Added in schema v18
profileSourceType INTEGER,
profileSourceType INTEGER NOT NULL DEFAULT 0,
profileSourceAddress TEXT
);
4 changes: 2 additions & 2 deletions lib/user/repositories/user_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class _UserRepository implements UserRepository {
final user = User(
profileType: ProfileType.values[profileDetails.details.profileType],
profileSource: ProfileSource(
type: ProfileSourceType
.values[profileDetails.details.profileSourceType ?? 0],
type:
ProfileSourceType.values[profileDetails.details.profileSourceType],
address: profileDetails.details.walletPublicKey,
),
wallet: profileDetails.wallet,
Expand Down
4 changes: 4 additions & 0 deletions test/user/repositories/user_repository_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ void main() {
encryptedWallet: Uint8List.fromList([]),
keySalt: Uint8List.fromList([]),
profileType: 0, //json
profileSourceType: 0, //standalone
username: '',
walletPublicKey: '',
id: 'id',
Expand All @@ -61,6 +62,7 @@ void main() {
encryptedWallet: Uint8List.fromList([]),
keySalt: Uint8List.fromList([]),
profileType: 0, //json
profileSourceType: 0, //standalone
username: '',
walletPublicKey: '',
id: 'id',
Expand Down Expand Up @@ -113,6 +115,7 @@ void main() {
encryptedWallet: Uint8List.fromList([]),
keySalt: Uint8List.fromList([]),
profileType: 0, //json
profileSourceType: 0, //standalone
username: '',
walletPublicKey: '',
id: 'id',
Expand Down Expand Up @@ -176,6 +179,7 @@ void main() {
encryptedWallet: Uint8List.fromList([]),
keySalt: Uint8List.fromList([]),
profileType: 0, //json
profileSourceType: 0, //standalone
username: '',
walletPublicKey: '',
id: 'id',
Expand Down

0 comments on commit 79b54ac

Please sign in to comment.