Skip to content

Commit

Permalink
build: Release 0.28.0 #1234
Browse files Browse the repository at this point in the history
  • Loading branch information
igordanilcenko authored Oct 15, 2024
2 parents 1fb5b71 + 052d41d commit 3a5f6ad
Show file tree
Hide file tree
Showing 159 changed files with 3,014 additions and 2,748 deletions.
10 changes: 10 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ android {
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

buildFeatures {
viewBinding true
aidl true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ class DeepLinkTest {
fun assertBaseNodeName() {
val deeplink =
"tari://${currentNetwork.uriComponent}/${DeepLink.AddBaseNode.COMMAND_ADD_NODE}?${DeepLink.AddBaseNode.KEY_NAME}=base_node_test"
val result = deeplinkHandler.handle(deeplink) as? DeepLink.AddBaseNode
val result = deeplinkHandler.parseDeepLink(deeplink) as? DeepLink.AddBaseNode
assertEquals(result!!.name, "base_node_test")
}

@Test
fun assertBaseNodePeer() {
val deeplink = "tari://${currentNetwork.uriComponent}/${DeepLink.AddBaseNode.COMMAND_ADD_NODE}?${DeepLink.AddBaseNode.KEY_PEER}=$PEER"
val result = deeplinkHandler.handle(deeplink) as? DeepLink.AddBaseNode
val result = deeplinkHandler.parseDeepLink(deeplink) as? DeepLink.AddBaseNode
assertEquals(result!!.peer, PEER)
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
</activity>

<activity
android:name=".ui.fragment.qr.QRScannerActivity"
android:name=".ui.fragment.qr.QrScannerActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:exported="false"
android:theme="@style/AppTheme.Light"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,9 @@ package com.tari.android.wallet.service;

// import model classes
import com.tari.android.wallet.model.Model;
import com.tari.android.wallet.service.TariWalletServiceListener;

interface TariWalletService {

/**
* Registers new wallet listener.
* Registered listener will be unregistered on death.
*/
boolean registerListener(TariWalletServiceListener listener);

/**
* Unregisters wallet listener.
*/
boolean unregisterListener(TariWalletServiceListener listener);

String getWalletAddressBase58(out WalletError error);

BalanceInfo getBalanceInfo(out WalletError error);

MicroTari estimateTxFee(in MicroTari amount, out WalletError error, in MicroTari feePerGram);
Expand All @@ -71,17 +57,6 @@ interface TariWalletService {

boolean cancelPendingTx(in TxId id, out WalletError error);

/**
* Sets the base node peer that the wallet syncs with.
*/
boolean addBaseNodePeer(
in String baseNodePublicKey,
in String baseNodeAddress,
out WalletError error
);

boolean startBaseNodeSync(out WalletError error);

TxId sendTari(
in TariContact contact,
in MicroTari amount,
Expand All @@ -96,9 +71,6 @@ interface TariWalletService {

boolean removeContact(in TariWalletAddress address, out WalletError error);

TariWalletAddress getWalletAddressFromEmojiId(in String emojiId, out WalletError error);
TariWalletAddress getWalletAddressFromBase58(in String base58, out WalletError error);

/**
* Key-value storage functions.
*/
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions app/src/main/cpp/jniCommsConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Java_com_tari_android_wallet_ffi_FFICommsConfig_jniCreate(
pDatastorePath,
static_cast<unsigned long long int>(jDiscoveryTimeoutSec),
static_cast<unsigned long long int>(jSafDurationSec),
false,
errorPointer
);
jEnv->ReleaseStringUTFChars(jPublicAddress, pControlServiceAddress);
Expand Down
20 changes: 19 additions & 1 deletion app/src/main/cpp/jniSeedWords.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@ Java_com_tari_android_wallet_ffi_FFISeedWords_jniCreate(
SetPointerField(jEnv, jThis, reinterpret_cast<jlong>(pSeedWords));
}

extern "C"
JNIEXPORT void JNICALL
Java_com_tari_android_wallet_ffi_FFISeedWords_jniFromBase58(
JNIEnv *jEnv,
jobject jThis,
jstring jCypher,
jstring jPassphrase,
jobject error) {
ExecuteWithError(jEnv, error, [&](int *errorPointer) {
const char *pCypher = jEnv->GetStringUTFChars(jCypher, JNI_FALSE);
const char *pPassphrase = jEnv->GetStringUTFChars(jPassphrase, JNI_FALSE);
TariSeedWords *pSeedWords = seed_words_create_from_cipher(pCypher, pPassphrase, errorPointer);
jEnv->ReleaseStringUTFChars(jCypher, pCypher);
jEnv->ReleaseStringUTFChars(jPassphrase, pPassphrase);
SetPointerField(jEnv, jThis, reinterpret_cast<jlong>(pSeedWords));
});
}

extern "C"
JNIEXPORT void JNICALL
Java_com_tari_android_wallet_ffi_FFISeedWords_jniGetMnemonicWordListForLanguage(
Expand All @@ -72,7 +90,7 @@ Java_com_tari_android_wallet_ffi_FFISeedWords_jniPushWord(
return ExecuteWithError<jint>(jEnv, error, [&](int *errorPointer) {
auto pSeedWords = GetPointerField<TariSeedWords *>(jEnv, jThis);
const char *pWord = jEnv->GetStringUTFChars(jWord, JNI_FALSE);
jint result = seed_words_push_word(pSeedWords, pWord, errorPointer);
jint result = seed_words_push_word(pSeedWords, pWord, nullptr, errorPointer);
jEnv->ReleaseStringUTFChars(jWord, pWord);
return result;
});
Expand Down
43 changes: 23 additions & 20 deletions app/src/main/cpp/jniWallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jmethodID balanceUpdatedCallbackMethodId;
jmethodID walletScannedHeightCallbackMethodId;
jmethodID baseNodeStatusCallbackMethodId;

void txBroadcastCallback(TariCompletedTransaction *pCompletedTransaction) {
void txBroadcastCallback(void *context, TariCompletedTransaction *pCompletedTransaction) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -111,7 +111,7 @@ void txBroadcastCallback(TariCompletedTransaction *pCompletedTransaction) {
g_vm->DetachCurrentThread();
}

void txMinedCallback(TariCompletedTransaction *pCompletedTransaction) {
void txMinedCallback(void *context, TariCompletedTransaction *pCompletedTransaction) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -121,7 +121,7 @@ void txMinedCallback(TariCompletedTransaction *pCompletedTransaction) {
g_vm->DetachCurrentThread();
}

void txMinedUnconfirmedCallback(TariCompletedTransaction *pCompletedTransaction, uint64_t confirmationCount) {
void txMinedUnconfirmedCallback(void *context, TariCompletedTransaction *pCompletedTransaction, uint64_t confirmationCount) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -132,7 +132,7 @@ void txMinedUnconfirmedCallback(TariCompletedTransaction *pCompletedTransaction,
g_vm->DetachCurrentThread();
}

void txFauxConfirmedCallback(TariCompletedTransaction *pCompletedTransaction) {
void txFauxConfirmedCallback(void *context, TariCompletedTransaction *pCompletedTransaction) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -142,7 +142,7 @@ void txFauxConfirmedCallback(TariCompletedTransaction *pCompletedTransaction) {
g_vm->DetachCurrentThread();
}

void txFauxUnconfirmedCallback(TariCompletedTransaction *pCompletedTransaction, uint64_t confirmationCount) {
void txFauxUnconfirmedCallback(void *context, TariCompletedTransaction *pCompletedTransaction, uint64_t confirmationCount) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -153,7 +153,7 @@ void txFauxUnconfirmedCallback(TariCompletedTransaction *pCompletedTransaction,
g_vm->DetachCurrentThread();
}

void txReceivedCallback(TariPendingInboundTransaction *pPendingInboundTransaction) {
void txReceivedCallback(void *context, TariPendingInboundTransaction *pPendingInboundTransaction) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -163,7 +163,7 @@ void txReceivedCallback(TariPendingInboundTransaction *pPendingInboundTransactio
g_vm->DetachCurrentThread();
}

void txReplyReceivedCallback(TariCompletedTransaction *pCompletedTransaction) {
void txReplyReceivedCallback(void *context, TariCompletedTransaction *pCompletedTransaction) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -173,7 +173,7 @@ void txReplyReceivedCallback(TariCompletedTransaction *pCompletedTransaction) {
g_vm->DetachCurrentThread();
}

void txFinalizedCallback(TariCompletedTransaction *pCompletedTransaction) {
void txFinalizedCallback(void *context, TariCompletedTransaction *pCompletedTransaction) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -183,7 +183,7 @@ void txFinalizedCallback(TariCompletedTransaction *pCompletedTransaction) {
g_vm->DetachCurrentThread();
}

void txDirectSendResultCallback(unsigned long long txId, TariTransactionSendStatus *status) {
void txDirectSendResultCallback(void *context, unsigned long long txId, TariTransactionSendStatus *status) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -194,7 +194,7 @@ void txDirectSendResultCallback(unsigned long long txId, TariTransactionSendStat
}

void
txCancellationCallback(TariCompletedTransaction *pCompletedTransaction, uint64_t rejectionReason) {
txCancellationCallback(void *context, TariCompletedTransaction *pCompletedTransaction, uint64_t rejectionReason) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -205,7 +205,7 @@ txCancellationCallback(TariCompletedTransaction *pCompletedTransaction, uint64_t
g_vm->DetachCurrentThread();
}

void txoValidationCompleteCallback(uint64_t requestId, uint64_t status) {
void txoValidationCompleteCallback(void *context, uint64_t requestId, uint64_t status) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -216,7 +216,7 @@ void txoValidationCompleteCallback(uint64_t requestId, uint64_t status) {
g_vm->DetachCurrentThread();
}

void contactsLivenessDataUpdatedCallback(TariContactsLivenessData *pTariContactsLivenessData) {
void contactsLivenessDataUpdatedCallback(void *context, TariContactsLivenessData *pTariContactsLivenessData) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -226,7 +226,7 @@ void contactsLivenessDataUpdatedCallback(TariContactsLivenessData *pTariContacts
g_vm->DetachCurrentThread();
}

void transactionValidationCompleteCallback(uint64_t requestId, uint64_t status) {
void transactionValidationCompleteCallback(void *context, uint64_t requestId, uint64_t status) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -237,7 +237,7 @@ void transactionValidationCompleteCallback(uint64_t requestId, uint64_t status)
g_vm->DetachCurrentThread();
}

void connectivityStatusCallback(uint64_t status) {
void connectivityStatusCallback(void *context, uint64_t status) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -247,7 +247,7 @@ void connectivityStatusCallback(uint64_t status) {
g_vm->DetachCurrentThread();
}

void walletScannedHeightCallback(uint64_t height) {
void walletScannedHeightCallback(void *context, uint64_t height) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -257,7 +257,7 @@ void walletScannedHeightCallback(uint64_t height) {
g_vm->DetachCurrentThread();
}

void balanceUpdatedCallback(TariBalance *pBalance) {
void balanceUpdatedCallback(void *context, TariBalance *pBalance) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -267,11 +267,11 @@ void balanceUpdatedCallback(TariBalance *pBalance) {
g_vm->DetachCurrentThread();
}

void storeAndForwardMessagesReceivedCallback() {
void storeAndForwardMessagesReceivedCallback(void *context) {
// no-op
}

void baseNodeStatusCallback(TariBaseNodeState *pBaseNodeState) {
void baseNodeStatusCallback(void *context, TariBaseNodeState *pBaseNodeState) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand All @@ -281,7 +281,7 @@ void baseNodeStatusCallback(TariBaseNodeState *pBaseNodeState) {
g_vm->DetachCurrentThread();
}

void recoveringProcessCompleteCallback(uint8_t first, uint64_t second, uint64_t third) {
void recoveringProcessCompleteCallback(void *context, uint8_t first, uint64_t second, uint64_t third) {
auto *jniEnv = getJNIEnv();
if (jniEnv == nullptr || callbackHandler == nullptr) {
return;
Expand Down Expand Up @@ -480,15 +480,18 @@ Java_com_tari_android_wallet_ffi_FFIWallet_jniCreate(
}

TariWallet *pWallet = wallet_create(
nullptr,
pWalletConfig,
pLogPath,
logVerbosity,
static_cast<unsigned int>(maxNumberOfRollingLogFiles),
static_cast<unsigned int>(rollingLogFileMaxSizeBytes),
pPassphrase,
nullptr,
pSeedWords,
pNetwork,
pDnsPeer,
nullptr,
isDnsSecureOn,
txReceivedCallback,
txReplyReceivedCallback,
Expand Down Expand Up @@ -580,7 +583,7 @@ Java_com_tari_android_wallet_ffi_FFIWallet_jniGetWalletAddress(
jobject error) {
return ExecuteWithErrorAndCast<TariWalletAddress *>(jEnv, error, [&](int *errorPointer) {
auto pWallet = GetPointerField<TariWallet *>(jEnv, jThis);
return wallet_get_tari_address(pWallet, errorPointer);
return wallet_get_tari_interactive_address(pWallet, errorPointer);
});
}

Expand Down
Loading

0 comments on commit 3a5f6ad

Please sign in to comment.