Skip to content

Commit

Permalink
Merge remote-tracking branch 'github/push-ypsuoxkxvqvz'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexagon committed Jan 8, 2024
2 parents b1578df + d4716e5 commit 08068f6
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 20 deletions.
31 changes: 17 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,35 @@ members = [
anyhow = "1.0"
async-trait = "0.1"
base64 = "0.13"
chacha20poly1305 = "0.10.0-pre.1"
curve25519-dalek-ng = "4.1.1"
chacha20poly1305 = { version = "0.10.1", optional = true }
curve25519-dalek-ng = { version = "4.1.1", optional = true }
downcast-rs = "1.2"
dyn-clone = "1.0"
erased-serde = { version = "0.3.23", optional = true }
futures-util = "0.3"
getrandom = "0.2.4"
getrandom = { version = "0.2.4", optional = true }
hex = "0.4"
hmac = "0.11.0"
hmac = { version = "0.11.0", optional = true }
log = "0.4"
lru = "0.8.0"
num-bigint = "0.4"
once_cell = "1.12.0"
parking_lot = "0.12.0"
pbkdf2 = "0.9.0"
pbkdf2 = { version = "0.9.0", optional = true }
quick_cache = "0.3.0"
rand = { version = "0.8", features = ["getrandom"] }
secstr = { version = "0.5.0", features = ["serde"] }
rand = { version = "0.8", features = ["getrandom"] , optional = true }
secstr = { version = "0.5.0", features = ["serde"], optional = true }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sha2 = "0.9.9"
sha2 = { version = "0.9.9", optional = true }
thiserror = "1.0"
tiny-jsonrpc = { version = "0.6.0", default-features = false, optional = true }
tokio = { version = "1", default-features = false, features = ["sync"] }
zeroize = "1"
zeroize = { version = "1", optional = true }

ed25519-dalek = { git = "https://github.com/broxus/ed25519-dalek.git" }
tiny-bip39 = { git = "https://github.com/broxus/tiny-bip39.git", default-features = false }
tiny-hderive = { git = "https://github.com/broxus/tiny-hderive.git" }
ed25519-dalek = { git = "https://github.com/broxus/ed25519-dalek.git", optional = true }
tiny-bip39 = { git = "https://github.com/broxus/tiny-bip39.git", default-features = false, optional = true }
tiny-hderive = { git = "https://github.com/broxus/tiny-hderive.git", optional = true }

ton_abi = { git = "https://github.com/broxus/ton-labs-abi" }
ton_block = { git = "https://github.com/broxus/ton-labs-block.git" }
Expand All @@ -62,7 +62,7 @@ ton_types = { git = "https://github.com/broxus/ton-labs-types.git" }

nekoton-contracts = { path = "nekoton-contracts" }
nekoton-abi = { path = "nekoton-abi", features = ["derive"] }
nekoton-utils = { path = "nekoton-utils", features = ["encryption"] }
nekoton-utils = { path = "nekoton-utils" }
nekoton-proto = { path = "nekoton-proto", optional = true }

[dev-dependencies]
Expand All @@ -71,20 +71,23 @@ cargo-husky = { version = "1", features = ["default", "run-cargo-fmt", "run-carg
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }

[features]
default = ["gql_transport"]
default = ["gql_transport", "wallet_core"]
integration_test = []
web = [
"nekoton-contracts/web",
"nekoton-abi/web",
"nekoton-utils/web",
"getrandom/wasm-bindgen",
"ton_abi/web",
"wallet_core"
]
gql_transport = ["dep:erased-serde"]
jrpc_transport = ["dep:tiny-jsonrpc"]
proto_transport = ["dep:nekoton-proto"]
extended_models = []
non_threadsafe = []
wallet_core = ["dep:pbkdf2", "dep:chacha20poly1305", "dep:zeroize", "dep:secstr", "dep:hmac", "dep:ed25519-dalek",
"dep:tiny-bip39", "dep:tiny-hderive", "dep:sha2", "dep:getrandom", "dep:rand", "dep:curve25519-dalek-ng", "nekoton-utils/encryption"]

[package.metadata.docs.rs]
all-features = true
2 changes: 1 addition & 1 deletion nekoton-abi/src/tvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ pub fn call_msg(
.map_err(|_| ExecutionError::FailedToRetrieveActions)?;

let mut msgs = Vec::new();
for (_, action) in actions.iter_mut().enumerate() {
for action in actions.iter_mut() {
if let OutAction::SendMsg { out_msg, .. } = std::mem::replace(action, OutAction::None) {
msgs.push(out_msg);
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub mod contract_subscription;
pub mod dens;
pub mod generic_contract;
pub mod keystore;
pub mod models;
pub use super::models;
pub mod nft_wallet;
pub mod owners_cache;
pub mod parsing;
Expand Down
2 changes: 1 addition & 1 deletion src/core/transactions_tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl TransactionsTreeStream {
}

pub fn peek(&self) -> Option<&Message> {
self.messages.get(0)
self.messages.front()
}

async fn step(&mut self, mut message: Message) -> TransactionTreeResult<Transaction> {
Expand Down
1 change: 1 addition & 0 deletions src/core/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use nekoton_abi::{GenTimings, LastTransactionId, TransactionId};
use nekoton_utils::*;

use crate::core::models::*;
#[cfg(feature = "wallet_core")]
use crate::crypto::{SignedMessage, UnsignedMessage};
use crate::transport::models::RawTransaction;
use crate::transport::Transport;
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@
rust_2018_idioms
)]

#[cfg(feature = "wallet_core")]
pub mod core;
#[cfg(feature = "wallet_core")]
pub mod crypto;
#[cfg(feature = "wallet_core")]
pub mod external;
pub mod models;
pub mod transport;

pub use nekoton_abi as abi;
Expand Down
1 change: 1 addition & 0 deletions src/core/models.rs → src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,7 @@ pub enum MessageBodyError {
FailedToDeserialize,
}

#[cfg(feature = "wallet_core")]
#[derive(thiserror::Error, Debug)]
pub(super) enum AccountSubscriptionError {
#[error("Invalid message destination")]
Expand Down
2 changes: 1 addition & 1 deletion src/transport/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use nekoton_utils::Clock;
use serde::{Deserialize, Serialize};
use ton_block::MsgAddressInt;

use crate::core::models::{NetworkCapabilities, ReliableBehavior};
use crate::models::{NetworkCapabilities, ReliableBehavior};

use self::models::*;

Expand Down
3 changes: 1 addition & 2 deletions src/transport/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ use serde::{Deserialize, Serialize};
use ton_block::{Account, AccountStuff, Transaction};
use ton_types::UInt256;

use crate::models::{ContractState, PendingTransaction};
use nekoton_abi::{ExecutionContext, GenTimings, LastTransactionId};
use nekoton_utils::{serde_account_stuff, Clock};

use crate::core::models::{ContractState, PendingTransaction};

#[allow(clippy::large_enum_variant)]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", tag = "type")]
Expand Down

0 comments on commit 08068f6

Please sign in to comment.