Change bitcoin address model keys

feat_androidx_migration
hvarona 2018-11-12 22:40:44 -04:00
parent 0126d6d114
commit 719d6769fc
2 changed files with 5 additions and 3 deletions

View File

@ -98,7 +98,7 @@ public class GeneralAccountManager implements CryptoAccountManager, CryptoNetInf
CryptoCoinBalance balance = new CryptoCoinBalance();
balance.setBalance(0);
balance.setCryptoCurrencyId(db.cryptoCurrencyDao().getByName(cryptoCoin.name(),cryptoCoin.name()).getId());
balance.setCryptoCurrencyId(db.cryptoCurrencyDao().getByName(cryptoCoin.getLabel(),cryptoCoin.name()).getId());
balance.setAccountId(account.getId());
db.cryptoCoinBalanceDao().insertCryptoCoinBalance(balance);
@ -495,7 +495,7 @@ public class GeneralAccountManager implements CryptoAccountManager, CryptoNetInf
}
private void calculateUri(CalculateBitcoinUriRequest request) {
StringBuilder uri = new StringBuilder(this.cryptoCoin.getLabel().toLowerCase()+":");
StringBuilder uri = new StringBuilder(this.cryptoCoin.name().toLowerCase()+":");
CrystalDatabase db = CrystalDatabase.getAppDatabase(request.getContext());
long index = db.bitcoinAddressDao().getLastExternalAddress(request.getAccount().getId());
@ -530,6 +530,8 @@ public class GeneralAccountManager implements CryptoAccountManager, CryptoNetInf
uri.append(request.getAmount());
}
System.out.println("GeneralAccountMAnager uri calculated : " + uri.toString());
request.setUri(uri.toString());
request.validate();
}

View File

@ -12,7 +12,7 @@ import android.support.annotation.NonNull;
*/
@Entity(
tableName="bitcoin_address",
primaryKeys = {"account_id","address_index"},
primaryKeys = {"account_id","address_index","is_change"},
foreignKeys = {
@ForeignKey(
entity = CryptoNetAccount.class,