Skip to content

Commit

Permalink
fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
anatolse committed Jun 11, 2024
1 parent b5fccf0 commit 7957542
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 104 deletions.
66 changes: 33 additions & 33 deletions android/jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ extern "C" {

JNIEXPORT jboolean JNICALL BEAM_JAVA_WALLET_INTERFACE(isAddress)(JNIEnv *env, jobject thiz, jstring address)
{
LOG_DEBUG() << "isAddress()";
BEAM_LOG_DEBUG() << "isAddress()";

return beam::wallet::CheckReceiverAddress(JString(env, address).value());
}

JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(selectCoins)(JNIEnv *env, jobject thiz, jlong amount, jlong fee, jboolean isShielded, jint assetId)
{
LOG_DEBUG() << "selectCoins()";
BEAM_LOG_DEBUG() << "selectCoins()";

Amount bAmount = Amount(amount);
Amount bFee = Amount(fee);
Expand All @@ -129,7 +129,7 @@ extern "C" {

JNIEXPORT jboolean JNICALL BEAM_JAVA_WALLET_INTERFACE(isToken)(JNIEnv *env, jobject thiz, jstring token)
{
LOG_DEBUG() << "isToken()";
BEAM_LOG_DEBUG() << "isToken()";

auto params = beam::wallet::ParseParameters(JString(env, token).value());
return params && params->GetParameter<beam::wallet::TxType>(beam::wallet::TxParameterID::TransactionType);
Expand All @@ -138,7 +138,7 @@ JNIEXPORT jboolean JNICALL BEAM_JAVA_WALLET_INTERFACE(isToken)(JNIEnv *env, jobj

JNIEXPORT jobject JNICALL BEAM_JAVA_WALLET_INTERFACE(getTransactionParameters)(JNIEnv *env, jobject thiz, jstring token, jboolean requestInfo)
{
LOG_DEBUG() << "getTransactionParameters()";
BEAM_LOG_DEBUG() << "getTransactionParameters()";

auto address = JString(env, token).value();
auto params = beam::wallet::ParseParameters(address);
Expand All @@ -162,13 +162,13 @@ JNIEXPORT jobject JNICALL BEAM_JAVA_WALLET_INTERFACE(getTransactionParameters)(J

if(amount)
{
LOG_DEBUG() << "amount(" << *amount << ")";
BEAM_LOG_DEBUG() << "amount(" << *amount << ")";

setLongField(env, TransactionParametersClass, jParameters, "amount", *amount);
}
else
{
LOG_DEBUG() << "amount not found";
BEAM_LOG_DEBUG() << "amount not found";

setLongField(env, TransactionParametersClass, jParameters, "amount", 0L);
}
Expand Down Expand Up @@ -275,7 +275,7 @@ JNIEXPORT jobject JNICALL BEAM_JAVA_WALLET_INTERFACE(getTransactionParameters)(J
{
auto trusted = walletModel->isConnectionTrusted();

LOG_DEBUG() << "isConnectionTrusted() " << trusted;
BEAM_LOG_DEBUG() << "isConnectionTrusted() " << trusted;

return trusted;
}
Expand All @@ -292,7 +292,7 @@ JNIEXPORT jobject JNICALL BEAM_JAVA_WALLET_INTERFACE(getTransactionParameters)(J

JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(generateOfflineAddress)(JNIEnv *env, jobject thiz, jlong amount, jint assetId)
{
LOG_DEBUG() << "generateOfflineAddress()";
BEAM_LOG_DEBUG() << "generateOfflineAddress()";

uint64_t bAmount = amount;
uint32_t bAsset = assetId;
Expand All @@ -308,7 +308,7 @@ JNIEXPORT jobject JNICALL BEAM_JAVA_WALLET_INTERFACE(getTransactionParameters)(J

JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(generateRegularAddress)(JNIEnv *env, jobject thiz, jlong amount, jint assetId)
{
LOG_DEBUG() << "generateRegularAddress()";
BEAM_LOG_DEBUG() << "generateRegularAddress()";

uint64_t bAmount = amount;
uint32_t bAsset = assetId;
Expand All @@ -325,7 +325,7 @@ JNIEXPORT jobject JNICALL BEAM_JAVA_WALLET_INTERFACE(getTransactionParameters)(J

JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(generateMaxPrivacyAddress)(JNIEnv *env, jobject thiz, jlong amount, jint assetId)
{
LOG_DEBUG() << "generateMaxPrivacyAddress()";
BEAM_LOG_DEBUG() << "generateMaxPrivacyAddress()";

uint64_t bAmount = amount;
uint32_t bAsset = assetId;
Expand All @@ -346,7 +346,7 @@ JNIEXPORT jobject JNICALL BEAM_JAVA_API_INTERFACE(createWallet)(JNIEnv *env, job

initLogger(appData, JString(env, appVersion).value());

LOG_DEBUG() << "creating wallet...";
BEAM_LOG_DEBUG() << "creating wallet...";

auto pass = JString(env, passStr).value();

Expand Down Expand Up @@ -382,7 +382,7 @@ JNIEXPORT jobject JNICALL BEAM_JAVA_API_INTERFACE(createWallet)(JNIEnv *env, job

if(walletDB)
{
LOG_DEBUG() << "wallet successfully created.";
BEAM_LOG_DEBUG() << "wallet successfully created.";

passwordHash.V = SecString(pass).hash().V;
// generate default address
Expand Down Expand Up @@ -431,14 +431,14 @@ JNIEXPORT jobject JNICALL BEAM_JAVA_API_INTERFACE(createWallet)(JNIEnv *env, job
JNIEXPORT jboolean JNICALL BEAM_JAVA_API_INTERFACE(isWalletInitialized)(JNIEnv *env, jobject thiz,
jstring appData)
{
LOG_DEBUG() << "checking if wallet exists...";
BEAM_LOG_DEBUG() << "checking if wallet exists...";

return WalletDB::isInitialized(JString(env, appData).value() + "/" WALLET_FILENAME) ? JNI_TRUE : JNI_FALSE;
}

JNIEXPORT void JNICALL BEAM_JAVA_API_INTERFACE(closeWallet)(JNIEnv *env, jobject thiz)
{
LOG_DEBUG() << "close wallet if it exists";
BEAM_LOG_DEBUG() << "close wallet if it exists";

if (nodeModel)
{
Expand All @@ -463,7 +463,7 @@ JNIEXPORT jobject JNICALL BEAM_JAVA_API_INTERFACE(openWallet)(JNIEnv *env, jobje

initLogger(appData, JString(env, appVersion).value());

LOG_DEBUG() << "opening wallet...";
BEAM_LOG_DEBUG() << "opening wallet...";

string pass = JString(env, passStr).value();

Expand All @@ -474,7 +474,7 @@ JNIEXPORT jobject JNICALL BEAM_JAVA_API_INTERFACE(openWallet)(JNIEnv *env, jobje

if(walletDB)
{
LOG_DEBUG() << "wallet successfully opened.";
BEAM_LOG_DEBUG() << "wallet successfully opened.";

passwordHash.V = SecString(pass).hash().V;

Expand Down Expand Up @@ -569,27 +569,27 @@ JNIEXPORT jboolean JNICALL BEAM_JAVA_API_INTERFACE(checkReceiverAddress)(JNIEnv

JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(getWalletStatus)(JNIEnv *env, jobject thiz)
{
LOG_DEBUG() << "getWalletStatus()";
BEAM_LOG_DEBUG() << "getWalletStatus()";

walletModel->getAsync()->getWalletStatus();
}

JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(getTransactions)(JNIEnv *env, jobject thiz)
{
LOG_DEBUG() << "getTransactions()";
BEAM_LOG_DEBUG() << "getTransactions()";

walletModel->getAsync()->getTransactions();
}

JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(getAllUtxosStatus)(JNIEnv *env, jobject thiz)
{
LOG_DEBUG() << "getAllUtxosStatus()";
BEAM_LOG_DEBUG() << "getAllUtxosStatus()";
walletModel->getAsync()->getAllUtxosStatus();
}

JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(syncWithNode)(JNIEnv *env, jobject thiz)
{
LOG_DEBUG() << "syncWithNode()";
BEAM_LOG_DEBUG() << "syncWithNode()";

walletModel->getAsync()->syncWithNode();
}
Expand All @@ -606,8 +606,8 @@ void CopyParameter(beam::wallet::TxParameterID paramID, const beam::wallet::TxPa
JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(sendTransaction)(JNIEnv *env, jobject thiz,
jstring receiverAddr, jstring comment, jlong amount, jlong fee, jint assetId, jboolean isOffline)
{
LOG_DEBUG() << "sendTransaction(" << JString(env, receiverAddr).value() << ", " << JString(env, comment).value() << ", " << amount << ", " << fee << ")";
LOG_DEBUG() << "asset id" << assetId;
BEAM_LOG_DEBUG() << "sendTransaction(" << JString(env, receiverAddr).value() << ", " << JString(env, comment).value() << ", " << amount << ", " << fee << ")";
BEAM_LOG_DEBUG() << "asset id" << assetId;

auto address = JString(env, receiverAddr).value();
auto txParameters = beam::wallet::ParseParameters(address);
Expand Down Expand Up @@ -660,7 +660,7 @@ JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(sendTransaction)(JNIEnv *env,
JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(calcChange)(JNIEnv *env, jobject thiz,
jlong amount, jint assetId)
{
LOG_DEBUG() << "calcChange(" << amount << ")";
BEAM_LOG_DEBUG() << "calcChange(" << amount << ")";
uint32_t asset = assetId;

walletModel->getAsync()->calcChange(Amount(amount), 0, beam::Asset::ID(asset));
Expand All @@ -669,30 +669,30 @@ JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(calcChange)(JNIEnv *env, jobje
JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(getAddresses)(JNIEnv *env, jobject thiz,
jboolean own)
{
LOG_DEBUG() << "getAddresses(" << own << ")";
BEAM_LOG_DEBUG() << "getAddresses(" << own << ")";

walletModel->getAsync()->getAddresses(own);
}

JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(generateNewAddress)(JNIEnv *env, jobject thiz)
{
LOG_DEBUG() << "generateNewAddress()";
BEAM_LOG_DEBUG() << "generateNewAddress()";

walletModel->getAsync()->generateNewAddress();
}

JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(saveAddress)(JNIEnv *env, jobject thiz,
jobject walletAddrObj, jboolean own)
{
LOG_DEBUG() << "saveAddress()";
BEAM_LOG_DEBUG() << "saveAddress()";

WalletID bbsAddr(Zero);
if (bbsAddr.FromHex(getStringField(env, WalletAddressClass, walletAddrObj, "walletID")))
{
auto address = walletDB->getAddress(bbsAddr);
if (address)
{
LOG_DEBUG() << "address found in database";
BEAM_LOG_DEBUG() << "address found in database";

address->m_label = getStringField(env, WalletAddressClass, walletAddrObj, "label");
address->m_category = getStringField(env, WalletAddressClass, walletAddrObj, "category");
Expand All @@ -701,7 +701,7 @@ JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(saveAddress)(JNIEnv *env, jobj
walletDB->saveAddress(*address);
}
else {
LOG_DEBUG() << "address not found in database";
BEAM_LOG_DEBUG() << "address not found in database";

WalletAddress addr;
addr.m_BbsAddr.FromHex(getStringField(env, WalletAddressClass, walletAddrObj, "walletID"));
Expand Down Expand Up @@ -749,7 +749,7 @@ JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(importRecovery)(JNIEnv *env, j
{
auto path = JString(env, jpath).value();

LOG_DEBUG() << "importRecovery path = " << path;
BEAM_LOG_DEBUG() << "importRecovery path = " << path;

walletModel->getAsync()->importRecovery(path);
}
Expand Down Expand Up @@ -819,7 +819,7 @@ JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(saveAddressChanges)(JNIEnv *en
JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(cancelTx)(JNIEnv *env, jobject thiz,
jstring txId)
{
LOG_DEBUG() << "cancelTx()";
BEAM_LOG_DEBUG() << "cancelTx()";

auto buffer = from_hex(JString(env, txId).value());
TxID id;
Expand All @@ -832,7 +832,7 @@ JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(cancelTx)(JNIEnv *env, jobject
JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(deleteTx)(JNIEnv *env, jobject thiz,
jstring txId)
{
LOG_DEBUG() << "deleteTx()";
BEAM_LOG_DEBUG() << "deleteTx()";

auto buffer = from_hex(JString(env, txId).value());
TxID id;
Expand Down Expand Up @@ -1097,7 +1097,7 @@ JNIEXPORT jboolean JNICALL BEAM_JAVA_WALLET_INTERFACE(isSynced)(JNIEnv *env, job
{
auto isSynced = walletModel->isSynced();

LOG_DEBUG() << "isSynced() " << isSynced;
BEAM_LOG_DEBUG() << "isSynced() " << isSynced;

return isSynced;
}
Expand Down Expand Up @@ -1152,7 +1152,7 @@ JNIEXPORT void JNICALL BEAM_JAVA_WALLET_INTERFACE(launchApp)(JNIEnv *env, jobjec
}
catch (...)
{
LOG_DEBUG() << "launchApp error ";
BEAM_LOG_DEBUG() << "launchApp error ";
}
}

Expand Down
4 changes: 2 additions & 2 deletions android/node_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ bool NodeModel::isNodeRunning() const

void NodeModel::onInitProgressUpdated(uint64_t done, uint64_t total)
{
LOG_DEBUG() << "onInitProgressUpdated(" << done << ", " << total << ")";
BEAM_LOG_DEBUG() << "onInitProgressUpdated(" << done << ", " << total << ")";
}

void NodeModel::onSyncProgressUpdated(int done, int total)
{
LOG_DEBUG() << "onNodeSyncProgressUpdated(" << done << ", " << total << ")";
BEAM_LOG_DEBUG() << "onNodeSyncProgressUpdated(" << done << ", " << total << ")";

JNIEnv* env = Android_JNI_getEnv();

Expand Down
Loading

0 comments on commit 7957542

Please sign in to comment.