Skip to content

Commit

Permalink
Merge pull request #449 from KeystoneHQ/hide-txs
Browse files Browse the repository at this point in the history
feat: hide main wallet txs in passphrase wallet
  • Loading branch information
NanYeZhuYu authored May 16, 2023
2 parents 79f079a + f8aa667 commit ff2d0b3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions app/src/main/java/com/keystone/cold/DataRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public List<TxEntity> loadElectrumTxsSync(String coinId) {
}

public List<TxEntity> loadAllTxSync(String coinId) {
return mDb.txDao().loadTxsSync(coinId);
return mDb.txDao().loadTxsSync(coinId, getBelongTo());
}

public LiveData<TxEntity> loadTx(String txId) {
Expand Down Expand Up @@ -358,14 +358,14 @@ public Web3TxEntity loadETHTxSync(String txId) {
}

public List<Web3TxEntity> loadETHTxsSync() {
return mDb.ethTxDao().loadETHTxsSync();
return mDb.ethTxDao().loadETHTxsSync(getBelongTo());
}

public List<Web3TxEntity> loadETHTxs(int limit, int offset) {
return mDb.ethTxDao().loadETHTxsSync(limit, offset);
return mDb.ethTxDao().loadETHTxsSync(getBelongTo(), limit, offset);
}

public List<TxEntity> loadTxs(String coinId, int limit, int offset) {
return mDb.txDao().loadTxs(coinId, limit, offset);
return mDb.txDao().loadTxs(coinId, getBelongTo(), limit, offset);
}
}
8 changes: 4 additions & 4 deletions app/src/main/java/com/keystone/cold/db/dao/ETHTxDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

@Dao
public interface ETHTxDao {
@Query("SELECT * FROM ethtxs ORDER BY timeStamp DESC")
List<Web3TxEntity> loadETHTxsSync();
@Query("SELECT * FROM ethtxs where belongTo = :belongTo ORDER BY timeStamp DESC")
List<Web3TxEntity> loadETHTxsSync(String belongTo);

@Insert(onConflict = OnConflictStrategy.REPLACE)
void insert(Web3TxEntity tx);
Expand All @@ -41,6 +41,6 @@ public interface ETHTxDao {
@Query("DELETE FROM ethtxs WHERE belongTo = 'hidden'")
int deleteHidden();

@Query("SELECT * FROM ethtxs ORDER BY timeStamp DESC LIMIT :limit OFFSET :offset")
List<Web3TxEntity> loadETHTxsSync(int limit, int offset);
@Query("SELECT * FROM ethtxs where belongTo = :belongTo ORDER BY timeStamp DESC LIMIT :limit OFFSET :offset")
List<Web3TxEntity> loadETHTxsSync(String belongTo, int limit, int offset);
}
8 changes: 4 additions & 4 deletions app/src/main/java/com/keystone/cold/db/dao/TxDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public interface TxDao {
@Query("SELECT * FROM txs where coinId = :coinId and signId = 'electrum_sign_id' ORDER BY timeStamp DESC")
List<TxEntity> loadElectrumTxsSync(String coinId);

@Query("SELECT * FROM txs where coinId = :coinId")
List<TxEntity> loadTxsSync(String coinId);
@Query("SELECT * FROM txs where coinId = :coinId AND belongTo = :belongTo")
List<TxEntity> loadTxsSync(String coinId, String belongTo);

@Insert(onConflict = OnConflictStrategy.REPLACE)
void insert(TxEntity tx);
Expand All @@ -57,6 +57,6 @@ public interface TxDao {
@Query("DELETE FROM txs WHERE belongTo = 'hidden'")
int deleteHidden();

@Query("SELECT * FROM txs where coinId = :coinId ORDER BY timeStamp DESC LIMIT :limit OFFSET :offset")
List<TxEntity> loadTxs(String coinId, int limit, int offset);
@Query("SELECT * FROM txs where coinId = :coinId AND belongTo = :belongTo ORDER BY timeStamp DESC LIMIT :limit OFFSET :offset")
List<TxEntity> loadTxs(String coinId, String belongTo, int limit, int offset);
}

0 comments on commit ff2d0b3

Please sign in to comment.