Skip to content

Commit ed9152a

Browse files
satoshiotomakanvcoolish10gic
authored
[Dev]: Dev<->Master (#4219)
* Kotlin multiplatform leaking memory (#4037) * Add deinit for KMP iOS and JVM targets * Add deinit for JS target * Add deinit for JS target * Fix JVM native name * Reuse one thread on JVM --------- Co-authored-by: satoshiotomakan <[email protected]> * [KMP] Fix issue: memory leak found in Base58.decode in iOS (#4031) * Fix kmp issue: memory leak found in Base58.decode in iOS * Remove unused functions * Fix failed test cases * Revert "Fix failed test cases" This reverts commit 57eee39. * Revert val -> value argument name refactoring * Output better indentation * Revert changes in TWEthereumAbiFunction.h * Fix inconsistent naming --------- Co-authored-by: satoshiotomakan <[email protected]> * [TON]: Add support for TON 24-words mnemonic (#3998) * feat(ton): Add support for TON 24-words mnemonic in Rust * feat(ton): Add tw_ton_wallet FFIs * feat(ton): Add TWTONWallet FFI in C++ * feat(ton): Add tonMnemonic StoredKey type * feat(ton): Add StoredKey TON tests * feat(ton): Add TWStoredKey TON tests * feat(ton): Add TONWallet support in Swift * TODO add iOS tests * feat(ton): Add `KeyStore` iOS tests * feat(ton): Add TONWallet support in JavaScript * Add `KeyStore` TypeScript tests * feat(ton): Remove `TonMnemonic` structure, replace with a `validate_mnemonic_words` function * [CI] Trigger CI * feat(ton): Fix rustfmt * feat(ton): Fix C++ build * feat(ton): Fix C++ build * feat(ton): Fix C++ build * feat(ton): Fix C++ address analyzer * feat(ton): Fix C++ tests * feat(ton): Add Android tests * feat(ton): Bump `actions/upload-artifact` to v4 * Bump `dawidd6/action-download-artifact` to v6 * feat(eth): Fix PR comments * Fix Java JVM leak (#4092) * [Chore]: Fix Android bindings (#4095) * [Chore]: Add GenericPhantomReference.java * [Chore]: Fix unnecessary null assertion in WalletCoreLibLoader.kt * Fix memory lead found in public key in kmp binding (#4097) * Update Callisto explorer (#4131) * Revert "[TON]: Add support for TON 24-words mnemonic (#3998)" (#4148) This reverts commit 0b16771. * Fix JVM synchronization issue (#4218) * Fix Java JVM leak * clean * apply to jni * [Misc]: Upgrade Rust toolchain to `nightly-2025-01-16` * [Misc]: Fix Clippy warnings --------- Co-authored-by: Satoshi Otomakan <[email protected]> * [Misc]: Fix Clippy warnings --------- Co-authored-by: Viacheslav Kulish <[email protected]> Co-authored-by: 10gic <[email protected]>
1 parent af7c6a5 commit ed9152a

File tree

12 files changed

+15
-15
lines changed

12 files changed

+15
-15
lines changed

jni/java/wallet/core/java/GenericPhantomReference.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
import java.lang.ref.ReferenceQueue;
55
import java.util.Set;
66
import java.util.HashSet;
7+
import java.util.Collections;
78

89
public class GenericPhantomReference extends PhantomReference<Object> {
910
private final long nativeHandle;
1011
private final OnDeleteCallback onDeleteCallback;
1112

12-
private static final Set<GenericPhantomReference> references = new HashSet<>();
13+
private static final Set<GenericPhantomReference> references = Collections.synchronizedSet(new HashSet<>());
1314
private static final ReferenceQueue<Object> queue = new ReferenceQueue<>();
1415

1516
static {

kotlin/wallet-core-kotlin/src/commonAndroidJvmMain/kotlin/com/trustwallet/core/GenericPhantomReference.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.trustwallet.core
22

33
import java.lang.ref.PhantomReference
44
import java.lang.ref.ReferenceQueue
5+
import java.util.Collections
56

67
internal class GenericPhantomReference private constructor(
78
referent: Any,
@@ -10,7 +11,7 @@ internal class GenericPhantomReference private constructor(
1011
) : PhantomReference<Any>(referent, queue) {
1112

1213
companion object {
13-
private val references: MutableSet<GenericPhantomReference> = HashSet()
14+
private val references: MutableSet<GenericPhantomReference> = Collections.synchronizedSet(HashSet())
1415
private val queue: ReferenceQueue<Any> = ReferenceQueue()
1516

1617
init {

rust/chains/tw_bitcoin/src/babylon/proto_builder/output_protobuf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub trait BabylonOutputProtobuf {
2828
) -> SigningResult<TransactionOutput>;
2929
}
3030

31-
impl<'a, Context: UtxoContext> BabylonOutputProtobuf for OutputProtobuf<'a, Context> {
31+
impl<Context: UtxoContext> BabylonOutputProtobuf for OutputProtobuf<'_, Context> {
3232
fn babylon_staking(
3333
&self,
3434
staking: &Proto::mod_OutputBuilder::StakingOutput,

rust/chains/tw_bitcoin/src/babylon/proto_builder/utxo_protobuf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub trait BabylonUtxoProtobuf {
3838
) -> SigningResult<(TransactionInput, UtxoToSign)>;
3939
}
4040

41-
impl<'a, Context: UtxoContext> BabylonUtxoProtobuf for UtxoProtobuf<'a, Context> {
41+
impl<Context: UtxoContext> BabylonUtxoProtobuf for UtxoProtobuf<'_, Context> {
4242
fn babylon_staking_timelock(
4343
&self,
4444
timelock: &Proto::mod_InputBuilder::StakingTimelockPath,

rust/chains/tw_solana/src/transaction/versioned.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ impl<'de> Deserialize<'de> for MessagePrefix {
189189
{
190190
struct PrefixVisitor;
191191

192-
impl<'de> Visitor<'de> for PrefixVisitor {
192+
impl Visitor<'_> for PrefixVisitor {
193193
type Value = MessagePrefix;
194194

195195
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {

rust/frameworks/tw_ton_sdk/src/boc/binary_writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl BinaryWriter {
5454
} else {
5555
self.write_bytes(&data[..data_len - 1])?;
5656
let last_byte = data[data_len - 1];
57-
let l = last_byte | 1 << (8 - rest_bits - 1);
57+
let l = last_byte | (1 << (8 - rest_bits - 1));
5858
self.write(8, l)?;
5959
}
6060

rust/frameworks/tw_ton_sdk/src/boc/raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ fn write_raw_cell(
263263
if !full_bytes {
264264
writer.write_bytes(&data[..data_len_bytes - 1])?;
265265
let last_byte = data[data_len_bytes - 1];
266-
let l = last_byte | 1 << (8 - padding_bits - 1);
266+
let l = last_byte | (1 << (8 - padding_bits - 1));
267267
writer.write(8, l)?;
268268
} else {
269269
writer.write_bytes(data)?;

rust/tw_any_coin/src/wallet_connect_request.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ impl WalletConnectRequest {
1616
#[inline]
1717
pub fn parse(coin: CoinType, input: &[u8]) -> SigningResult<Data> {
1818
let (ctx, entry) = coin_dispatcher(coin)?;
19-
entry
20-
.wallet_connect_parse_request(&ctx, input)
21-
.map_err(SigningError::from)
19+
entry.wallet_connect_parse_request(&ctx, input)
2220
}
2321
}

rust/tw_encoding/src/hex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub trait DecodeHex {
3030
fn decode_hex(&self) -> FromHexResult<Data>;
3131
}
3232

33-
impl<'a> DecodeHex for &'a str {
33+
impl DecodeHex for &str {
3434
fn decode_hex(&self) -> FromHexResult<Data> {
3535
decode(self)
3636
}

rust/tw_evm/src/message/eip712/message_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub struct CustomTypeBuilder<'a> {
3838
type_properties: &'a mut Vec<Property>,
3939
}
4040

41-
impl<'a> CustomTypeBuilder<'a> {
41+
impl CustomTypeBuilder<'_> {
4242
pub fn add_property(&mut self, name: &str, property_type: PropertyType) -> &mut Self {
4343
self.type_properties.push(Property {
4444
name: name.to_string(),

0 commit comments

Comments
 (0)