Skip to content

Commit

Permalink
[Dev]: Dev<->Master (#4219)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Jan 17, 2025
1 parent af7c6a5 commit ed9152a
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
3 changes: 2 additions & 1 deletion jni/java/wallet/core/java/GenericPhantomReference.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
import java.lang.ref.ReferenceQueue;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;

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

private static final Set<GenericPhantomReference> references = new HashSet<>();
private static final Set<GenericPhantomReference> references = Collections.synchronizedSet(new HashSet<>());
private static final ReferenceQueue<Object> queue = new ReferenceQueue<>();

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.trustwallet.core

import java.lang.ref.PhantomReference
import java.lang.ref.ReferenceQueue
import java.util.Collections

internal class GenericPhantomReference private constructor(
referent: Any,
Expand All @@ -10,7 +11,7 @@ internal class GenericPhantomReference private constructor(
) : PhantomReference<Any>(referent, queue) {

companion object {
private val references: MutableSet<GenericPhantomReference> = HashSet()
private val references: MutableSet<GenericPhantomReference> = Collections.synchronizedSet(HashSet())
private val queue: ReferenceQueue<Any> = ReferenceQueue()

init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub trait BabylonOutputProtobuf {
) -> SigningResult<TransactionOutput>;
}

impl<'a, Context: UtxoContext> BabylonOutputProtobuf for OutputProtobuf<'a, Context> {
impl<Context: UtxoContext> BabylonOutputProtobuf for OutputProtobuf<'_, Context> {
fn babylon_staking(
&self,
staking: &Proto::mod_OutputBuilder::StakingOutput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub trait BabylonUtxoProtobuf {
) -> SigningResult<(TransactionInput, UtxoToSign)>;
}

impl<'a, Context: UtxoContext> BabylonUtxoProtobuf for UtxoProtobuf<'a, Context> {
impl<Context: UtxoContext> BabylonUtxoProtobuf for UtxoProtobuf<'_, Context> {
fn babylon_staking_timelock(
&self,
timelock: &Proto::mod_InputBuilder::StakingTimelockPath,
Expand Down
2 changes: 1 addition & 1 deletion rust/chains/tw_solana/src/transaction/versioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl<'de> Deserialize<'de> for MessagePrefix {
{
struct PrefixVisitor;

impl<'de> Visitor<'de> for PrefixVisitor {
impl Visitor<'_> for PrefixVisitor {
type Value = MessagePrefix;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion rust/frameworks/tw_ton_sdk/src/boc/binary_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl BinaryWriter {
} else {
self.write_bytes(&data[..data_len - 1])?;
let last_byte = data[data_len - 1];
let l = last_byte | 1 << (8 - rest_bits - 1);
let l = last_byte | (1 << (8 - rest_bits - 1));
self.write(8, l)?;
}

Expand Down
2 changes: 1 addition & 1 deletion rust/frameworks/tw_ton_sdk/src/boc/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ fn write_raw_cell(
if !full_bytes {
writer.write_bytes(&data[..data_len_bytes - 1])?;
let last_byte = data[data_len_bytes - 1];
let l = last_byte | 1 << (8 - padding_bits - 1);
let l = last_byte | (1 << (8 - padding_bits - 1));
writer.write(8, l)?;
} else {
writer.write_bytes(data)?;
Expand Down
4 changes: 1 addition & 3 deletions rust/tw_any_coin/src/wallet_connect_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ impl WalletConnectRequest {
#[inline]
pub fn parse(coin: CoinType, input: &[u8]) -> SigningResult<Data> {
let (ctx, entry) = coin_dispatcher(coin)?;
entry
.wallet_connect_parse_request(&ctx, input)
.map_err(SigningError::from)
entry.wallet_connect_parse_request(&ctx, input)
}
}
2 changes: 1 addition & 1 deletion rust/tw_encoding/src/hex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub trait DecodeHex {
fn decode_hex(&self) -> FromHexResult<Data>;
}

impl<'a> DecodeHex for &'a str {
impl DecodeHex for &str {
fn decode_hex(&self) -> FromHexResult<Data> {
decode(self)
}
Expand Down
2 changes: 1 addition & 1 deletion rust/tw_evm/src/message/eip712/message_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub struct CustomTypeBuilder<'a> {
type_properties: &'a mut Vec<Property>,
}

impl<'a> CustomTypeBuilder<'a> {
impl CustomTypeBuilder<'_> {
pub fn add_property(&mut self, name: &str, property_type: PropertyType) -> &mut Self {
self.type_properties.push(Property {
name: name.to_string(),
Expand Down
4 changes: 2 additions & 2 deletions rust/tw_misc/src/test_utils/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl ToJson for Json {
}
}

impl<'a> ToJson for Cow<'a, str> {
impl ToJson for Cow<'_, str> {
#[track_caller]
fn to_json(&self) -> Json {
self.as_ref().to_json()
Expand All @@ -30,7 +30,7 @@ impl ToJson for String {
}
}

impl<'a> ToJson for &'a str {
impl ToJson for &str {
#[track_caller]
fn to_json(&self) -> Json {
serde_json::from_str(self).expect("Error on deserializing JSON from string")
Expand Down
2 changes: 1 addition & 1 deletion tools/install-rust-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

NIGHTLY="nightly-2024-06-13"
NIGHTLY="nightly-2025-01-16"

rustup toolchain install $NIGHTLY
rustup default $NIGHTLY
Expand Down

0 comments on commit ed9152a

Please sign in to comment.