Change bitcoin address model keys

This commit is contained in:
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(); CryptoCoinBalance balance = new CryptoCoinBalance();
balance.setBalance(0); 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()); balance.setAccountId(account.getId());
db.cryptoCoinBalanceDao().insertCryptoCoinBalance(balance); db.cryptoCoinBalanceDao().insertCryptoCoinBalance(balance);
@ -495,7 +495,7 @@ public class GeneralAccountManager implements CryptoAccountManager, CryptoNetInf
} }
private void calculateUri(CalculateBitcoinUriRequest request) { 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()); CrystalDatabase db = CrystalDatabase.getAppDatabase(request.getContext());
long index = db.bitcoinAddressDao().getLastExternalAddress(request.getAccount().getId()); long index = db.bitcoinAddressDao().getLastExternalAddress(request.getAccount().getId());
@ -530,6 +530,8 @@ public class GeneralAccountManager implements CryptoAccountManager, CryptoNetInf
uri.append(request.getAmount()); uri.append(request.getAmount());
} }
System.out.println("GeneralAccountMAnager uri calculated : " + uri.toString());
request.setUri(uri.toString()); request.setUri(uri.toString());
request.validate(); request.validate();
} }

View file

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