Skip to content

Commit

Permalink
Merge pull request #863 from tonlabs/IgorKoval/upd-deps
Browse files Browse the repository at this point in the history
upd deps
  • Loading branch information
IgorKoval authored Nov 17, 2023
2 parents 266b361 + 84f58c8 commit 1d19557
Show file tree
Hide file tree
Showing 430 changed files with 299 additions and 12,402 deletions.
422 changes: 244 additions & 178 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 6 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license-file = 'LICENSE.md'
name = 'tvm_linker'
readme = 'README.md'
repository = 'https://github.com/tonlabs/TVM-linker'
version = '0.20.6'
version = '0.21.0'

[[bin]]
name = 'tvm_linker'
Expand All @@ -19,8 +19,6 @@ path = 'src/main.rs'
base64 = '0.13'
clap = '2.33'
crc = '3.0'
ed25519 = '2.2'
ed25519-dalek = '1.0'
failure = '0.1'
hex = '0.4'
lazy_static = '1.4'
Expand All @@ -33,11 +31,11 @@ serde_json = '1.0'
sha2 = '0.10'
simplelog = '0.6'
serde = { features = [ 'derive' ], version = '1.0' }
ton_abi = { git = 'https://github.com/tonlabs/ever-abi.git', tag = '2.3.134' }
ton_block = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ever-block.git', tag = '1.9.92' }
ton_labs_assembler = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ever-assembler.git', tag = '1.2.132' }
ton_types = { git = 'https://github.com/tonlabs/ever-types.git', tag = '2.0.20' }
ton_vm = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ever-vm.git', tag = '1.8.195' }
ton_abi = { git = 'https://github.com/tonlabs/ever-abi.git', tag = '2.4.0' }
ton_block = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ever-block.git', tag = '1.9.107' }
ton_labs_assembler = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ever-assembler.git', tag = '1.4.18' }
ton_types = { git = 'https://github.com/tonlabs/ever-types.git', tag = '2.0.29' }
ton_vm = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ever-vm.git', tag = '1.8.214' }

[dev-dependencies]
assert_cmd = '2.0.5'
Expand Down
50 changes: 0 additions & 50 deletions find-dup.py

This file was deleted.

41 changes: 12 additions & 29 deletions src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@
* See the License for the specific TON DEV software governing permissions and
* limitations under the License.
*/
use abi_json::json_abi::{encode_function_call, decode_function_response};
use abi_json::Contract;
use ton_abi::{Contract, json_abi::{encode_function_call, decode_function_response}};
use failure::format_err;
use sha2::{Digest, Sha256};

use ton_types::{BuilderData, Result, SliceData};
use crate::keyman::Keypair;

pub fn build_abi_body(
abi_file: &str,
method: &str,
params: &str,
header: Option<&str>,
keypair: Option<ed25519_dalek::Keypair>,
keypair: Option<Keypair>,
internal: bool,
address: Option<String>,
) -> Result<BuilderData> {
encode_function_call(
load_abi_json_string(abi_file)?,
method.to_owned(),
header.map(|v| v.to_owned()),
params.to_owned(),
&load_abi_json_string(abi_file)?,
method,
header,
params,
internal,
keypair.as_ref(),
address,
keypair.map(|p| p.private).as_ref(),
address.as_deref(),
)
}

Expand All @@ -53,29 +53,12 @@ pub fn decode_body(
internal: bool,
) -> Result<String> {
decode_function_response(
load_abi_json_string(abi_file)?,
method.to_owned(),
&load_abi_json_string(abi_file)?,
method,
body,
internal,
false,
)
}

pub fn gen_abi_id(mut abi: Option<Contract>, func_name: &str) -> u32 {
if let Some(ref mut contract) = abi {
let functions = contract.functions();
let events = contract.events();
functions.get(func_name).map(|f| f.get_input_id())
.or_else(|| events.get(func_name).map(|e| e.get_function_id()))
.unwrap_or_else(|| calc_func_id(func_name))
} else {
calc_func_id(func_name)
}
}

fn calc_func_id(func_interface: &str) -> u32 {
let mut id_bytes = [0u8; 4];
let hash = Sha256::digest(func_interface.as_bytes());
id_bytes.copy_from_slice(&hash[..4]);
u32::from_be_bytes(id_bytes)
}
167 changes: 0 additions & 167 deletions src/disasm/codedict.rs

This file was deleted.

Loading

0 comments on commit 1d19557

Please sign in to comment.