Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: merge feature-dashdirect #1160

Merged
merged 62 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
f634197
feat(dashdirect): add login function with temporary UI (#1068)
hadia Dec 17, 2022
3672729
Merge branch 'master' into feature-dashdirect
hadia Jan 10, 2023
b614bed
feat(dashdirect): add purchase gift card UI (#1079)
hadia Jan 13, 2023
0048d2c
Merge branch 'master' into feature-dashdirect
hadia Jan 16, 2023
972e910
feat(exploredash): update login via otp (#1082)
hadia Jan 31, 2023
9a51d98
feat(dashdirect): add gift card info (purchase limits, discount) to p…
HashEngineering Jan 31, 2023
017d493
Merge branch 'master' into feature-dashdirect
hadia Feb 9, 2023
65ae20a
feat(explore-dash): add formatting tool for the explore module (#1091)
Syn-McJ Feb 27, 2023
5370c97
feat(explore-dash): add test Merchant (#1093)
hadia Mar 2, 2023
d675370
fix: retain gift card response in release builds
Syn-McJ Mar 7, 2023
ac05441
Merge pull request #1095 from dashpay/fix-giftcard-proguard
Syn-McJ Mar 8, 2023
6c37384
Merge branch 'master' into feature-dashdirect
Syn-McJ Mar 8, 2023
826c777
feat(dashdirect): add purchase gift card backend (#1094)
hadia Mar 14, 2023
1cf47fc
feat(dashdirect): add gift card icons and filtering on Home screen (#…
Syn-McJ Mar 14, 2023
16585d8
feat(dashdirect): store and open gift card details on transaction tap…
Syn-McJ Mar 17, 2023
ea50d08
feat(dashdirect): improve firebase events (#1099)
Syn-McJ Mar 18, 2023
f347b47
Fix: dashdirect UI issues (#1100)
hadia Mar 21, 2023
5ea7c04
feat(dashdirect): poll API after a purchase (#1101)
Syn-McJ Mar 27, 2023
5f914eb
feat(dashdirect): add no network indicator (#1104)
Syn-McJ Mar 29, 2023
cf547da
fix: restoring tests
Syn-McJ Mar 30, 2023
10539f7
chore: apply ktlint
Syn-McJ Mar 30, 2023
21c0528
fix: restoring CrowdNode tests
Syn-McJ Mar 30, 2023
292ecb9
Merge pull request #1105 from dashpay/fix-restore-tests
Syn-McJ Mar 31, 2023
e2a4672
Merge branch 'master' into feature-dashdirect
Apr 3, 2023
c5b5a94
chore: merge master into dashdirect
Syn-McJ Apr 5, 2023
f7f3979
Merge pull request #1107 from dashpay/dashdirect-master-merge
HashEngineering Apr 6, 2023
7c9f39e
fix(dash-direct): various UI fixes (#1110)
hadia Apr 18, 2023
4be3a3f
chore: transition to staging
Syn-McJ Apr 29, 2023
6c0357d
feat: using staging database
Syn-McJ May 4, 2023
63d3f09
fix: error messaging
Syn-McJ May 9, 2023
89ff588
fix: empty atm type && crash on atm click
Syn-McJ May 9, 2023
9efb293
Merge branch 'master' into feature-dashdirect-icon-url
Syn-McJ May 10, 2023
f9fa2db
feat: add originalUrl to IconBitmap table
Syn-McJ May 10, 2023
559442a
Merge branch 'feature-dashdirect-icon-url' into feature-dashdirect-st…
Syn-McJ May 10, 2023
06b753f
Merge branch 'master' into feature-dashdirect-staging
Syn-McJ May 18, 2023
5a4156f
fix: ignore null giftcard
Syn-McJ May 18, 2023
fea8123
fix: empty gift card fixes
Syn-McJ May 18, 2023
2b5f90a
chore: simplify giftcard table
Syn-McJ May 20, 2023
3cdd543
fix: recording USD rate in metadata for gift card transactions
Syn-McJ May 20, 2023
01d8992
chore: move gift card data updates to transactionMetadataProvider
Syn-McJ May 21, 2023
473c5f1
chore: changing GiftCard price to double
Syn-McJ May 22, 2023
2e142bd
fix: vertical barcode (measuredWidth returns 0)
Syn-McJ May 24, 2023
6c9bd50
Merge branch 'master' into feature-dashdirect-staging
Syn-McJ Jun 7, 2023
d66e120
fix: ktlint
Syn-McJ Jun 7, 2023
9bc9360
Merge pull request #1129 from dashpay/feature-dashdirect-staging
Syn-McJ Jun 8, 2023
97ddaf3
chore: remove merge artifact from build.gradle
Syn-McJ Jun 8, 2023
0c02312
fix: increase initial delay and add retries for PaymentStatus
Syn-McJ Jun 8, 2023
c97518a
fix: tests
Syn-McJ Jun 8, 2023
d2a5e16
fix: improve messaging around IO errors
Syn-McJ Jun 9, 2023
7033a24
fix: use testnet DB for the dashdirect builds
Syn-McJ Jun 13, 2023
e5b01b1
fix: prepackage testnet DB for production builds
Syn-McJ Jun 14, 2023
0ceedf0
Merge pull request #1131 from dashpay/feature-dashdirect-delay
Syn-McJ Jun 17, 2023
90d15ea
Merge branch 'master' into feature-dashdirect
Syn-McJ Jun 17, 2023
401b785
feat(dashdirect):add Ionia terms and conditions dialog (#1137)
Syn-McJ Jun 18, 2023
a7c6783
fix: explore db name
Syn-McJ Jun 19, 2023
80808e7
Merge branch 'master' into feature-dashdirect
Syn-McJ Jun 21, 2023
3bd4633
Merge branch 'master' into feature-dashdirect
Syn-McJ Jul 6, 2023
6606d97
Merge branch 'master' into feature-dashdirect
Syn-McJ Jul 11, 2023
23aed3e
chore: disable gift cards (#1157)
Syn-McJ Jul 17, 2023
ff36da6
chore: ignoring gift card strings
Syn-McJ Jul 17, 2023
6e93edd
chore: rollback explore db name
Syn-McJ Jul 17, 2023
da18b94
fix: remove gift cards from filter dialog
Syn-McJ Jul 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
File renamed without changes.
5 changes: 3 additions & 2 deletions exploredata.rb → .deploy/exploredata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@
bucket = storage.bucket bucket_name, skip_lookup: true
file = bucket.file file_name
timestamp = file.updated_at.strftime("%Q")
target_file_path = "#{assets_path}#{file_name}"
target_file_name = "explore/explore.db"
target_file_path = "#{assets_path}#{target_file_name}"

# create output file
# out_file = File.new(target_file_path, "w")
# out_file.close

file.download target_file_path

puts "Downloaded #{file.name} to #{target_file_path}"
puts "Downloaded #{file.name} to #{target_file_path}"
4 changes: 2 additions & 2 deletions .github/workflows/dashwallet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
ruby-version: '3.0.3'

- name: Generate cache key
run: bash ./checksum.sh checksum.txt
run: bash .deploy/checksum.sh checksum.txt

- name: Gem caching
uses: actions/cache@v2
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
run: |
gem install google-cloud-storage
rm -rf wallet/assets/explore/*
ruby ./exploredata.rb "${{ github.event.inputs.flavor }}"
ruby .deploy/exploredata.rb "${{ github.event.inputs.flavor }}"

- name: Test
run: bundle exec fastlane test flavor:"" type:"debug"
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/ktlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Code format check

on:
pull_request:
branches: [ master, feature-*, bugfix-*, dashpay-* ]

jobs:
check:
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3
- name: set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Extract Secrets
run: |
echo "$GOOGLE_SERVICES_JSON" > wallet/google-services.json
echo "$LOCAL_PROPERTIES" > local.properties
env:
GOOGLE_SERVICES_JSON : ${{secrets.GOOGLE_SERVICES_JSON}}
LOCAL_PROPERTIES: ${{secrets.LOCAL_PROPERTIES}}

- name: Ktlint
run: ./gradlew ktlintCheck
6 changes: 3 additions & 3 deletions .github/workflows/manual_distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
ruby-version: '3.0.3'

- name: Generate cache key
run: bash ./checksum.sh checksum.txt
run: bash .deploy/checksum.sh checksum.txt

- name: Gem caching
uses: actions/cache@v2
Expand Down Expand Up @@ -123,10 +123,10 @@ jobs:
run: |
gem install google-cloud-storage
rm -rf wallet/assets/explore/*
ruby ./exploredata.rb "${{ github.event.inputs.flavor }}"
ruby .deploy/exploredata.rb "${{ github.event.inputs.flavor }}"

- name: Test
run: bundle exec fastlane test flavor:"${{ github.event.inputs.flavor }}" type:"${{ github.event.inputs.type }}" version_code:"${{ env.build_number }}" store_pass:"${{ secrets.SIGNING_STORE_PASS }}"

- name: Build and Firebase Distribution
run: bundle exec fastlane build_distribute flavor:"${{ github.event.inputs.flavor }}" type:"${{ github.event.inputs.type }}" version_code:"${{ env.build_number }}" store_pass:"${{ secrets.SIGNING_STORE_PASS }}" comment:"${{ github.event.inputs.taskID }}" app_id:"${{ env.firebase_app_id }}" test_group:"qa"
run: bundle exec fastlane build_distribute flavor:"${{ github.event.inputs.flavor }}" type:"${{ github.event.inputs.type }}" version_code:"${{ env.build_number }}" store_pass:"${{ secrets.SIGNING_STORE_PASS }}" comment:"${{ github.event.inputs.taskID }}" app_id:"${{ env.firebase_app_id }}" test_group:"qa"
12 changes: 9 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
ext {
kotlin_version = '1.8.22'
coroutines_version = '1.6.1'
coroutinesVersion = '1.6.4'
ok_http_version = '4.9.1'
dashjVersion = '19.0.3'
hiltVersion = '2.45'
Expand All @@ -13,9 +13,13 @@ buildscript {
appCompatVersion = '1.4.2'

// Architecture
lifecycleVersion = '2.3.1'
navigationVersion = '2.5.2'
lifecycleVersion = '2.5.1'
navigationVersion = '2.5.3'
datastoreVersion = "1.0.0"
hiltVersion = '2.45'
hiltWorkVersion = '1.0.0'
serializationVersion = '1.0.1'
preferenceVersion = '1.2.0'

// Utils
slf4jVersion = '1.7.32'
Expand All @@ -27,9 +31,11 @@ buildscript {
constrainLayoutVersion = '2.1.4'
recyclerViewVersion = "1.2.1"
glideVersion = '4.12.0'
zxingVersion = '3.3.3' // Don't update. 3.3.3 is the maximum to support Android 6.x

// Tests
junitVersion = '4.13.2'
testCoreVersion = '1.5.0'
mockitoVersion = '4.0.0'
espressoVersion = '3.4.0'
coilVersion = '1.4.0'
Expand Down
5 changes: 3 additions & 2 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation "org.dashj:dashj-core:$dashjVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"

// Firebase
implementation platform("com.google.firebase:firebase-bom:$firebaseVersion")
Expand All @@ -74,6 +74,7 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion"
implementation "androidx.datastore:datastore-preferences:1.0.0"
implementation "androidx.room:room-ktx:$roomVersion"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion"

// UI
implementation "com.github.bumptech.glide:glide:$glideVersion"
Expand All @@ -83,7 +84,7 @@ dependencies {
implementation "androidx.browser:browser:$browserVersion"
implementation "androidx.constraintlayout:constraintlayout:$constrainLayoutVersion"
//noinspection GradleDependency
implementation 'com.google.zxing:core:3.3.3' // Don't update. 3.3.3 is the maximum to support Android 6.x
implementation "com.google.zxing:core:$zxingVersion"

// DI
implementation "com.google.dagger:hilt-android:$hiltVersion"
Expand Down
56 changes: 1 addition & 55 deletions common/src/main/java/org/dash/wallet/common/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public class Configuration {
private final SharedPreferences prefs;
private final Resources res;

public static final String PREFS_KEY_SEND_COINS_AUTOCLOSE = "send_coins_autoclose";
public static final String PREFS_KEY_CONNECTIVITY_NOTIFICATION = "connectivity_notification";
public static final String PREFS_KEY_EXCHANGE_CURRENCY = "exchange_currency";
public static final String PREFS_KEY_EXCHANGE_CURRENCY_DETECTED = "exchange_currency_detected";
Expand All @@ -59,7 +58,6 @@ public class Configuration {
public static final String PREFS_KEY_BLOCK_EXPLORER = "block_explorer";
public static final String PREFS_KEY_REMIND_BALANCE = "remind_balance";
public static final String PREFS_KEY_REMIND_BALANCE_TIME = "remind_balance_time";
private static final String PREFS_KEY_LABS_QR_PAYMENT_REQUEST = "labs_qr_payment_request";
private static final String PREFS_KEY_PREVIOUS_VERSION = "previous_version";
public static final String PREFS_KEY_AUTO_LOGOUT_ENABLED = "auto_logout_enabled";
public static final String PREFS_KEY_AUTO_LOGOUT_MINUTES = "auto_logout_minutes";
Expand Down Expand Up @@ -94,20 +92,13 @@ public class Configuration {
public static final String PREFS_KEY_COINBASE_AUTH_INFO_SHOWN = "coinbase_auth_info_shown";
public static final String PREFS_KEY_COINBASE_USER_WITHDRAWAL_LIMIT = "withdrawal_limit";
public static final String PREFS_KEY_COINBASE_SEND_LIMIT_CURRENCY = "send_limit_currency";



private static final int PREFS_DEFAULT_BTC_SHIFT = 0;
public static final int PREFS_DEFAULT_BTC_PRECISION = 8;
public static final String PREFS_KEY_IS_DASH_TO_FIAT_DIRECTION = "is_dash_to_fiat_direction";
public static final String PREFS_KEY_SHOW_NOTIFICATIONS_EXPLAINER = "show_notifications_explainer";
public static final String PREFS_KEY_SHOW_TAX_CATEGORY_EXPLAINER = "show_tax_catagory_explainer";
public static final String PREFS_KEY_SHOW_TAX_CATEGORY_INSTALLTIME = "show_tax_catagory_install_time";

// Explore Dash
public static final String PREFS_KEY_HAS_INFO_SCREEN_BEEN_SHOWN_ALREADY = "has_info_screen_been_shown";
public static final String PREFS_KEY_HAS_LOCATION_DIALOG_BEEN_SHOWN = "has_location_dialog_been_shown";

// CrowdNode
public static final String PREFS_KEY_CROWDNODE_ACCOUNT_ADDRESS = "crowdnode_account_address";
public static final String PREFS_KEY_CROWDNODE_PRIMARY_ADDRESS = "crowdnode_primary_address";
Expand Down Expand Up @@ -157,20 +148,6 @@ public MonetaryFormat getFormat() {
decimalRepetitions);
}

public MonetaryFormat getMaxPrecisionFormat() {
final int shift = getBtcShift();
if (shift == 0)
return new MonetaryFormat().shift(0).minDecimals(2).optionalDecimals(2, 2, 2);
else if (shift == 3)
return new MonetaryFormat().shift(3).minDecimals(2).optionalDecimals(2, 1);
else
return new MonetaryFormat().shift(6).minDecimals(0).optionalDecimals(2);
}

public boolean getSendCoinsAutoclose() {
return prefs.getBoolean(PREFS_KEY_SEND_COINS_AUTOCLOSE, true);
}

public boolean getConnectivityNotificationEnabled() {
return prefs.getBoolean(PREFS_KEY_CONNECTIVITY_NOTIFICATION, false);
}
Expand Down Expand Up @@ -261,10 +238,6 @@ public long getLastRestoreTime() {
return prefs.getLong(PREFS_KEY_LAST_RESTORE, 0);
}

public void updateLastRestoreTime() {
prefs.edit().putLong(PREFS_KEY_LAST_RESTORE, System.currentTimeMillis()).apply();
}

public boolean lastBackupSeedReminderMoreThan24hAgo() {
long lastReminder = prefs.getLong(PREFS_KEY_LAST_BACKUP_SEED_TIME, 0);
if (lastReminder > 0) {
Expand Down Expand Up @@ -316,10 +289,6 @@ public boolean wasUpgraded() {
return prefs.getInt(PREFS_KEY_PREVIOUS_VERSION, 0) != 0;
}

public boolean getQrPaymentRequestEnabled() {
return prefs.getBoolean(PREFS_KEY_LABS_QR_PAYMENT_REQUEST, false);
}

public boolean versionCodeCrossed(final int currentVersionCode, final int triggeringVersionCode) {
final boolean wasBelow = lastVersionCode < triggeringVersionCode;
final boolean wasUsedBefore = lastVersionCode > 0;
Expand All @@ -340,10 +309,6 @@ else if (currentVersionCode < lastVersionCode)
log.warn("detected app downgrade: " + lastVersionCode + " -> " + currentVersionCode);
}

public boolean hasBeenUsed() {
return prefs.contains(PREFS_KEY_LAST_USED);
}

public long getLastUsedAgo() {
final long now = System.currentTimeMillis();

Expand Down Expand Up @@ -504,27 +469,8 @@ public void setTaxCategoryInstallTime(long time) {
prefs.edit().putLong(PREFS_KEY_SHOW_TAX_CATEGORY_INSTALLTIME, time).apply();
}

// Explore Dash

public boolean hasExploreDashInfoScreenBeenShown() {
return prefs.getBoolean(PREFS_KEY_HAS_INFO_SCREEN_BEEN_SHOWN_ALREADY, false);
}

public void setHasExploreDashInfoScreenBeenShown(boolean isShown){
prefs.edit().putBoolean(PREFS_KEY_HAS_INFO_SCREEN_BEEN_SHOWN_ALREADY, isShown).apply();
}

public boolean hasExploreDashLocationDialogBeenShown() {
return prefs.getBoolean(PREFS_KEY_HAS_LOCATION_DIALOG_BEEN_SHOWN, false);
}

public void setHasExploreDashLocationDialogBeenShown(boolean isShown) {
prefs.edit().putBoolean(PREFS_KEY_HAS_LOCATION_DIALOG_BEEN_SHOWN, isShown).apply();
}

// Coinbase
// TODO: put new preferences in the CoinbaseConfig and migrate these.

public void setLastCoinBaseAccessToken(String token) {
prefs.edit().putString(PREFS_KEY_LAST_COINBASE_ACCESS_TOKEN, token).apply();
}
Expand Down Expand Up @@ -571,7 +517,7 @@ public void setCoinbaseSendLimitCurrency(String currency){
}

public String getCoinbaseSendLimitCurrency() {
return prefs.getString(PREFS_KEY_COINBASE_SEND_LIMIT_CURRENCY, GenericUtils.getLocaleCurrencyCode());
return prefs.getString(PREFS_KEY_COINBASE_SEND_LIMIT_CURRENCY, GenericUtils.INSTANCE.getLocaleCurrencyCode());
}

// CrowdNode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import org.bitcoinj.wallet.Wallet
import org.bitcoinj.wallet.WalletExtension
import org.bitcoinj.wallet.authentication.AuthenticationKeyUsage
import org.dash.wallet.common.services.LeftoverBalanceException
import org.dash.wallet.common.transactions.filters.TransactionFilter
import org.dash.wallet.common.transactions.TransactionWrapper
import org.dash.wallet.common.transactions.filters.TransactionFilter
import kotlin.jvm.Throws

interface WalletDataProvider {
Expand All @@ -52,6 +52,8 @@ interface WalletDataProvider {

fun observeAuthenticationKeyUsage(): Flow<List<AuthenticationKeyUsage>>

fun getTransaction(hash: Sha256Hash): Transaction?

fun getTransactions(vararg filters: TransactionFilter): Collection<Transaction>

fun wrapAllTransactions(vararg wrappers: TransactionWrapper): Collection<TransactionWrapper>
Expand Down
Loading
Loading