Skip to content

Commit

Permalink
Merge branch 'master' into feat/send-token
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/espressocash_app/lib/l10n/intl_en.arb
  • Loading branch information
Merculiar committed Jan 14, 2025
2 parents a2854eb + 3ce2f4f commit 2e12e80
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/check_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ jobs:
melos exec -c 1 ${{ env.SCOPE }} -- make deps_graph_all
melos exec -c 1 ${{ env.SCOPE }} -- make deps_graph_features
- name: Install SQLite dependencies
run: sudo apt-get update && sudo apt-get install -y sqlite3 libsqlite3-dev

- name: Test
run: melos exec -c 1 ${{ env.SCOPE }} --dir-exists="test" -- make flutter_test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ class KycRepository extends ChangeNotifier {
return await _initWrapper(
() => _getUserData(includeValues: includeValues),
);
} on Exception {
} on Exception catch (exception) {
reportError(exception);

return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ sealed class KycException with _$KycException implements Exception {
const factory KycException.invalidData() = KycInvalidData;
const factory KycException.invalidToken() = KycInvalidToken;
const factory KycException.genericError() = KycGenericError;
const factory KycException.phoneTooManyAttempts() = KycPhoneTooManyAttempts;
}

extension ErrorExt on Exception {
Expand All @@ -29,6 +30,8 @@ extension ErrorExt on Exception {
'invalid phone' => const KycException.invalidPhone(),
'invalid code' => const KycException.invalidCode(),
'invalid data' => const KycException.invalidData(),
'too many verification attempts' =>
const KycException.phoneTooManyAttempts(),
_ => const KycException.genericError(),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ extension KycBuildContext on BuildContext {

final message = switch (error) {
KycInvalidEmail() => context.l10n.invalidEmail,
_ => context.l10n.failedToSendVerificationCode,
KycInvalidCode() ||
KycInvalidData() ||
KycInvalidToken() ||
KycInvalidPhone() ||
KycPhoneTooManyAttempts() ||
KycGenericError() =>
context.l10n.failedToSendVerificationCode,
};

showCpErrorSnackbar(context, message: message);
Expand All @@ -50,7 +56,13 @@ extension KycBuildContext on BuildContext {

final message = switch (error) {
KycInvalidPhone() => context.l10n.invalidPhone,
_ => context.l10n.failedToSendVerificationCode,
KycPhoneTooManyAttempts() => context.l10n.phoneTooManyAttempts,
KycInvalidCode() ||
KycInvalidEmail() ||
KycInvalidData() ||
KycInvalidToken() ||
KycGenericError() =>
context.l10n.failedToSendVerificationCode,
};

showCpErrorSnackbar(context, message: message);
Expand Down
4 changes: 3 additions & 1 deletion packages/espressocash_app/lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1205,9 +1205,11 @@
"pendingKycDialogTitle": "We’re still verifying your *identity.*",
"@pendingKycDialogTitle": {},
"pendingKycDialogMessage": "Your identity verification is currently under review and will be completed shortly. You can check the Activity page for real-time updates on your verification status.",
"@pendingKycDialogMessage": {},
"@pendingKycDialogMessage": {},
"continueVerification": "Continue Verification",
"@continueVerification": {},
"phoneTooManyAttempts": "Too many verification attempts. Please try again later",
"@phoneTooManyAttempts": {},
"about": "About",
"@about": {},
"coin": "Coin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ extension SolanaClientTokenProgram on SolanaClient {
String? memo,
SignatureCallback? onSigned,
Commitment commitment = Commitment.finalized,
TokenProgramType tokenProgram = TokenProgramType.tokenProgram,
}) async {
final associatedRecipientAccount = await getAssociatedTokenAccount(
owner: destination,
Expand Down Expand Up @@ -162,6 +163,7 @@ extension SolanaClientTokenProgram on SolanaClient {
Ed25519HDPublicKey.fromBase58(associatedRecipientAccount.pubkey),
owner: owner.publicKey,
amount: amount,
tokenProgram: tokenProgram,
);

final message = Message(
Expand Down

0 comments on commit 2e12e80

Please sign in to comment.