From a0d9fc1a1cc7326398fdc267ef56881c7c456c72 Mon Sep 17 00:00:00 2001 From: sergeyyar Date: Mon, 14 Nov 2022 12:25:28 +0300 Subject: [PATCH 01/21] add sign command --- src/decode.rs | 6 +- src/getconfig.rs | 3 +- src/main.rs | 183 ++++++++++++++++++++++++++++++----------------- 3 files changed, 121 insertions(+), 71 deletions(-) diff --git a/src/decode.rs b/src/decode.rs index 0828b476..87c4f52c 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -504,7 +504,7 @@ pub mod msg_printer { pub async fn serialize_state_init (state: &StateInit, ton: TonClient) -> Result { let code = tree_of_cells_into_base64(state.code.as_ref())?; Ok(json!({ - "split_depth" : state.split_depth.as_ref().map(|x| format!("{:?}", (x.0 as u8))).unwrap_or("None".to_string()), + "split_depth" : state.split_depth.as_ref().map(|x| format!("{:?}", (x.as_u32()))).unwrap_or("None".to_string()), "special" : state.special.as_ref().map(|x| format!("{:?}", x)).unwrap_or("None".to_string()), "data" : tree_of_cells_into_base64(state.data.as_ref())?, "code" : code.clone(), @@ -526,7 +526,7 @@ pub mod msg_printer { } fn serialize_grams(grams: &Grams) -> Value { - json!(grams.0.to_string()) + json!(grams.to_string()) } fn serialize_currency_collection(cc: &CurrencyCollection) -> Value { @@ -536,7 +536,7 @@ pub mod msg_printer { } let mut other = json!({}); cc.other.iterate_with_keys(|key: u32, value| { - other[key.to_string()] = json!(value.0.to_string()); + other[key.to_string()] = json!(value.to_string()); Ok(true) }).ok(); json!({ diff --git a/src/getconfig.rs b/src/getconfig.rs index 5e559792..f356c3bf 100644 --- a/src/getconfig.rs +++ b/src/getconfig.rs @@ -424,7 +424,8 @@ fn prepare_message_new_config_param( let config_contract_address = MsgAddressInt::with_standart(None, -1, config_account).unwrap(); let mut header = ExternalInboundMessageHeader::new(AddrNone, config_contract_address); header.import_fee = Grams::zero(); - let message = Message::with_ext_in_header_and_body(header, cell.into()); + let body = SliceData::from(cell.into_cell().unwrap()); + let message = Message::with_ext_in_header_and_body(header, body); Ok(message) } diff --git a/src/main.rs b/src/main.rs index 7fc761db..513fbadd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,7 +58,7 @@ use helpers::{load_ton_address, load_abi, create_client_local, query_raw, use genaddr::generate_address; use getconfig::{query_global_config, dump_blockchain_config}; use multisig::{create_multisig_command, multisig_command}; -use std::{env}; +use std::env; use std::collections::BTreeMap; use std::process::exit; use voting::{create_proposal, decode_proposal, vote}; @@ -98,7 +98,7 @@ async fn main() -> Result<(), i32> { } async fn main_internal() -> Result <(), String> { - let version_string = env!("CARGO_PKG_VERSION").to_string(); + let version_string = env!("CARGO_PKG_VERSION"); let abi_arg = Arg::with_name("ABI") .long("--abi") @@ -110,6 +110,11 @@ async fn main_internal() -> Result <(), String> { .takes_value(true) .help("Seed phrase or path to the file with keypair used to sign the message. Can be specified in the config file."); + let sign_arg = Arg::with_name("SIGN") + .long("--sign") + .takes_value(true) + .help("Seed phrase or path to the file with keypair used to sign the message. Can be specified in the config."); + let method_opt_arg = Arg::with_name("METHOD") .takes_value(true) .long("--method") @@ -125,10 +130,12 @@ async fn main_internal() -> Result <(), String> { .help("Function arguments. Must be a list of `--name value` pairs or a json string with all arguments.") .multiple(true); + let author = "EVERLabs"; + let callx_cmd = SubCommand::with_name("callx") .about("Sends an external message with encoded function call to the contract (alternative syntax).") - .version(&*version_string) - .author("TONLabs") + .version(version_string) + .author(author) .setting(AppSettings::AllowLeadingHyphen) .setting(AppSettings::TrailingVarArg) .setting(AppSettings::DontCollapseArgsInUsage) @@ -155,8 +162,8 @@ async fn main_internal() -> Result <(), String> { let deployx_cmd = SubCommand::with_name("deployx") .about("Deploys a smart contract to the blockchain (alternative syntax).") - .version(&*version_string) - .author("TONLabs") + .version(version_string) + .author(author) .setting(AppSettings::AllowLeadingHyphen) .setting(AppSettings::TrailingVarArg) .setting(AppSettings::DontCollapseArgsInUsage) @@ -194,8 +201,8 @@ async fn main_internal() -> Result <(), String> { let runx_cmd = SubCommand::with_name("runx") .about("Runs contract function locally (alternative syntax).") - .version(&*version_string) - .author("TONLabs") + .version(version_string) + .author(author) .setting(AppSettings::AllowLeadingHyphen) .setting(AppSettings::TrailingVarArg) .setting(AppSettings::DontCollapseArgsInUsage) @@ -231,7 +238,8 @@ async fn main_internal() -> Result <(), String> { let genphrase_cmd = SubCommand::with_name("genphrase") .about("Generates a seed phrase for keypair.") - .author("TONLabs") + .version(version_string) + .author(author) .arg(Arg::with_name("DUMP_KEYPAIR") .long("--dump") .takes_value(true) @@ -239,7 +247,8 @@ async fn main_internal() -> Result <(), String> { let genpubkey_cmd = SubCommand::with_name("genpubkey") .about("Generates a public key from the seed phrase.") - .author("TONLabs") + .version(version_string) + .author(author) .arg(Arg::with_name("PHRASE") .takes_value(true) .required(true) @@ -247,7 +256,8 @@ async fn main_internal() -> Result <(), String> { let getkeypair_cmd = SubCommand::with_name("getkeypair") .about("Generates a keypair from the seed phrase or private key and saves it to the file.") - .author("TONLabs") + .version(version_string) + .author(author) .arg(Arg::with_name("KEY_FILE") .takes_value(true) .long("--output") @@ -262,8 +272,8 @@ async fn main_internal() -> Result <(), String> { let genaddr_cmd = SubCommand::with_name("genaddr") .setting(AppSettings::AllowNegativeNumbers) .about("Calculates smart contract address in different formats. By default, input tvc file isn't modified.") - .version(&*version_string) - .author("TONLabs") + .version(version_string) + .author(author) .arg(tvc_arg.clone()) .arg(abi_arg.clone()) .arg(wc_arg.clone()) @@ -285,17 +295,12 @@ async fn main_internal() -> Result <(), String> { .long("--save") .help("If this flag is specified, modifies the tvc file with the keypair and initial data")); - let sign_arg = Arg::with_name("SIGN") - .long("--sign") - .takes_value(true) - .help("Seed phrase or path to the file with keypair used to sign the message. Can be specified in the config."); - let deploy_cmd = SubCommand::with_name("deploy") .setting(AppSettings::AllowNegativeNumbers) .setting(AppSettings::AllowLeadingHyphen) .about("Deploys a smart contract to the blockchain.") - .version(&*version_string) - .author("TONLabs") + .version(version_string) + .author(author) .arg(tvc_arg.clone()) .arg(Arg::with_name("PARAMS") .required(true) @@ -303,6 +308,7 @@ async fn main_internal() -> Result <(), String> { .help("Constructor arguments. Can be specified with a filename, which contains json data.")) .arg(abi_arg.clone()) .arg(sign_arg.clone()) + .arg(keys_arg.clone()) .arg(wc_arg.clone()); let output_arg = Arg::with_name("OUTPUT") @@ -335,18 +341,19 @@ async fn main_internal() -> Result <(), String> { let call_cmd = SubCommand::with_name("call") .setting(AppSettings::AllowLeadingHyphen) .about("Sends an external message with encoded function call to the contract.") - .version(&*version_string) - .author("TONLabs") + .version(version_string) + .author(author) .arg(address_arg.clone()) .arg(method_arg.clone()) .arg(params_arg.clone()) .arg(abi_arg.clone()) + .arg(keys_arg.clone()) .arg(sign_arg.clone()); let send_cmd = SubCommand::with_name("send") .about("Sends a prepared message to the contract.") - .version(&*version_string) - .author("TONLabs") + .version(version_string) + .author(author) .arg(Arg::with_name("MESSAGE") .required(true) .takes_value(true) @@ -356,11 +363,13 @@ async fn main_internal() -> Result <(), String> { let message_cmd = SubCommand::with_name("message") .setting(AppSettings::AllowLeadingHyphen) .about("Generates a signed message with encoded function call.") - .author("TONLabs") + .version(version_string) + .author(author) .arg(address_arg.clone()) .arg(method_arg.clone()) .arg(params_arg.clone()) .arg(abi_arg.clone()) + .arg(keys_arg.clone()) .arg(sign_arg.clone()) .arg(Arg::with_name("LIFETIME") .long("--lifetime") @@ -376,17 +385,29 @@ async fn main_internal() -> Result <(), String> { let body_cmd = SubCommand::with_name("body") .setting(AppSettings::AllowLeadingHyphen) .about("Generates a payload for internal function call.") - .version(&*version_string) - .author("TONLabs") + .version(version_string) + .author(author) .arg(method_arg.clone()) .arg(params_arg.clone()) .arg(abi_arg.clone()); + let sign_cmd = SubCommand::with_name("sign") + .about("Generates the ED25519 signature for bytestring.") + .version(version_string) + .author(author) + .arg(Arg::with_name("DATA") + .long("--data") + .short("-d") + .takes_value(true) + .help("Bytestring for signing.") + ) + .arg(keys_arg.clone()); + let run_cmd = SubCommand::with_name("run") .setting(AppSettings::AllowLeadingHyphen) .about("Runs contract function locally.") - .version(&*version_string) - .author("TONLabs") + .version(version_string) + .author(author) .arg(address_boc_tvc_arg.clone() .required(true)) .arg(method_arg.clone()) @@ -405,9 +426,7 @@ async fn main_internal() -> Result <(), String> { .arg(Arg::with_name("ABI") .long("--abi") .help("Path or link to the contract ABI file or pure json ABI data.")) - .arg(Arg::with_name("KEYS") - .long("--keys") - .help("Path to the file with keypair.")) + .arg(keys_arg.clone()) .arg(Arg::with_name("ADDR") .long("--addr") .help("Contract address.")) @@ -482,14 +501,11 @@ async fn main_internal() -> Result <(), String> { .long("--addr") .takes_value(true) .help("Contract address.")) + .arg(keys_arg.clone()) .arg(Arg::with_name("ABI") .long("--abi") .takes_value(true) - .help("Path or link to the contract ABI file or pure json ABI data.")) - .arg(Arg::with_name("KEYS") - .long("--keys") - .takes_value(true) - .help("Seed phrase or path to the file with keypair used to sign the message."))) + .help("Path or link to the contract ABI file or pure json ABI data."))) .subcommand(SubCommand::with_name("remove") .about("Remove alias from the aliases map.") .arg(alias_arg.clone())) @@ -522,8 +538,8 @@ async fn main_internal() -> Result <(), String> { let config_cmd = SubCommand::with_name("config") .setting(AppSettings::AllowLeadingHyphen) .about("Allows to tune certain default values for options in the config file.") - .version(&*version_string) - .author("TONLabs") + .version(version_string) + .author(author) .arg(Arg::with_name("GLOBAL") .long("--global") .short("-g") @@ -536,10 +552,7 @@ async fn main_internal() -> Result <(), String> { .long("--abi") .takes_value(true) .help("Path or link to the contract ABI file or pure json ABI data.")) - .arg(Arg::with_name("KEYS") - .long("--keys") - .takes_value(true) - .help("Path to the file with keypair.")) + .arg(keys_arg.clone()) .arg(Arg::with_name("ADDR") .long("--addr") .takes_value(true) @@ -631,8 +644,8 @@ async fn main_internal() -> Result <(), String> { let account_cmd = SubCommand::with_name("account") .setting(AppSettings::AllowLeadingHyphen) .about("Obtains and prints account information.") - .version(&*version_string) - .author("TONLabs") + .version(version_string) + .author(author) .arg(boc_flag.clone()) .arg(Arg::with_name("ADDRESS") .takes_value(true) @@ -655,8 +668,8 @@ async fn main_internal() -> Result <(), String> { let account_wait_cmd = SubCommand::with_name("account-wait") .setting(AppSettings::AllowLeadingHyphen) .about("Waits for account change (based on last_trans_lt).") - .version(&*version_string) - .author("TONLabs") + .version(version_string) + .author(author) .arg(address_arg.clone()) .arg(Arg::with_name("TIMEOUT") .long("--timeout") @@ -665,8 +678,8 @@ async fn main_internal() -> Result <(), String> { let query_raw = SubCommand::with_name("query-raw") .about("Executes a raw GraphQL query.") - .version(&*version_string) - .author("TONLabs") + .version(version_string) + .author(author) .arg(Arg::with_name("COLLECTION") .required(true) .takes_value(true) @@ -693,8 +706,8 @@ async fn main_internal() -> Result <(), String> { .subcommand(SubCommand::with_name("storage") .setting(AppSettings::AllowLeadingHyphen) .about("Gets account storage fee for specified period in nanotons.") - .version(&*version_string) - .author("TONLabs") + .version(version_string) + .author(author) .arg(address_arg.clone()) .arg(Arg::with_name("PERIOD") .long("--period") @@ -720,10 +733,7 @@ async fn main_internal() -> Result <(), String> { .required(true) .takes_value(true) .help("Proposal description (max symbols 382).")) - .arg(Arg::with_name("KEYS") - .required(true) - .takes_value(true) - .help("Seed phrase or path to the keypair file.")) + .arg(keys_arg.clone()) .arg(Arg::with_name("OFFLINE") .short("-f") .long("--offline") @@ -741,10 +751,7 @@ async fn main_internal() -> Result <(), String> { .required(true) .takes_value(true) .help("Proposal transaction id.")) - .arg(Arg::with_name("KEYS") - .required(true) - .takes_value(true) - .help("Seed phrase or path to the keypair file.")) + .arg(keys_arg.clone()) .arg(Arg::with_name("OFFLINE") .short("-f") .long("--offline") @@ -783,8 +790,8 @@ async fn main_internal() -> Result <(), String> { let bcconfig_cmd = SubCommand::with_name("dump") .about("Commands to dump network entities.") - .version(&*version_string) - .author("TONLabs") + .version(version_string) + .author(author) .subcommand(SubCommand::with_name("config") .about("Dumps the blockchain config for the last key block.") .arg(Arg::with_name("PATH") @@ -873,7 +880,7 @@ async fn main_internal() -> Result <(), String> { env!("BUILD_GIT_BRANCH")); let matches = App::new("tonos_cli") .version(&*version) - .author("TONLabs") + .author(author) .about("TONLabs console tool for TON") .arg(Arg::with_name("NETWORK") .help("Network to connect.") @@ -901,6 +908,7 @@ async fn main_internal() -> Result <(), String> { .subcommand(send_cmd) .subcommand(message_cmd) .subcommand(body_cmd) + .subcommand(sign_cmd) .subcommand(run_cmd) .subcommand(runget_cmd) .subcommand(config_cmd) @@ -1001,6 +1009,9 @@ async fn command_parser(matches: &ArgMatches<'_>, is_json: bool) -> Result <(), if let Some(m) = matches.subcommand_matches("body") { return body_command(m, config).await; } + if let Some(m) = matches.subcommand_matches("sign") { + return sign_command(m, config).await; + } if let Some(m) = matches.subcommand_matches("message") { return call_command(m, config, CallType::Msg).await; } @@ -1195,6 +1206,43 @@ async fn body_command(matches: &ArgMatches<'_>, config: &Config) -> Result<(), S Ok(()) } +async fn sign_command(matches: &ArgMatches<'_>, config: &Config) -> Result<(), String> { + let data = match matches.value_of("DATA") { + Some(data) => { + if let Ok(data) = base64::decode(data) { + data + } else if let Ok(data) = hex::decode(data) { + data + } else { + return Err("the data parameter should be base64 or hex encoded".to_string()) + } + } + None => return Err("no data parameter".to_string()) + }; + let pair = match matches.value_of("KEYS") { + Some(keys) => crypto::load_keypair(&keys)?, + None => { + match &config.keys_path { + Some(keys) => crypto::load_keypair(&keys)?, + None => return Err("nor signing keys in the params neither in the config".to_string()) + } + } + }; + let (secret, public_key) = pair.decode() + .map_err(|err| format!("cannot decode keypair {}", err))?; + let signature = secret.sign(&data, &public_key); + let signature = base64::encode(signature.as_ref()); + if !config.is_json { + println!("Signature: {}", signature); + } else { + println!("{{"); + println!(" \"Signature\": \"{}\"", signature); + println!("}}"); + } + + Ok(()) +} + async fn call_command(matches: &ArgMatches<'_>, config: &Config, call: CallType) -> Result<(), String> { let address = matches.value_of("ADDRESS"); let method = matches.value_of("METHOD"); @@ -1205,10 +1253,10 @@ async fn call_command(matches: &ArgMatches<'_>, config: &Config, call: CallType) let abi = Some(abi_from_matches_or_config(matches, &config)?); - let keys = - matches.value_of("SIGN") - .map(|s| s.to_string()) - .or(config.keys_path.clone()); + let keys = matches.value_of("KEYS") + .or(matches.value_of("SIGN")) + .map(|s| s.to_string()) + .or(config.keys_path.clone()); let params = Some(load_params(params.unwrap())?); if !config.is_json { @@ -1321,7 +1369,8 @@ async fn deploy_command(matches: &ArgMatches<'_>, full_config: &mut FullConfig, let raw = matches.is_present("RAW"); let output = matches.value_of("OUTPUT"); let abi = Some(abi_from_matches_or_config(matches, config)?); - let keys = matches.value_of("SIGN") + let keys = matches.value_of("KEYS") + .or(matches.value_of("SIGN")) .map(|s| s.to_string()) .or(config.keys_path.clone()); let alias = matches.value_of("ALIAS"); From 103264c77646e2c277e3498cf28486d66166321d Mon Sep 17 00:00:00 2001 From: sergeyyar Date: Mon, 14 Nov 2022 14:05:20 +0300 Subject: [PATCH 02/21] up version and add changelog --- CHANGELOG.md | 5 +++++ Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40acffa0..75013318 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## Version: 0.29.2 + +### New +- Added the `sign` command. It makes signaure for data encoded in base64 or hex using common `--keys` option; + ## Version: 0.29.1 ### New diff --git a/Cargo.toml b/Cargo.toml index d82eb110..2ff4bed3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ license = 'Apache-2.0' name = 'tonos-cli' readme = 'README.md' repository = 'https://github.com/tonlabs/tonos-cli' -version = '0.29.1' +version = '0.29.2' [features] sold = ["dep:sold"] From 72d27d6f882f3f2fdf904e6ae16328eae5c4bf56 Mon Sep 17 00:00:00 2001 From: sergeyyar Date: Tue, 15 Nov 2022 09:40:47 +0300 Subject: [PATCH 03/21] fix warning and errors fix typo --- CHANGELOG.md | 2 +- src/main.rs | 15 ++++++++------- src/message.rs | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75013318..3661a776 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. ## Version: 0.29.2 ### New -- Added the `sign` command. It makes signaure for data encoded in base64 or hex using common `--keys` option; +- Added the `sign` command. It makes ED25519 signature for data encoded in base64 or hex using common `--keys` option; ## Version: 0.29.1 diff --git a/src/main.rs b/src/main.rs index 513fbadd..1c0c613f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -53,17 +53,18 @@ use decode::{create_decode_command, decode_command}; use debug::{create_debug_command, debug_command}; use deploy::{deploy_contract, generate_deploy_message}; use depool::{create_depool_command, depool_command}; -use helpers::{load_ton_address, load_abi, create_client_local, query_raw, - contract_data_from_matches_or_config_alias}; +use ed25519_dalek::Signer; use genaddr::generate_address; use getconfig::{query_global_config, dump_blockchain_config}; +use helpers::{load_ton_address, load_abi, create_client_local, query_raw, + contract_data_from_matches_or_config_alias}; use multisig::{create_multisig_command, multisig_command}; +use replay::{fetch_block_command, fetch_command, replay_command}; use std::env; use std::collections::BTreeMap; use std::process::exit; -use voting::{create_proposal, decode_proposal, vote}; -use replay::{fetch_block_command, fetch_command, replay_command}; use ton_client::abi::{ParamsOfEncodeMessageBody, CallSet}; +use voting::{create_proposal, decode_proposal, vote}; use crate::account::dump_accounts; #[cfg(feature = "sold")] use crate::compile::{compile_command, create_compile_command}; @@ -130,7 +131,7 @@ async fn main_internal() -> Result <(), String> { .help("Function arguments. Must be a list of `--name value` pairs or a json string with all arguments.") .multiple(true); - let author = "EVERLabs"; + let author = "EverX"; let callx_cmd = SubCommand::with_name("callx") .about("Sends an external message with encoded function call to the contract (alternative syntax).") @@ -1228,9 +1229,9 @@ async fn sign_command(matches: &ArgMatches<'_>, config: &Config) -> Result<(), S } } }; - let (secret, public_key) = pair.decode() + let keypair = pair.decode() .map_err(|err| format!("cannot decode keypair {}", err))?; - let signature = secret.sign(&data, &public_key); + let signature = keypair.sign(&data); let signature = base64::encode(signature.as_ref()); if !config.is_json { println!("Signature: {}", signature); diff --git a/src/message.rs b/src/message.rs index 9370fa5e..b045b6b9 100644 --- a/src/message.rs +++ b/src/message.rs @@ -84,7 +84,7 @@ pub fn prepare_message_params ( pub fn print_encoded_message(msg: &EncodedMessage, is_json:bool) { let expire = if msg.expire.is_some() { - let expire_at = Local.timestamp(msg.expire.unwrap() as i64, 0); + let expire_at = Local.timestamp_opt(msg.expire.unwrap() as i64, 0).single().unwrap(); expire_at.to_rfc2822() } else { "unknown".to_string() From ddbdb02761d8bcac15cfaae4f3b9d1185709e37c Mon Sep 17 00:00:00 2001 From: tonjen Date: Tue, 15 Nov 2022 10:04:24 +0000 Subject: [PATCH 04/21] Preparing to merge with the master --- Cargo.lock | 127 ++++++++++++++++++++++++----------------------------- 1 file changed, 58 insertions(+), 69 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 471d296a..16860851 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -114,7 +114,7 @@ checksum = "c98233c6673d8601ab23e77eb38f999c51100d46c5703b17288c57fddf3a1ffe" dependencies = [ "bstr", "doc-comment", - "predicates 2.1.1", + "predicates 2.1.3", "predicates-core", "predicates-tree", "wait-timeout", @@ -314,9 +314,9 @@ checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "cc" -version = "1.0.73" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "76a284da2e6fe2092f2353e51713435363112dfd60030e22add80be333fb928f" dependencies = [ "jobserver", ] @@ -344,9 +344,9 @@ checksum = "17cc5e6b5ab06331c33589842070416baa137e8b0eb912b008cfd4a78ada7919" [[package]] name = "chrono" -version = "0.4.22" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ "iana-time-zone", "js-sys", @@ -392,9 +392,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.18" +version = "4.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335867764ed2de42325fafe6d18b8af74ba97ee0c590fa016f157535b42ab04b" +checksum = "60494cedb60cb47462c0ff7be53de32c0e42a6fc2c772184554fa12bd9489c03" dependencies = [ "atty", "bitflags", @@ -407,9 +407,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.0.18" +version = "4.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16a1b0f6422af32d5da0c58e2703320f379216ee70198241c84173a8c5ac28f3" +checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" dependencies = [ "heck", "proc-macro-error", @@ -429,9 +429,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.48" +version = "0.1.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" dependencies = [ "cc", ] @@ -472,7 +472,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "344adc371239ef32293cb1c4fe519592fcf21206c79c02854320afcdf3ab4917" dependencies = [ "percent-encoding", - "time 0.3.16", + "time 0.3.17", "version_check", ] @@ -488,7 +488,7 @@ dependencies = [ "publicsuffix", "serde", "serde_json", - "time 0.3.16", + "time 0.3.17", "url", ] @@ -632,9 +632,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a" +checksum = "97abf9f0eca9e52b7f81b945524e76710e6cb2366aead23b7d4fbf72e281f888" dependencies = [ "cc", "cxxbridge-flags", @@ -644,9 +644,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827" +checksum = "7cc32cc5fea1d894b77d269ddb9f192110069a8a9c1f1d441195fba90553dea3" dependencies = [ "cc", "codespan-reporting", @@ -659,15 +659,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a" +checksum = "8ca220e4794c934dc6b1207c3b42856ad4c302f2df1712e9f8d2eec5afaacf1f" [[package]] name = "cxxbridge-macro" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" +checksum = "b846f081361125bfc8dc9d3940c84e1fd83ba54bbca7b17cd29483c828be0704" dependencies = [ "proc-macro2", "quote", @@ -1149,9 +1149,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.20" +version = "0.14.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" dependencies = [ "bytes", "futures-channel", @@ -1186,9 +1186,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.52" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c422fb4f6e80490d0afcacf5c3de2c22ab8e631e0cd7cb2d4a3baf844720a52a" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1268,9 +1268,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" +checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" [[package]] name = "itertools" @@ -1451,9 +1451,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ "lazy_static", "libc", @@ -1562,23 +1562,14 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" dependencies = [ "hermit-abi", "libc", ] -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - [[package]] name = "number_prefix" version = "0.4.0" @@ -1596,9 +1587,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "opaque-debug" @@ -1668,9 +1659,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.3.1" +version = "6.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3baf96e39c5359d2eb0dd6ccb42c62b91d9678aa68160d261b9e0ccbf9e9dea9" +checksum = "7b5bf27447411e9ee3ff51186bf7a08e16c341efdde93f4d823e8844429bed7e" [[package]] name = "owned-alloc" @@ -1771,9 +1762,9 @@ checksum = "60f6ce597ecdcc9a098e7fddacb1065093a3d66446fa16c675e7e71d1b5c28e6" [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "predicates" @@ -1790,9 +1781,9 @@ dependencies = [ [[package]] name = "predicates" -version = "2.1.1" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5aab5be6e4732b473071984b3164dbbfb7a3674d30ea5ff44410b6bcd960c3c" +checksum = "ed6bd09a7f7e68f3f0bf710fb7ab9c4615a488b58b5f653382a687701e458c92" dependencies = [ "difflib", "itertools", @@ -1801,15 +1792,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da1c2388b1513e1b605fcec39a95e0a9e8ef088f71443ef37099fa9ae6673fcb" +checksum = "72f883590242d3c6fc5bf50299011695fa6590c2c70eac95ee1bdb9a733ad1a2" [[package]] name = "predicates-tree" -version = "1.0.5" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d86de6de25020a36c6d3643a86d9a6a9f552107c0559c60ea03551b5e16c032" +checksum = "54ff541861505aabf6ea722d2131ee980b8276e10a1297b94e896dd8b621850d" dependencies = [ "predicates-core", "termtree", @@ -1997,9 +1988,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" dependencies = [ "aho-corasick", "memchr", @@ -2014,9 +2005,9 @@ checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "remove_dir_all" @@ -2312,9 +2303,9 @@ checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" [[package]] name = "similar" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ac7f900db32bf3fd12e0117dd3dc4da74bc52ebaac97f39668446d89694803" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" dependencies = [ "bstr", ] @@ -2381,7 +2372,7 @@ version = "0.66.0" source = "git+https://github.com/tonlabs/TON-Solidity-Compiler.git?tag=0.66.0#0436b43674dad4e61e7ccb910df169735f324eae" dependencies = [ "atty", - "clap 4.0.18", + "clap 4.0.24", "cmake", "dunce", "failure", @@ -2497,9 +2488,9 @@ dependencies = [ [[package]] name = "termtree" -version = "0.2.4" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507e9898683b6c43a9aa55b64259b721b52ba226e0f3779137e50ad114a4c90b" +checksum = "95059e91184749cb66be6dc994f67f182b6d897cb3df74a5bf66b5e709295fd8" [[package]] name = "textwrap" @@ -2543,13 +2534,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fab5c8b9980850e06d92ddbe3ab839c062c801f3927c0fb8abd6fc8e918fbca" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" dependencies = [ "itoa", - "libc", - "num_threads", "serde", "time-core", "time-macros", @@ -2563,9 +2552,9 @@ checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" [[package]] name = "time-macros" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bb801831d812c562ae7d2bfb531f26e66e4e1f6b17307ba4149c5064710e5b" +checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" dependencies = [ "time-core", ] @@ -2917,7 +2906,7 @@ dependencies = [ [[package]] name = "ton_types" version = "1.11.4" -source = "git+https://github.com/tonlabs/ton-labs-types.git?tag=1.11.4#1b194dc3f2531933f2b24a644c05e00f3ea67b9f" +source = "git+https://github.com/tonlabs/ton-labs-types.git?tag=1.11.4#c2204fe7610017a1b98ab196e0afd4e979d033e2" dependencies = [ "base64 0.13.1", "crc 1.8.1", @@ -2958,7 +2947,7 @@ dependencies = [ [[package]] name = "tonos-cli" -version = "0.29.1" +version = "0.29.2" dependencies = [ "assert_cmd", "async-trait", From 7eb4f946963c747e46774ce9611b6fdf8b90f667 Mon Sep 17 00:00:00 2001 From: sergeyyar Date: Wed, 16 Nov 2022 21:50:33 +0300 Subject: [PATCH 05/21] add cell param to sign command --- Cargo.toml | 28 ++++++++++++++-------------- src/convert.rs | 6 +++--- src/helpers.rs | 10 ++++++++++ src/main.rs | 38 ++++++++++++++++++++++---------------- 4 files changed, 49 insertions(+), 33 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2ff4bed3..2d67e7bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,29 +23,29 @@ sold = ["dep:sold"] [dependencies] async-trait = '0.1.42' -base64 = '0.10.1' +base64 = '0.13' chrono = '0.4' clap = '2.32' -crc16 = '0.4.0' -ed25519-dalek = '1.0.0-pre.3' -failure = '0.1.6' -futures = '0.3.21' -hex = '0.3.2' +crc16 = '0.4' +ed25519-dalek = '1.0' +failure = '0.1' +futures = '0.3' +hex = '0.4' indicatif = '0.16' -lazy_static = '1.4.0' +lazy_static = '1.4' num-bigint = '0.4' num-traits = '0.2' -qr2term = '0.2.0' -regex = '1.5.4' +qr2term = '0.2' +regex = '1.5' reqwest = '0.11' -serde_derive = '1.0.91' +serde_derive = '1.0' serde_json = '1.0' -sha2 = '0.8' -simplelog = '0.8.0' +sha2 = '0.10' +simplelog = '0.8' tokio-retry = '0.3' -log = { features = [ 'std' ], version = '0.4.11' } +log = { features = [ 'std' ], version = '0.4' } serde = { features = [ 'derive' ], version = '1.0' } -tokio = { default-features = false, features = [ 'full' ], version = '1' } +tokio = { default-features = false, features = [ 'full' ], version = '1.21' } url = '2.3.1' ton_abi = { git = 'https://github.com/tonlabs/ton-labs-abi.git', tag = '2.3.7' } ton_block = { git = 'https://github.com/tonlabs/ton-labs-block.git', tag = '1.8.3' } diff --git a/src/convert.rs b/src/convert.rs index a1848b8f..d6272716 100644 --- a/src/convert.rs +++ b/src/convert.rs @@ -52,9 +52,9 @@ pub fn nodeid_from_pubkey(key: &[u8]) -> Result { } let mut hasher = Sha256::new(); // node id magic - hasher.input(&[0xc6, 0xb4, 0x13, 0x48]); + hasher.update(&[0xc6, 0xb4, 0x13, 0x48]); //key - hasher.input(key); + hasher.update(key); - Ok(hex::encode(&hasher.result())) + Ok(hex::encode(&hasher.finalize())) } diff --git a/src/helpers.rs b/src/helpers.rs index e0a104ab..ee949844 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1041,3 +1041,13 @@ pub async fn get_blockchain_config(cli_config: &Config, config_contract_boc_path } } } + +pub fn decode_data(data: &str, param_name: &str) -> Result, String> { + if let Ok(data) = base64::decode(data) { + Ok(data) + } else if let Ok(data) = hex::decode(data) { + Ok(data) + } else { + Err(format!("the {} parameter should be base64 or hex encoded", param_name)) + } +} diff --git a/src/main.rs b/src/main.rs index 1c0c613f..e2bcf7b8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -57,13 +57,15 @@ use ed25519_dalek::Signer; use genaddr::generate_address; use getconfig::{query_global_config, dump_blockchain_config}; use helpers::{load_ton_address, load_abi, create_client_local, query_raw, - contract_data_from_matches_or_config_alias}; + contract_data_from_matches_or_config_alias, decode_data}; use multisig::{create_multisig_command, multisig_command}; use replay::{fetch_block_command, fetch_command, replay_command}; -use std::env; use std::collections::BTreeMap; +use std::env; use std::process::exit; +use std::sync::Arc; use ton_client::abi::{ParamsOfEncodeMessageBody, CallSet}; +use ton_types::deserialize_tree_of_cells_inmem; use voting::{create_proposal, decode_proposal, vote}; use crate::account::dump_accounts; #[cfg(feature = "sold")] @@ -400,7 +402,13 @@ async fn main_internal() -> Result <(), String> { .long("--data") .short("-d") .takes_value(true) - .help("Bytestring for signing.") + .help("Bytestring for signing base64 or hex encoded.") + ) + .arg(Arg::with_name("CELL") + .long("--cell") + .short("-c") + .takes_value(true) + .help("Serialized TOC for signing base64 or hex encoded.") ) .arg(keys_arg.clone()); @@ -1011,7 +1019,7 @@ async fn command_parser(matches: &ArgMatches<'_>, is_json: bool) -> Result <(), return body_command(m, config).await; } if let Some(m) = matches.subcommand_matches("sign") { - return sign_command(m, config).await; + return sign_command(m, config); } if let Some(m) = matches.subcommand_matches("message") { return call_command(m, config, CallType::Msg).await; @@ -1207,18 +1215,16 @@ async fn body_command(matches: &ArgMatches<'_>, config: &Config) -> Result<(), S Ok(()) } -async fn sign_command(matches: &ArgMatches<'_>, config: &Config) -> Result<(), String> { - let data = match matches.value_of("DATA") { - Some(data) => { - if let Ok(data) = base64::decode(data) { - data - } else if let Ok(data) = hex::decode(data) { - data - } else { - return Err("the data parameter should be base64 or hex encoded".to_string()) - } - } - None => return Err("no data parameter".to_string()) +fn sign_command(matches: &ArgMatches<'_>, config: &Config) -> Result<(), String> { + let data = if let Some(data) = matches.value_of("DATA") { + decode_data(data, "data")? + } else if let Some(data) = matches.value_of("CELL") { + let data = decode_data(data, "cell")?; + let cell = deserialize_tree_of_cells_inmem(Arc::new(data)) + .map_err(|err| format!("Cannot deserialize tree of cells {}", err))?; + cell.repr_hash().into_vec() + } else { + return Err("nor data neither cell parameter".to_string()) }; let pair = match matches.value_of("KEYS") { Some(keys) => crypto::load_keypair(&keys)?, From 2063bca165fc9866402aeed3f9457c049ffc7154 Mon Sep 17 00:00:00 2001 From: tonjen Date: Wed, 16 Nov 2022 19:18:15 +0000 Subject: [PATCH 06/21] Preparing to merge with the master --- Cargo.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 16860851..33ad3276 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -392,9 +392,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.24" +version = "4.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60494cedb60cb47462c0ff7be53de32c0e42a6fc2c772184554fa12bd9489c03" +checksum = "2148adefda54e14492fb9bddcc600b4344c5d1a3123bd666dcb939c6f0e0e57e" dependencies = [ "atty", "bitflags", @@ -2020,9 +2020,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.12" +version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" +checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" dependencies = [ "base64 0.13.1", "bytes", @@ -2372,7 +2372,7 @@ version = "0.66.0" source = "git+https://github.com/tonlabs/TON-Solidity-Compiler.git?tag=0.66.0#0436b43674dad4e61e7ccb910df169735f324eae" dependencies = [ "atty", - "clap 4.0.24", + "clap 4.0.26", "cmake", "dunce", "failure", @@ -2951,14 +2951,14 @@ version = "0.29.2" dependencies = [ "assert_cmd", "async-trait", - "base64 0.10.1", + "base64 0.13.1", "chrono", "clap 2.34.0", "crc16", "ed25519-dalek", "failure", "futures", - "hex 0.3.2", + "hex 0.4.3", "indicatif", "lazy_static", "log", @@ -2971,7 +2971,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "sha2 0.8.2", + "sha2 0.10.6", "simplelog 0.8.0", "sold", "string-error", From 6d792d4a78754dbb50212b2d1bfc6a69c5312e6c Mon Sep 17 00:00:00 2001 From: tonjen Date: Thu, 17 Nov 2022 08:58:58 +0000 Subject: [PATCH 07/21] Preparing to merge with the master --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 33ad3276..e5b9cf07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -715,9 +715,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ "block-buffer 0.10.3", "crypto-common", @@ -1090,7 +1090,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.5", + "digest 0.10.6", ] [[package]] @@ -1707,7 +1707,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest 0.10.5", + "digest 0.10.6", ] [[package]] @@ -2226,7 +2226,7 @@ checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.5", + "digest 0.10.6", ] [[package]] @@ -2262,7 +2262,7 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.5", + "digest 0.10.6", ] [[package]] From f9070a820218239d87ef6981987749e9d227ae2b Mon Sep 17 00:00:00 2001 From: tonjen Date: Mon, 21 Nov 2022 19:48:37 +0000 Subject: [PATCH 08/21] Preparing to merge with the master --- Cargo.lock | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e5b9cf07..b0ba9934 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -308,15 +308,15 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" +checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" [[package]] name = "cc" -version = "1.0.76" +version = "1.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a284da2e6fe2092f2353e51713435363112dfd60030e22add80be333fb928f" +checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" dependencies = [ "jobserver", ] @@ -549,9 +549,9 @@ checksum = "338089f42c427b86394a5ee60ff321da23a5c89c9d89514c829687b26359fcff" [[package]] name = "crossbeam-utils" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" +checksum = "422f23e724af1240ec469ea1e834d87a4b59ce2efe2c6a96256b0c47e2fd86aa" dependencies = [ "cfg-if", ] @@ -632,9 +632,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97abf9f0eca9e52b7f81b945524e76710e6cb2366aead23b7d4fbf72e281f888" +checksum = "d4a41a86530d0fe7f5d9ea779916b7cadd2d4f9add748b99c2c029cbbdfaf453" dependencies = [ "cc", "cxxbridge-flags", @@ -644,9 +644,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc32cc5fea1d894b77d269ddb9f192110069a8a9c1f1d441195fba90553dea3" +checksum = "06416d667ff3e3ad2df1cd8cd8afae5da26cf9cec4d0825040f88b5ca659a2f0" dependencies = [ "cc", "codespan-reporting", @@ -659,15 +659,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca220e4794c934dc6b1207c3b42856ad4c302f2df1712e9f8d2eec5afaacf1f" +checksum = "820a9a2af1669deeef27cb271f476ffd196a2c4b6731336011e0ba63e2c7cf71" [[package]] name = "cxxbridge-macro" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b846f081361125bfc8dc9d3940c84e1fd83ba54bbca7b17cd29483c828be0704" +checksum = "a08a6e2fcc370a089ad3b4aaf54db3b1b4cee38ddabce5896b33eb693275f470" dependencies = [ "proc-macro2", "quote", @@ -1237,9 +1237,9 @@ checksum = "4161ceaf2f41b6cd3f6502f5da085d4ad4393a51e0c70ed2fce1d5698d798fae" [[package]] name = "indexmap" -version = "1.9.1" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", "hashbrown", @@ -1659,9 +1659,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.4.0" +version = "6.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5bf27447411e9ee3ff51186bf7a08e16c341efdde93f4d823e8844429bed7e" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" [[package]] name = "owned-alloc" @@ -2185,9 +2185,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" +checksum = "8e8b3801309262e8184d9687fb697586833e939767aea0dda89f5a8e650e8bd7" dependencies = [ "indexmap", "itoa", @@ -2595,9 +2595,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.21.2" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +checksum = "d76ce4a75fb488c605c54bf610f221cea8b0dafb53333c1a67e8ee199dcd2ae3" dependencies = [ "autocfg", "bytes", From 2451576fd1d9b876bca0887da9ca070ac5195c54 Mon Sep 17 00:00:00 2001 From: tonjen Date: Tue, 22 Nov 2022 05:02:23 +0000 Subject: [PATCH 09/21] Preparing to merge with the master --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b0ba9934..9944ba47 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -42,9 +42,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.19" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] @@ -549,9 +549,9 @@ checksum = "338089f42c427b86394a5ee60ff321da23a5c89c9d89514c829687b26359fcff" [[package]] name = "crossbeam-utils" -version = "0.8.13" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422f23e724af1240ec469ea1e834d87a4b59ce2efe2c6a96256b0c47e2fd86aa" +checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ "cfg-if", ] From 8126a8c6c882f04556f126ca77565711a8fbb53a Mon Sep 17 00:00:00 2001 From: tonjen Date: Tue, 22 Nov 2022 18:56:12 +0000 Subject: [PATCH 10/21] Preparing to merge with the master --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9944ba47..4292373d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -549,9 +549,9 @@ checksum = "338089f42c427b86394a5ee60ff321da23a5c89c9d89514c829687b26359fcff" [[package]] name = "crossbeam-utils" -version = "0.8.12" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" dependencies = [ "cfg-if", ] @@ -2185,9 +2185,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8b3801309262e8184d9687fb697586833e939767aea0dda89f5a8e650e8bd7" +checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" dependencies = [ "indexmap", "itoa", From 1270f8fc8d84cbd45ba807d02ed1df1f80f4c061 Mon Sep 17 00:00:00 2001 From: sergeyyar Date: Thu, 24 Nov 2022 19:48:11 +0300 Subject: [PATCH 11/21] bump version --- Cargo.toml | 24 ++++++++++---------- src/call.rs | 2 +- src/debot/callbacks.rs | 4 ++-- src/debot/interfaces/address_input.rs | 2 +- src/debot/interfaces/amount_input.rs | 2 +- src/debot/interfaces/confirm_input.rs | 2 +- src/debot/interfaces/echo.rs | 2 +- src/debot/interfaces/encryption_box_input.rs | 2 +- src/debot/interfaces/input_interface.rs | 2 +- src/debot/interfaces/menu.rs | 2 +- src/debot/interfaces/number_input.rs | 2 +- src/debot/interfaces/signing_box_input.rs | 1 + src/debot/interfaces/stdout.rs | 2 +- src/debot/interfaces/terminal.rs | 2 +- src/debot/interfaces/userinfo.rs | 2 +- src/debot/term_browser.rs | 3 ++- src/debug.rs | 2 +- src/decode.rs | 10 ++++---- src/depool.rs | 1 + src/genaddr.rs | 1 + src/getconfig.rs | 2 +- src/helpers.rs | 2 +- src/main.rs | 6 +---- src/message.rs | 1 + src/multisig.rs | 1 + src/replay.rs | 8 +++---- src/run.rs | 2 +- src/voting.rs | 1 + 28 files changed, 48 insertions(+), 45 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2d67e7bb..b6dcc5c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ authors = [ 'TON DEV SOLUTIONS LTD ' ] build = 'build.rs' description = 'command line tool for TON blockchain' documentation = 'https://docs.everos.dev/' -edition = '2018' +edition = '2021' homepage = 'https://docs.everos.dev/' keywords = [ 'TON', @@ -26,7 +26,7 @@ async-trait = '0.1.42' base64 = '0.13' chrono = '0.4' clap = '2.32' -crc16 = '0.4' +crc = '3.0' ed25519-dalek = '1.0' failure = '0.1' futures = '0.3' @@ -47,16 +47,16 @@ log = { features = [ 'std' ], version = '0.4' } serde = { features = [ 'derive' ], version = '1.0' } tokio = { default-features = false, features = [ 'full' ], version = '1.21' } url = '2.3.1' -ton_abi = { git = 'https://github.com/tonlabs/ton-labs-abi.git', tag = '2.3.7' } -ton_block = { git = 'https://github.com/tonlabs/ton-labs-block.git', tag = '1.8.3' } -ton_client = { git = 'https://github.com/tonlabs/TON-SDK.git', tag = '1.38.0' } -ton_executor = { git = 'https://github.com/tonlabs/ton-labs-executor.git', tag = '1.15.89' } -ton_labs_assembler = { git = 'https://github.com/tonlabs/ton-labs-assembler.git', tag = '1.2.48' } -ton_sdk = { git = 'https://github.com/tonlabs/TON-SDK.git', tag = '1.38.0' } -ton_types = { git = 'https://github.com/tonlabs/ton-labs-types.git', tag = '1.11.4' } -ton_vm = { git = 'https://github.com/tonlabs/ton-labs-vm.git', tag = '1.8.44' } -ton_block_json = { git = 'https://github.com/tonlabs/ton-labs-block-json.git', tag = '0.7.33' } -sold = { git = 'https://github.com/tonlabs/TON-Solidity-Compiler.git', tag = '0.66.0', optional = true } +ton_abi = { git = 'https://github.com/tonlabs/ton-labs-abi.git' } +ton_block = { git = 'https://github.com/tonlabs/ton-labs-block.git' } +ton_client = { git = 'https://github.com/tonlabs/TON-SDK.git' } +ton_executor = { git = 'https://github.com/tonlabs/ton-labs-executor.git' } +ton_labs_assembler = { git = 'https://github.com/tonlabs/ton-labs-assembler.git' } +ton_sdk = { git = 'https://github.com/tonlabs/TON-SDK.git' } +ton_types = { git = 'https://github.com/tonlabs/ton-labs-types.git' } +ton_vm = { git = 'https://github.com/tonlabs/ton-labs-vm.git' } +ton_block_json = { git = 'https://github.com/tonlabs/ton-labs-block-json.git' } +sold = { git = 'https://github.com/tonlabs/TON-Solidity-Compiler.git', optional = true } [dev-dependencies] assert_cmd = '1.0.3' diff --git a/src/call.rs b/src/call.rs index b3a5ada7..20e5dfda 100644 --- a/src/call.rs +++ b/src/call.rs @@ -32,7 +32,7 @@ use ton_client::tvm::{ }; use ton_block::{Account, Serializable, Deserializable, Message}; use std::str::FromStr; -use serde_json::{Value}; +use serde_json::{json, Value}; use ton_abi::ParamType; use ton_client::error::ClientError; use crate::debug::{execute_debug, DebugLogger}; diff --git a/src/debot/callbacks.rs b/src/debot/callbacks.rs index 865db66c..47c681ed 100644 --- a/src/debot/callbacks.rs +++ b/src/debot/callbacks.rs @@ -56,7 +56,7 @@ impl Callbacks { return None; } if state.active_actions.is_empty() { - debug!("no more actions, exit loop"); + log::debug!("no more actions, exit loop"); return None; } @@ -91,7 +91,7 @@ impl BrowserCallbacks for Callbacks { /// Debot is switched to another context. async fn switch(&self, ctx_id: u8) { - debug!("switched to ctx {}", ctx_id); + log::debug!("switched to ctx {}", ctx_id); let mut state = self.state.write().unwrap(); state.state_id = ctx_id; if ctx_id == STATE_EXIT { diff --git a/src/debot/interfaces/address_input.rs b/src/debot/interfaces/address_input.rs index 6172f243..04b5d0cb 100644 --- a/src/debot/interfaces/address_input.rs +++ b/src/debot/interfaces/address_input.rs @@ -1,6 +1,6 @@ use crate::debot::term_browser::terminal_input; use crate::helpers::load_ton_address; -use serde_json::Value; +use serde_json::{Value, json}; use ton_client::abi::Abi; use ton_client::debot::{DebotInterface, InterfaceResult}; use super::dinterface::{decode_answer_id, decode_prompt}; diff --git a/src/debot/interfaces/amount_input.rs b/src/debot/interfaces/amount_input.rs index 16aa6239..4295c370 100644 --- a/src/debot/interfaces/amount_input.rs +++ b/src/debot/interfaces/amount_input.rs @@ -1,5 +1,5 @@ use crate::debot::term_browser::terminal_input; -use serde_json::Value; +use serde_json::{Value, json}; use ton_client::abi::Abi; use ton_client::debot::{DebotInterface, InterfaceResult}; use super::dinterface::{decode_answer_id, decode_num_arg, decode_prompt}; diff --git a/src/debot/interfaces/confirm_input.rs b/src/debot/interfaces/confirm_input.rs index 47d39a08..76b7d6e7 100644 --- a/src/debot/interfaces/confirm_input.rs +++ b/src/debot/interfaces/confirm_input.rs @@ -1,5 +1,5 @@ use crate::debot::term_browser::terminal_input; -use serde_json::Value; +use serde_json::{Value, json}; use ton_client::abi::Abi; use ton_client::debot::{DebotInterface, InterfaceResult}; use super::dinterface::{decode_answer_id, decode_prompt}; diff --git a/src/debot/interfaces/echo.rs b/src/debot/interfaces/echo.rs index 045da8f6..9b2eb48f 100644 --- a/src/debot/interfaces/echo.rs +++ b/src/debot/interfaces/echo.rs @@ -1,4 +1,4 @@ -use serde_json::Value; +use serde_json::{Value, json}; use ton_client::debot::{DebotInterface, InterfaceResult}; use ton_client::abi::Abi; diff --git a/src/debot/interfaces/encryption_box_input.rs b/src/debot/interfaces/encryption_box_input.rs index 63743ced..04593e8f 100644 --- a/src/debot/interfaces/encryption_box_input.rs +++ b/src/debot/interfaces/encryption_box_input.rs @@ -3,7 +3,7 @@ use crate::debot::term_encryption_box::{ EncryptionBoxType, ParamsOfTerminalEncryptionBox, TerminalEncryptionBox, }; use crate::helpers::TonClient; -use serde_json::Value; +use serde_json::{Value, json}; use tokio::sync::RwLock; use ton_client::{abi::Abi, crypto::EncryptionBoxHandle}; use ton_client::debot::{DebotInterface, InterfaceResult}; diff --git a/src/debot/interfaces/input_interface.rs b/src/debot/interfaces/input_interface.rs index b7911a05..b5bc31ea 100644 --- a/src/debot/interfaces/input_interface.rs +++ b/src/debot/interfaces/input_interface.rs @@ -3,7 +3,7 @@ use crate::debot::{ChainProcessor, ProcessorError}; use ton_client::debot::{DebotInterface, InterfaceResult}; use std::sync::{Arc}; use tokio::sync::RwLock; -use serde_json::Value; +use serde_json::{Value, json}; use super::dinterface::{decode_answer_id, decode_prompt, decode_string_arg}; use super::menu::{MenuItem, ID as MENU_ID}; use super::terminal::ID as TERMINAL_ID; diff --git a/src/debot/interfaces/menu.rs b/src/debot/interfaces/menu.rs index 655f1ce3..d32859e9 100644 --- a/src/debot/interfaces/menu.rs +++ b/src/debot/interfaces/menu.rs @@ -1,6 +1,6 @@ use super::dinterface::{decode_string_arg}; use crate::debot::term_browser::{action_input}; -use serde_json::Value; +use serde_json::{Value, json}; use serde::{de, Deserialize, Deserializer}; use ton_client::abi::Abi; use ton_client::debot::{DebotInterface, InterfaceResult}; diff --git a/src/debot/interfaces/number_input.rs b/src/debot/interfaces/number_input.rs index d2027ac5..4d1a7677 100644 --- a/src/debot/interfaces/number_input.rs +++ b/src/debot/interfaces/number_input.rs @@ -1,5 +1,5 @@ use crate::debot::term_browser::terminal_input; -use serde_json::Value; +use serde_json::{Value, json}; use ton_client::abi::Abi; use ton_client::debot::{DebotInterface, InterfaceResult}; use super::dinterface::{decode_answer_id, decode_int256, decode_prompt}; diff --git a/src/debot/interfaces/signing_box_input.rs b/src/debot/interfaces/signing_box_input.rs index 9fbe7b57..7ba5071a 100644 --- a/src/debot/interfaces/signing_box_input.rs +++ b/src/debot/interfaces/signing_box_input.rs @@ -9,6 +9,7 @@ use crate::debot::term_signing_box::TerminalSigningBox; use crate::debot::{ChainProcessor, ProcessorError}; use tokio::sync::RwLock; use std::sync::Arc; +use serde_json::json; pub const ID: &str = "c13024e101c95e71afb1f5fa6d72f633d51e721de0320d73dfd6121a54e4d40a"; diff --git a/src/debot/interfaces/stdout.rs b/src/debot/interfaces/stdout.rs index 87999152..57c9aa03 100644 --- a/src/debot/interfaces/stdout.rs +++ b/src/debot/interfaces/stdout.rs @@ -1,4 +1,4 @@ -use serde_json::Value; +use serde_json::{Value, json}; use ton_client::debot::{DebotInterface, InterfaceResult}; use ton_client::abi::Abi; diff --git a/src/debot/interfaces/terminal.rs b/src/debot/interfaces/terminal.rs index 387f4e49..887dfc4c 100644 --- a/src/debot/interfaces/terminal.rs +++ b/src/debot/interfaces/terminal.rs @@ -1,6 +1,6 @@ use super::dinterface::{decode_answer_id, decode_bool_arg, decode_prompt, decode_string_arg, Printer}; use crate::debot::term_browser::terminal_input; -use serde_json::Value; +use serde_json::{Value, json}; use ton_client::abi::Abi; use ton_client::debot::{DebotInterface, InterfaceResult}; use crate::convert::convert_token; diff --git a/src/debot/interfaces/userinfo.rs b/src/debot/interfaces/userinfo.rs index 9f0e22d5..539572b3 100644 --- a/src/debot/interfaces/userinfo.rs +++ b/src/debot/interfaces/userinfo.rs @@ -2,7 +2,7 @@ use super::dinterface::decode_answer_id; use crate::config::Config; use crate::debot::term_signing_box::TerminalSigningBox; use crate::helpers::TonClient; -use serde_json::Value; +use serde_json::{Value, json}; use ton_client::abi::Abi; use ton_client::debot::{DebotInterface, InterfaceResult}; diff --git a/src/debot/term_browser.rs b/src/debot/term_browser.rs index 616e18bc..4e3f471f 100644 --- a/src/debot/term_browser.rs +++ b/src/debot/term_browser.rs @@ -15,6 +15,7 @@ use crate::config::Config; use crate::helpers::{create_client, load_ton_address, load_abi, TonClient}; use std::io::{self, BufRead, Write}; use std::sync::Arc; +use serde_json::json; use ton_client::abi::{ Abi, CallSet, ParamsOfEncodeInternalMessage, ParamsOfDecodeMessage, encode_internal_message, decode_message}; use ton_client::boc::{ParamsOfParse, parse_message}; @@ -160,7 +161,7 @@ impl TerminalBrowser { .ok_or_else(|| "Internal browser error: debot not found".to_owned())?; if let Some(result) = self.interfaces.try_execute(&msg, &interface_id, &debot.info.dabi_version).await { let (func_id, return_args) = result?; - debug!("response: {} ({})", func_id, return_args); + log::debug!("response: {} ({})", func_id, return_args); let call_set = match func_id { 0 => None, _ => CallSet::some_with_function_and_input(&format!("0x{:x}", func_id), return_args), diff --git a/src/debug.rs b/src/debug.rs index d936484a..e704983b 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -35,7 +35,7 @@ use ton_client::net::{OrderBy, ParamsOfQueryCollection, query_collection, SortDi use crate::crypto::load_keypair; use std::fmt; use std::fs::File; -use serde_json::Value; +use serde_json::{Value, json}; use ton_labs_assembler::DbgInfo; use ton_vm::executor::{Engine, EngineTraceInfo, EngineTraceInfoType}; use crate::decode::msg_printer::serialize_msg; diff --git a/src/decode.rs b/src/decode.rs index 87c4f52c..95151e97 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -12,15 +12,15 @@ */ use crate::{load_abi, print_args}; use crate::config::Config; +use crate::decode::msg_printer::tree_of_cells_into_base64; use crate::helpers::{decode_msg_body, print_account, create_client_local, create_client_verbose, query_account_field, abi_from_matches_or_config, load_ton_address, load_ton_abi, create_client, query_message}; use clap::{ArgMatches, SubCommand, Arg, App, AppSettings}; -use ton_types::cells_serialization::serialize_tree_of_cells; -use ton_types::{Cell, SliceData}; +use ton_types::{Cell, SliceData, serialize_tree_of_cells}; use std::io::Cursor; use ton_block::{Account, Deserializable, Serializable, AccountStatus, StateInit}; use ton_client::abi::{decode_account_data, ParamsOfDecodeAccountData}; -use crate::decode::msg_printer::tree_of_cells_into_base64; use serde::Serialize; +use serde_json::json; pub fn create_decode_command<'a, 'b>() -> App<'a, 'b> { let tvc_cmd = SubCommand::with_name("stateinit") @@ -362,7 +362,7 @@ async fn decode_body(body_base64: &str, abi_path: &str, is_json: bool, config: & let cell = ton_types::cells_serialization::deserialize_tree_of_cells(&mut Cursor::new(&body_vec)) .map_err(|e| format!("Failed to create cell: {}", e))?; - let orig_slice: SliceData = cell.into(); + let orig_slice = SliceData::load_cell(cell).unwrap(); if is_external { let mut slice = orig_slice.clone(); let flag = slice.get_next_bit(); @@ -464,7 +464,7 @@ async fn decode_tvc_command(m: &ArgMatches<'_>, config: &Config) -> Result<(), S } pub mod msg_printer { - use serde_json::Value; + use serde_json::{Value, json}; use ton_block::{CurrencyCollection, StateInit, Message, CommonMsgInfo, Grams}; use ton_types::cells_serialization::serialize_tree_of_cells; use ton_types::Cell; diff --git a/src/depool.rs b/src/depool.rs index 36ac9ad4..b412678a 100644 --- a/src/depool.rs +++ b/src/depool.rs @@ -27,6 +27,7 @@ use crate::helpers::{ use crate::multisig::{send_with_body, MSIG_ABI}; use clap::{App, ArgMatches, SubCommand, Arg, AppSettings}; +use serde_json::json; use ton_client::abi::{ParamsOfEncodeMessageBody, CallSet, ParamsOfDecodeMessageBody}; use ton_client::net::{OrderBy, ParamsOfQueryCollection, ParamsOfWaitForCollection, SortDirection}; use crate::call::{process_message}; diff --git a/src/genaddr.rs b/src/genaddr.rs index 0d7d2753..73e7215d 100644 --- a/src/genaddr.rs +++ b/src/genaddr.rs @@ -13,6 +13,7 @@ use crate::config::Config; use crate::helpers::{create_client_local, read_keys, load_abi, calc_acc_address, load_abi_str}; use ed25519_dalek::PublicKey; +use serde_json::json; use std::fs::OpenOptions; use crate::crypto::{gen_seed_phrase, generate_keypair_from_mnemonic}; diff --git a/src/getconfig.rs b/src/getconfig.rs index f356c3bf..8ef05d71 100644 --- a/src/getconfig.rs +++ b/src/getconfig.rs @@ -424,7 +424,7 @@ fn prepare_message_new_config_param( let config_contract_address = MsgAddressInt::with_standart(None, -1, config_account).unwrap(); let mut header = ExternalInboundMessageHeader::new(AddrNone, config_contract_address); header.import_fee = Grams::zero(); - let body = SliceData::from(cell.into_cell().unwrap()); + let body = SliceData::load_builder(cell).unwrap(); let message = Message::with_ext_in_header_and_body(header, body); Ok(message) diff --git a/src/helpers.rs b/src/helpers.rs index ee949844..31b76564 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -27,7 +27,7 @@ use ton_client::{ClientConfig, ClientContext}; use ton_block::{Account, MsgAddressInt, Deserializable, CurrencyCollection, StateInit, Serializable}; use std::str::FromStr; use clap::ArgMatches; -use serde_json::Value; +use serde_json::{Value, json}; use ton_client::abi::Abi::Contract; use ton_executor::BlockchainConfig; use url::Url; diff --git a/src/main.rs b/src/main.rs index e2bcf7b8..61f8bb50 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,11 +15,6 @@ #![allow(clippy::or_fun_call)] #![allow(clippy::too_many_arguments)] -extern crate clap; -#[macro_use] extern crate log; -#[macro_use] extern crate serde_json; -extern crate core; - mod account; mod call; mod config; @@ -60,6 +55,7 @@ use helpers::{load_ton_address, load_abi, create_client_local, query_raw, contract_data_from_matches_or_config_alias, decode_data}; use multisig::{create_multisig_command, multisig_command}; use replay::{fetch_block_command, fetch_command, replay_command}; +use serde_json::json; use std::collections::BTreeMap; use std::env; use std::process::exit; diff --git a/src/message.rs b/src/message.rs index b045b6b9..e55e2223 100644 --- a/src/message.rs +++ b/src/message.rs @@ -12,6 +12,7 @@ */ use chrono::{Local, TimeZone}; +use serde_json::json; use ton_client::abi::{Abi, CallSet, encode_message, FunctionHeader, ParamsOfEncodeMessage, Signer}; use crate::config::Config; use crate::helpers::{create_client_local, load_abi, load_ton_address, now, TonClient}; diff --git a/src/multisig.rs b/src/multisig.rs index be4d7344..6dc93866 100644 --- a/src/multisig.rs +++ b/src/multisig.rs @@ -17,6 +17,7 @@ use crate::convert; use crate::deploy::prepare_deploy_message_params; use crate::helpers::{create_client_local, load_abi, load_ton_address, create_client_verbose, load_file_with_url}; use clap::{App, ArgMatches, SubCommand, Arg, AppSettings}; +use serde_json::json; use ton_client::abi::{encode_message_body, ParamsOfEncodeMessageBody, CallSet}; use crate::crypto::load_keypair; diff --git a/src/replay.rs b/src/replay.rs index db587d92..af19bd16 100644 --- a/src/replay.rs +++ b/src/replay.rs @@ -30,7 +30,7 @@ use ton_client::{ }; use ton_executor::{BlockchainConfig, ExecuteParams, OrdinaryTransactionExecutor, TickTockTransactionExecutor, TransactionExecutor}; -use ton_types::{UInt256, serialize_tree_of_cells}; +use ton_types::{BuilderData, SliceData, UInt256, serialize_tree_of_cells}; use ton_vm::executor::{Engine, EngineTraceInfo}; use crate::config::Config; @@ -357,9 +357,9 @@ pub async fn replay( } if dump_mask & DUMP_EXECUTOR_CONFIG != 0 { // config.boc suitable for creating ton-labs-executor tests - let mut config_data = ton_types::SliceData::from(config_account.get_data() - .ok_or("Failed to get config data")?); - let mut cfg = ton_types::BuilderData::new(); + let mut config_data = SliceData::load_cell(config_account.get_data() + .ok_or("Failed to get config data")?).unwrap(); + let mut cfg = BuilderData::default(); cfg.append_raw(&config_data.get_next_bytes(32) .map_err(|e| format!("Failed to read config data: {}", e))?, 256) .map_err(|e| format!("Failed to append config data: {}", e))?; diff --git a/src/run.rs b/src/run.rs index 8430116a..5ece427a 100644 --- a/src/run.rs +++ b/src/run.rs @@ -12,7 +12,7 @@ */ use clap::ArgMatches; -use serde_json::{Map, Value}; +use serde_json::{Map, Value, json}; use ton_block::{Account, Deserializable, Message, Serializable}; use ton_client::abi::{FunctionHeader}; use ton_client::tvm::{ExecutionOptions, ParamsOfRunGet, ParamsOfRunTvm, run_get, run_tvm}; diff --git a/src/voting.rs b/src/voting.rs index 6e1c0c8f..4e770779 100644 --- a/src/voting.rs +++ b/src/voting.rs @@ -14,6 +14,7 @@ use crate::config::Config; use crate::{call, message}; use crate::helpers::{create_client_local, decode_msg_body}; use crate::multisig::{encode_transfer_body, MSIG_ABI, TRANSFER_WITH_COMMENT}; +use serde_json::json; pub async fn create_proposal( config: &Config, From 353c2131269c1ceb412d77baf722776b76f54f94 Mon Sep 17 00:00:00 2001 From: sergeyyar Date: Mon, 26 Dec 2022 14:25:07 +0300 Subject: [PATCH 12/21] bump repos --- Cargo.toml | 6 +++--- src/getconfig.rs | 4 ++-- src/replay.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b6dcc5c0..66d0a11f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,9 +59,9 @@ ton_block_json = { git = 'https://github.com/tonlabs/ton-labs-block-json.git' } sold = { git = 'https://github.com/tonlabs/TON-Solidity-Compiler.git', optional = true } [dev-dependencies] -assert_cmd = '1.0.3' -lazy_static = '1.4.0' -predicates = '1' +assert_cmd = '2.0' +lazy_static = '1.4' +predicates = '2.1' string-error = '0.1.0' [[bin]] diff --git a/src/getconfig.rs b/src/getconfig.rs index 8ef05d71..0160859c 100644 --- a/src/getconfig.rs +++ b/src/getconfig.rs @@ -404,7 +404,7 @@ fn prepare_message_new_config_param( cell.append_u32(seqno).unwrap(); cell.append_u32(since_the_epoch).unwrap(); cell.append_i32(key_number as i32).unwrap(); - cell.append_reference_cell(config_param.clone()); + cell.checked_append_reference(config_param.clone()).unwrap(); let exp_key = ed25519_dalek::ExpandedSecretKey::from( &ed25519_dalek::SecretKey::from_bytes(private_key_of_config_account.as_slice() @@ -419,7 +419,7 @@ fn prepare_message_new_config_param( cell.append_u32(seqno).unwrap(); cell.append_u32(since_the_epoch).unwrap(); cell.append_i32(key_number as i32).unwrap(); - cell.append_reference_cell(config_param); + cell.checked_append_reference(config_param).unwrap(); let config_contract_address = MsgAddressInt::with_standart(None, -1, config_account).unwrap(); let mut header = ExternalInboundMessageHeader::new(AddrNone, config_contract_address); diff --git a/src/replay.rs b/src/replay.rs index af19bd16..a07db855 100644 --- a/src/replay.rs +++ b/src/replay.rs @@ -363,8 +363,8 @@ pub async fn replay( cfg.append_raw(&config_data.get_next_bytes(32) .map_err(|e| format!("Failed to read config data: {}", e))?, 256) .map_err(|e| format!("Failed to append config data: {}", e))?; - cfg.append_reference_cell(config_data.reference(0) - .map_err(|e| format!("Failed to get config zero reference: {}", e))?); + cfg.checked_append_reference(config_data.reference(0) + .map_err(|e| format!("Failed to get config zero reference: {}", e))?)?; let path = format!("config-{}-test.boc", txnid); cfg.into_cell().map_err(|e| format!("Failed to finalize builder: {}", e))? .write_to_file(&path); From 7455922476625c92810f4bc0284f40b9155fc12c Mon Sep 17 00:00:00 2001 From: sergeyyar Date: Tue, 27 Dec 2022 12:05:15 +0300 Subject: [PATCH 13/21] bump tags --- Cargo.toml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 66d0a11f..e403f88b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,16 +47,16 @@ log = { features = [ 'std' ], version = '0.4' } serde = { features = [ 'derive' ], version = '1.0' } tokio = { default-features = false, features = [ 'full' ], version = '1.21' } url = '2.3.1' -ton_abi = { git = 'https://github.com/tonlabs/ton-labs-abi.git' } -ton_block = { git = 'https://github.com/tonlabs/ton-labs-block.git' } -ton_client = { git = 'https://github.com/tonlabs/TON-SDK.git' } -ton_executor = { git = 'https://github.com/tonlabs/ton-labs-executor.git' } +ton_abi = { git = 'https://github.com/tonlabs/ton-labs-abi.git', tag = '2.3.45' } +ton_block = { git = 'https://github.com/tonlabs/ton-labs-block.git', tag = '1.9.10' } +ton_block_json = { git = 'https://github.com/tonlabs/ton-labs-block-json.git', tag = '0.7.75' } +ton_client = { git = 'https://github.com/tonlabs/TON-SDK.git', tag = '1.39.0' } +ton_executor = { default-features = false, git = 'https://github.com/tonlabs/ton-labs-executor.git', tag = '1.15.139' } ton_labs_assembler = { git = 'https://github.com/tonlabs/ton-labs-assembler.git' } -ton_sdk = { git = 'https://github.com/tonlabs/TON-SDK.git' } -ton_types = { git = 'https://github.com/tonlabs/ton-labs-types.git' } -ton_vm = { git = 'https://github.com/tonlabs/ton-labs-vm.git' } -ton_block_json = { git = 'https://github.com/tonlabs/ton-labs-block-json.git' } -sold = { git = 'https://github.com/tonlabs/TON-Solidity-Compiler.git', optional = true } +ton_sdk = { git = 'https://github.com/tonlabs/TON-SDK.git', tag = '1.39.0' } +ton_types = { git = 'https://github.com/tonlabs/ton-labs-types.git', tag = '1.12.4' } +ton_vm = { default-features = false, git = 'https://github.com/tonlabs/ton-labs-vm.git', tag = '1.8.79' } +sold = { git = 'https://github.com/tonlabs/TON-Solidity-Compiler.git', tag = '0.66.0', optional = true } [dev-dependencies] assert_cmd = '2.0' From 117d08722bdcaa9573ccbf10da1450b43fc55ec1 Mon Sep 17 00:00:00 2001 From: SergeyY <43989533+yaroslavser@users.noreply.github.com> Date: Tue, 27 Dec 2022 12:19:51 +0300 Subject: [PATCH 14/21] Update Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index e403f88b..fc38fec8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,7 +52,7 @@ ton_block = { git = 'https://github.com/tonlabs/ton-labs-block.git', tag = '1.9. ton_block_json = { git = 'https://github.com/tonlabs/ton-labs-block-json.git', tag = '0.7.75' } ton_client = { git = 'https://github.com/tonlabs/TON-SDK.git', tag = '1.39.0' } ton_executor = { default-features = false, git = 'https://github.com/tonlabs/ton-labs-executor.git', tag = '1.15.139' } -ton_labs_assembler = { git = 'https://github.com/tonlabs/ton-labs-assembler.git' } +ton_labs_assembler = { git = 'https://github.com/tonlabs/ton-labs-assembler.git', tag = '1.2.74' } ton_sdk = { git = 'https://github.com/tonlabs/TON-SDK.git', tag = '1.39.0' } ton_types = { git = 'https://github.com/tonlabs/ton-labs-types.git', tag = '1.12.4' } ton_vm = { default-features = false, git = 'https://github.com/tonlabs/ton-labs-vm.git', tag = '1.8.79' } From b14512fbd02a70a4527149e76ff014097861c9da Mon Sep 17 00:00:00 2001 From: sergeyyar Date: Tue, 27 Dec 2022 13:17:04 +0300 Subject: [PATCH 15/21] fix compile --- src/replay.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/replay.rs b/src/replay.rs index a07db855..63339ad3 100644 --- a/src/replay.rs +++ b/src/replay.rs @@ -364,7 +364,7 @@ pub async fn replay( .map_err(|e| format!("Failed to read config data: {}", e))?, 256) .map_err(|e| format!("Failed to append config data: {}", e))?; cfg.checked_append_reference(config_data.reference(0) - .map_err(|e| format!("Failed to get config zero reference: {}", e))?)?; + .map_err(|e| format!("Failed to get config zero reference: {}", e))?).unwrap(); let path = format!("config-{}-test.boc", txnid); cfg.into_cell().map_err(|e| format!("Failed to finalize builder: {}", e))? .write_to_file(&path); From e13f1798e4c1ed3368770ace73e07ce0ef895ba4 Mon Sep 17 00:00:00 2001 From: SergeyY <43989533+yaroslavser@users.noreply.github.com> Date: Tue, 27 Dec 2022 13:19:15 +0300 Subject: [PATCH 16/21] Update Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index fc38fec8..beaf3978 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,7 @@ ton_executor = { default-features = false, git = 'https://github.com/tonlabs/ton ton_labs_assembler = { git = 'https://github.com/tonlabs/ton-labs-assembler.git', tag = '1.2.74' } ton_sdk = { git = 'https://github.com/tonlabs/TON-SDK.git', tag = '1.39.0' } ton_types = { git = 'https://github.com/tonlabs/ton-labs-types.git', tag = '1.12.4' } -ton_vm = { default-features = false, git = 'https://github.com/tonlabs/ton-labs-vm.git', tag = '1.8.79' } +ton_vm = { git = 'https://github.com/tonlabs/ton-labs-vm.git', tag = '1.8.79' } sold = { git = 'https://github.com/tonlabs/TON-Solidity-Compiler.git', tag = '0.66.0', optional = true } [dev-dependencies] From 96e84c55f27ed23366cdef9ac01bce9dbf48acd4 Mon Sep 17 00:00:00 2001 From: tonjen Date: Tue, 27 Dec 2022 10:47:06 +0000 Subject: [PATCH 17/21] Preparing to merge with the master --- Cargo.lock | 500 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 321 insertions(+), 179 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4292373d..69c24a42 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ "gimli", ] @@ -69,14 +69,14 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.66" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" +checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" [[package]] name = "api_derive" -version = "1.38.0" -source = "git+https://github.com/tonlabs/TON-SDK.git?tag=1.38.0#c3906ea236ef3624d0349f90d4ce44ee840453bb" +version = "1.39.0" +source = "git+https://github.com/tonlabs/TON-SDK.git?tag=1.39.0#7bf013e62fced8a30dc802a1c560b385d4dd7941" dependencies = [ "api_info", "quote", @@ -86,8 +86,8 @@ dependencies = [ [[package]] name = "api_info" -version = "1.38.0" -source = "git+https://github.com/tonlabs/TON-SDK.git?tag=1.38.0#c3906ea236ef3624d0349f90d4ce44ee840453bb" +version = "1.39.0" +source = "git+https://github.com/tonlabs/TON-SDK.git?tag=1.39.0#7bf013e62fced8a30dc802a1c560b385d4dd7941" dependencies = [ "serde", "serde_derive", @@ -108,13 +108,13 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "assert_cmd" -version = "1.0.8" +version = "2.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c98233c6673d8601ab23e77eb38f999c51100d46c5703b17288c57fddf3a1ffe" +checksum = "fa3d466004a8b4cb1bc34044240a2fd29d17607e2e3bd613eb44fd48e8100da3" dependencies = [ - "bstr", + "bstr 1.1.0", "doc-comment", - "predicates 2.1.3", + "predicates", "predicates-core", "predicates-tree", "wait-timeout", @@ -122,9 +122,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.58" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" +checksum = "677d1d8ab452a3936018a687b20e6f7cf5363d713b732b8884001317b0e48aa3" dependencies = [ "proc-macro2", "quote", @@ -137,7 +137,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -150,9 +150,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ "addr2line", "cc", @@ -277,9 +277,19 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" dependencies = [ - "lazy_static", "memchr", +] + +[[package]] +name = "bstr" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45ea9b00a7b3f2988e9a65ad3917e62123c38dba709b666506207be96d1790b" +dependencies = [ + "memchr", + "once_cell", "regex-automata", + "serde", ] [[package]] @@ -314,9 +324,9 @@ checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" [[package]] name = "cc" -version = "1.0.77" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" +checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" dependencies = [ "jobserver", ] @@ -352,7 +362,7 @@ dependencies = [ "js-sys", "num-integer", "num-traits", - "time 0.1.44", + "time 0.1.45", "wasm-bindgen", "winapi", ] @@ -392,14 +402,14 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.26" +version = "4.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2148adefda54e14492fb9bddcc600b4344c5d1a3123bd666dcb939c6f0e0e57e" +checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39" dependencies = [ - "atty", "bitflags", "clap_derive", "clap_lex", + "is-terminal", "once_cell", "strsim 0.10.0", "termcolor", @@ -467,9 +477,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "cookie" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "344adc371239ef32293cb1c4fe519592fcf21206c79c02854320afcdf3ab4917" +checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" dependencies = [ "percent-encoding", "time 0.3.17", @@ -541,12 +551,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d0165d2900ae6778e36e80bbc4da3b5eefccee9ba939761f9c2882a5d9af3ff" -[[package]] -name = "crc16" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "338089f42c427b86394a5ee60ff321da23a5c89c9d89514c829687b26359fcff" - [[package]] name = "crossbeam-utils" version = "0.8.14" @@ -632,9 +636,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.82" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4a41a86530d0fe7f5d9ea779916b7cadd2d4f9add748b99c2c029cbbdfaf453" +checksum = "5add3fc1717409d029b20c5b6903fc0c0b02fa6741d820054f4a2efa5e5816fd" dependencies = [ "cc", "cxxbridge-flags", @@ -644,9 +648,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.82" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06416d667ff3e3ad2df1cd8cd8afae5da26cf9cec4d0825040f88b5ca659a2f0" +checksum = "b4c87959ba14bc6fbc61df77c3fcfe180fc32b93538c4f1031dd802ccb5f2ff0" dependencies = [ "cc", "codespan-reporting", @@ -659,27 +663,21 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.82" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "820a9a2af1669deeef27cb271f476ffd196a2c4b6731336011e0ba63e2c7cf71" +checksum = "69a3e162fde4e594ed2b07d0f83c6c67b745e7f28ce58c6df5e6b6bef99dfb59" [[package]] name = "cxxbridge-macro" -version = "1.0.82" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08a6e2fcc370a089ad3b4aaf54db3b1b4cee38ddabce5896b33eb693275f470" +checksum = "3e7e2adeb6a0d4a282e581096b06e1791532b7d576dcde5ccd9382acf55db8e6" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "difference" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" - [[package]] name = "difflib" version = "0.4.0" @@ -791,6 +789,27 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "extfmt" version = "0.1.1" @@ -836,9 +855,9 @@ dependencies = [ [[package]] name = "float-cmp" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" dependencies = [ "num-traits", ] @@ -1005,9 +1024,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" [[package]] name = "h2" @@ -1052,6 +1071,15 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + [[package]] name = "hex" version = "0.3.2" @@ -1266,11 +1294,33 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "io-lifetimes" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" +dependencies = [ + "libc", + "windows-sys 0.42.0", +] + [[package]] name = "ipnet" -version = "2.5.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" +checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e" + +[[package]] +name = "is-terminal" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" +dependencies = [ + "hermit-abi 0.2.6", + "io-lifetimes", + "rustix", + "windows-sys 0.42.0", +] [[package]] name = "itertools" @@ -1283,9 +1333,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "jobserver" @@ -1313,9 +1363,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.137" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "libsecp256k1" @@ -1367,13 +1417,19 @@ dependencies = [ [[package]] name = "link-cplusplus" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" dependencies = [ "cc", ] +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + [[package]] name = "lock_api" version = "0.4.9" @@ -1430,9 +1486,9 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "miniz_oxide" -version = "0.5.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", ] @@ -1562,11 +1618,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi", + "hermit-abi 0.2.6", "libc", ] @@ -1578,9 +1634,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "239da7f290cfa979f43f85a8efeee9a8a76d0827c356d37f9d3d7254d6b537fb" dependencies = [ "memchr", ] @@ -1605,9 +1661,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.42" +version = "0.10.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" +checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" dependencies = [ "bitflags", "cfg-if", @@ -1637,9 +1693,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.77" +version = "0.9.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" +checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" dependencies = [ "autocfg", "cc", @@ -1681,9 +1737,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" +checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" dependencies = [ "cfg-if", "libc", @@ -1768,28 +1824,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "predicates" -version = "1.0.8" +version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49cfaf7fdaa3bfacc6fa3e7054e65148878354a5cfddcf661df4c851f8021df" +checksum = "f54fc5dc63ed3bbf19494623db4f3af16842c0d975818e469022d09e53f0aa05" dependencies = [ - "difference", + "difflib", "float-cmp", + "itertools", "normalize-line-endings", "predicates-core", "regex", ] -[[package]] -name = "predicates" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6bd09a7f7e68f3f0bf710fb7ab9c4615a488b58b5f653382a687701e458c92" -dependencies = [ - "difflib", - "itertools", - "predicates-core", -] - [[package]] name = "predicates-core" version = "1.0.5" @@ -1832,15 +1878,15 @@ dependencies = [ [[package]] name = "proc-macro-hack" -version = "0.5.19" +version = "0.5.20+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" dependencies = [ "unicode-ident", ] @@ -1882,9 +1928,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ "proc-macro2", ] @@ -2082,11 +2128,25 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustix" +version = "0.36.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.42.0", +] + [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "salsa20" @@ -2115,9 +2175,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "scratch" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" [[package]] name = "scrypt" @@ -2165,18 +2225,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.147" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.147" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", @@ -2185,9 +2245,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ "indexmap", "itoa", @@ -2197,9 +2257,9 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fe39d9fbb0ebf5eb2c7cb7e2a47e4f462fad1379f1166b8ae49ad9eae89a7ca" +checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e" dependencies = [ "proc-macro2", "quote", @@ -2220,9 +2280,9 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" dependencies = [ "cfg-if", "cpufeatures", @@ -2307,7 +2367,7 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" dependencies = [ - "bstr", + "bstr 0.2.17", ] [[package]] @@ -2372,7 +2432,7 @@ version = "0.66.0" source = "git+https://github.com/tonlabs/TON-Solidity-Compiler.git?tag=0.66.0#0436b43674dad4e61e7ccb910df169735f324eae" dependencies = [ "atty", - "clap 4.0.26", + "clap 4.0.32", "cmake", "dunce", "failure", @@ -2380,9 +2440,9 @@ dependencies = [ "serde", "serde_json", "strip-ansi-escapes", - "ton_abi", - "ton_block", - "ton_types", + "ton_abi 2.3.7", + "ton_block 1.8.3", + "ton_types 1.11.4", "tvm_linker", ] @@ -2421,9 +2481,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.103" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -2503,18 +2563,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", @@ -2523,9 +2583,9 @@ dependencies = [ [[package]] name = "time" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" dependencies = [ "libc", "wasi 0.10.0+wasi-snapshot-preview1", @@ -2595,9 +2655,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.22.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76ce4a75fb488c605c54bf610f221cea8b0dafb53333c1a67e8ee199dcd2ae3" +checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" dependencies = [ "autocfg", "bytes", @@ -2610,14 +2670,14 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "winapi", + "windows-sys 0.42.0", ] [[package]] name = "tokio-macros" -version = "1.8.0" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ "proc-macro2", "quote", @@ -2702,14 +2762,36 @@ dependencies = [ "serde_derive", "serde_json", "sha2 0.8.2", - "ton_block", - "ton_types", + "ton_block 1.8.3", + "ton_types 1.11.4", +] + +[[package]] +name = "ton_abi" +version = "2.3.45" +source = "git+https://github.com/tonlabs/ton-labs-abi.git?tag=2.3.45#2b78c0c81ce678f417968ade7b3424e885ca7c58" +dependencies = [ + "base64 0.10.1", + "byteorder", + "chrono", + "ed25519", + "ed25519-dalek", + "failure", + "hex 0.3.2", + "num-bigint", + "num-traits", + "serde", + "serde_derive", + "serde_json", + "sha2 0.10.6", + "ton_block 1.9.10", + "ton_types 1.12.4", ] [[package]] name = "ton_api" -version = "0.2.132" -source = "git+https://github.com/tonlabs/ton-labs-tl.git?tag=0.2.132#aa6b2e17e80c0d0c265e45a83dd98069acdb15a7" +version = "0.2.160" +source = "git+https://github.com/tonlabs/ton-labs-tl.git?tag=0.2.160#5d34f0936038e35e53ca12cb889687a0461e8ea3" dependencies = [ "byteorder", "extfmt", @@ -2721,9 +2803,9 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "ton_block", + "ton_block 1.9.10", "ton_tl_codegen", - "ton_types", + "ton_types 1.12.4", ] [[package]] @@ -2741,13 +2823,31 @@ dependencies = [ "num", "num-traits", "sha2 0.10.6", - "ton_types", + "ton_types 1.11.4", +] + +[[package]] +name = "ton_block" +version = "1.9.10" +source = "git+https://github.com/tonlabs/ton-labs-block.git?tag=1.9.10#c6cd729eb72994f743c7f246882fdddcbc8a0ba4" +dependencies = [ + "base64 0.13.1", + "crc 3.0.0", + "ed25519", + "ed25519-dalek", + "failure", + "hex 0.4.3", + "log", + "num", + "num-traits", + "sha2 0.10.6", + "ton_types 1.12.4", ] [[package]] name = "ton_block_json" -version = "0.7.33" -source = "git+https://github.com/tonlabs/ton-labs-block-json.git?tag=0.7.33#6b93bce23702c86992191af383095a3f1f81c98f" +version = "0.7.75" +source = "git+https://github.com/tonlabs/ton-labs-block-json.git?tag=0.7.75#1f3552c8dfaf9c62d2b41719cca678323997e361" dependencies = [ "base64 0.13.1", "failure", @@ -2758,14 +2858,14 @@ dependencies = [ "serde_derive", "serde_json", "ton_api", - "ton_block", - "ton_types", + "ton_block 1.9.10", + "ton_types 1.12.4", ] [[package]] name = "ton_client" -version = "1.38.0" -source = "git+https://github.com/tonlabs/TON-SDK.git?tag=1.38.0#c3906ea236ef3624d0349f90d4ce44ee840453bb" +version = "1.39.0" +source = "git+https://github.com/tonlabs/TON-SDK.git?tag=1.39.0#7bf013e62fced8a30dc802a1c560b385d4dd7941" dependencies = [ "aes", "api_derive", @@ -2808,34 +2908,34 @@ dependencies = [ "tokio", "tokio-stream", "tokio-tungstenite", - "ton_abi", - "ton_block", + "ton_abi 2.3.45", + "ton_block 1.9.10", "ton_block_json", "ton_executor", "ton_sdk", - "ton_types", - "ton_vm", + "ton_types 1.12.4", + "ton_vm 1.8.79", "zeroize", "zstd", ] [[package]] name = "ton_executor" -version = "1.15.89" -source = "git+https://github.com/tonlabs/ton-labs-executor.git?tag=1.15.89#d1c05320b842c944905a988d29255983155b106b" +version = "1.15.139" +source = "git+https://github.com/tonlabs/ton-labs-executor.git?tag=1.15.139#c0d93736e74cd4c869f825ccbf1e3b7e0bd215c1" dependencies = [ "failure", "lazy_static", "log", - "ton_block", - "ton_types", - "ton_vm", + "ton_block 1.9.10", + "ton_types 1.12.4", + "ton_vm 1.8.79", ] [[package]] name = "ton_labs_assembler" -version = "1.2.48" -source = "git+https://github.com/tonlabs/ton-labs-assembler.git?tag=1.2.48#31eb9bf36eed726efb8683d025cb9abf645d4183" +version = "1.2.49" +source = "git+https://github.com/tonlabs/ton-labs-assembler.git?tag=1.2.49#6a90d710814c0c373226f0d20fe7f51a17532e6a" dependencies = [ "failure", "hex 0.4.3", @@ -2844,13 +2944,13 @@ dependencies = [ "num-traits", "serde", "serde_json", - "ton_types", + "ton_types 1.11.4", ] [[package]] name = "ton_labs_assembler" -version = "1.2.49" -source = "git+https://github.com/tonlabs/ton-labs-assembler.git?tag=1.2.49#6a90d710814c0c373226f0d20fe7f51a17532e6a" +version = "1.2.74" +source = "git+https://github.com/tonlabs/ton-labs-assembler.git?tag=1.2.74#e5be73e77f3e36a8f5a31e7d6e9e9b4b04a0e3e1" dependencies = [ "failure", "hex 0.4.3", @@ -2859,13 +2959,13 @@ dependencies = [ "num-traits", "serde", "serde_json", - "ton_types", + "ton_types 1.12.4", ] [[package]] name = "ton_sdk" -version = "1.38.0" -source = "git+https://github.com/tonlabs/TON-SDK.git?tag=1.38.0#c3906ea236ef3624d0349f90d4ce44ee840453bb" +version = "1.39.0" +source = "git+https://github.com/tonlabs/TON-SDK.git?tag=1.39.0#7bf013e62fced8a30dc802a1c560b385d4dd7941" dependencies = [ "api_derive", "api_info", @@ -2882,16 +2982,16 @@ dependencies = [ "serde_derive", "serde_json", "sha2 0.9.9", - "ton_abi", - "ton_block", - "ton_types", - "ton_vm", + "ton_abi 2.3.45", + "ton_block 1.9.10", + "ton_types 1.12.4", + "ton_vm 1.8.79", ] [[package]] name = "ton_tl_codegen" version = "0.0.2" -source = "git+https://github.com/tonlabs/ton-labs-tl.git?tag=0.2.132#aa6b2e17e80c0d0c265e45a83dd98069acdb15a7" +source = "git+https://github.com/tonlabs/ton-labs-tl.git?tag=0.2.160#5d34f0936038e35e53ca12cb889687a0461e8ea3" dependencies = [ "crc 1.8.1", "failure", @@ -2923,6 +3023,26 @@ dependencies = [ "smallvec", ] +[[package]] +name = "ton_types" +version = "1.12.4" +source = "git+https://github.com/tonlabs/ton-labs-types.git?tag=1.12.4#71dbffc60d0d4cdc23d181dfbfb70701b06efe80" +dependencies = [ + "base64 0.13.1", + "crc 1.8.1", + "failure", + "hex 0.4.3", + "lazy_static", + "lockfree", + "log", + "num", + "num-derive", + "num-traits", + "rand 0.8.5", + "sha2 0.9.9", + "smallvec", +] + [[package]] name = "ton_vm" version = "1.8.44" @@ -2940,8 +3060,30 @@ dependencies = [ "rand 0.7.3", "sha2 0.9.9", "similar", - "ton_block", - "ton_types", + "ton_block 1.8.3", + "ton_types 1.11.4", + "zstd", +] + +[[package]] +name = "ton_vm" +version = "1.8.79" +source = "git+https://github.com/tonlabs/ton-labs-vm.git?tag=1.8.79#2c3cb7469e358288bff4462e92ed30937af0272b" +dependencies = [ + "diffy", + "ed25519", + "ed25519-dalek", + "failure", + "hex 0.4.3", + "lazy_static", + "log", + "num", + "num-traits", + "rand 0.7.3", + "sha2 0.10.6", + "similar", + "ton_block 1.9.10", + "ton_types 1.12.4", "zstd", ] @@ -2954,7 +3096,7 @@ dependencies = [ "base64 0.13.1", "chrono", "clap 2.34.0", - "crc16", + "crc 3.0.0", "ed25519-dalek", "failure", "futures", @@ -2964,7 +3106,7 @@ dependencies = [ "log", "num-bigint", "num-traits", - "predicates 1.0.8", + "predicates", "qr2term", "regex", "reqwest", @@ -2977,15 +3119,15 @@ dependencies = [ "string-error", "tokio", "tokio-retry", - "ton_abi", - "ton_block", + "ton_abi 2.3.45", + "ton_block 1.9.10", "ton_block_json", "ton_client", "ton_executor", - "ton_labs_assembler 1.2.48", + "ton_labs_assembler 1.2.74", "ton_sdk", - "ton_types", - "ton_vm", + "ton_types 1.12.4", + "ton_vm 1.8.79", "url", ] @@ -3063,18 +3205,18 @@ dependencies = [ "serde_json", "sha2 0.10.6", "simplelog 0.5.3", - "ton_abi", - "ton_block", + "ton_abi 2.3.7", + "ton_block 1.8.3", "ton_labs_assembler 1.2.49", - "ton_types", - "ton_vm", + "ton_types 1.11.4", + "ton_vm 1.8.44", ] [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicode-bidi" @@ -3084,9 +3226,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" [[package]] name = "unicode-normalization" @@ -3435,9 +3577,9 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" +checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" dependencies = [ "proc-macro2", "quote", @@ -3466,9 +3608,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.1+zstd.1.5.2" +version = "2.0.4+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" +checksum = "4fa202f2ef00074143e219d15b62ffc317d17cc33909feac471c044087cad7b0" dependencies = [ "cc", "libc", From c8eafaea1c995b2ffd579e32e8ea815d531213ad Mon Sep 17 00:00:00 2001 From: SergeyY <43989533+yaroslavser@users.noreply.github.com> Date: Tue, 27 Dec 2022 15:44:45 +0300 Subject: [PATCH 18/21] Update Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index beaf3978..1e77b274 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ license = 'Apache-2.0' name = 'tonos-cli' readme = 'README.md' repository = 'https://github.com/tonlabs/tonos-cli' -version = '0.29.2' +version = '0.30.1' [features] sold = ["dep:sold"] From 11e97f675e00b7486df5df49308af031c05a58ab Mon Sep 17 00:00:00 2001 From: SergeyY <43989533+yaroslavser@users.noreply.github.com> Date: Tue, 27 Dec 2022 15:45:07 +0300 Subject: [PATCH 19/21] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3661a776..e1064a28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -## Version: 0.29.2 +## Version: 0.30.1 ### New - Added the `sign` command. It makes ED25519 signature for data encoded in base64 or hex using common `--keys` option; From 296aaf140497a2d10b364885985689ac96e6889b Mon Sep 17 00:00:00 2001 From: sergeyyar Date: Tue, 27 Dec 2022 15:48:56 +0300 Subject: [PATCH 20/21] remove unwraps --- src/decode.rs | 3 ++- src/replay.rs | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/decode.rs b/src/decode.rs index 95151e97..67bf0ce1 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -362,7 +362,8 @@ async fn decode_body(body_base64: &str, abi_path: &str, is_json: bool, config: & let cell = ton_types::cells_serialization::deserialize_tree_of_cells(&mut Cursor::new(&body_vec)) .map_err(|e| format!("Failed to create cell: {}", e))?; - let orig_slice = SliceData::load_cell(cell).unwrap(); + let orig_slice = SliceData::load_cell(cell) + .map_err(|e| format!("Failed to load cell: {}", e))?; if is_external { let mut slice = orig_slice.clone(); let flag = slice.get_next_bit(); diff --git a/src/replay.rs b/src/replay.rs index 63339ad3..4c0180cc 100644 --- a/src/replay.rs +++ b/src/replay.rs @@ -357,14 +357,18 @@ pub async fn replay( } if dump_mask & DUMP_EXECUTOR_CONFIG != 0 { // config.boc suitable for creating ton-labs-executor tests - let mut config_data = SliceData::load_cell(config_account.get_data() - .ok_or("Failed to get config data")?).unwrap(); + let cell = config_account.get_data() + .ok_or("Failed to get config data")?; + let mut config_data = SliceData::load_cell(cell) + .map_err(|e| format!("Failed to load config data cell: {}", e))?; let mut cfg = BuilderData::default(); cfg.append_raw(&config_data.get_next_bytes(32) .map_err(|e| format!("Failed to read config data: {}", e))?, 256) .map_err(|e| format!("Failed to append config data: {}", e))?; - cfg.checked_append_reference(config_data.reference(0) - .map_err(|e| format!("Failed to get config zero reference: {}", e))?).unwrap(); + let cell = config_data.reference(0) + .map_err(|e| format!("Failed to get config zero reference: {}", e))?; + cfg.checked_append_reference(cell) + .map_err(|e| format!("Failed to append config reference: {}", e))?; let path = format!("config-{}-test.boc", txnid); cfg.into_cell().map_err(|e| format!("Failed to finalize builder: {}", e))? .write_to_file(&path); From 9a3238f9a9ad13585a983218a659f79d15b11a58 Mon Sep 17 00:00:00 2001 From: tonjen Date: Tue, 27 Dec 2022 13:16:40 +0000 Subject: [PATCH 21/21] Preparing to merge with the master --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 69c24a42..a2d85530 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3089,7 +3089,7 @@ dependencies = [ [[package]] name = "tonos-cli" -version = "0.29.2" +version = "0.30.1" dependencies = [ "assert_cmd", "async-trait",