diff --git a/CHANGELOG.md b/CHANGELOG.md index fefb05c..ac11902 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## Version 1.8.0 + +- Add ton opcodes +- cargo clippy --fix + ## Version 1.7.0 - Add ton commands. @@ -68,4 +73,4 @@ All notable changes to this project will be documented in this file. ## Version 1.2.90 -- Supported ever-types version 2.0 +- Supported ever-types version 2.0 \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 6b5f1cf..390c4b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ build = 'build.rs' edition = '2021' name = 'ever_assembler' -version = '1.7.1' +version = '1.8.0' [dependencies] anyhow = '1.0' diff --git a/src/bin/disasm.rs b/src/bin/disasm.rs index 8bbb6a5..4287ba5 100644 --- a/src/bin/disasm.rs +++ b/src/bin/disasm.rs @@ -160,7 +160,7 @@ fn subcommand_text(filename: String, stateinit: bool, full: bool) -> Status { println!("warning: boc contains {} roots, getting the first one", roots_count) } - let root0 = roots.get(0) + let root0 = roots.first() .ok_or_else(|| error!("failed to get root 0"))?; let cell = if stateinit { root0.reference(0)? diff --git a/src/disasm/fmt.rs b/src/disasm/fmt.rs index 2f00967..2c21625 100644 --- a/src/disasm/fmt.rs +++ b/src/disasm/fmt.rs @@ -56,7 +56,7 @@ fn print_code_dict(cell: &Cell, key_size: usize, indent: &str) -> Result } fn print_dictpushconst(insn: &Instruction, indent: &str) -> String { - let key_length = if let Some(InstructionParameter::Length(l)) = insn.params().get(0) { + let key_length = if let Some(InstructionParameter::Length(l)) = insn.params().first() { *l } else { unreachable!() @@ -138,7 +138,7 @@ impl Code { continue } "IMPLICIT-JMP" => { - if let Some(InstructionParameter::Code { code, cell }) = insn.params().get(0) { + if let Some(InstructionParameter::Code { code, cell }) = insn.params().first() { let hash = cell.as_ref().unwrap().repr_hash().to_hex_string(); text += &format!(".cell {{ ;; #{}\n", hash); let inner_indent = String::from(" ") + indent; @@ -167,7 +167,7 @@ impl Code { } } -fn print_insn_params(params: &Vec, indent: &str, full: bool, bytecode_width: usize) -> String { +fn print_insn_params(params: &[InstructionParameter], indent: &str, full: bool, bytecode_width: usize) -> String { use InstructionParameter::*; let mut text = String::new(); diff --git a/src/disasm/tests.rs b/src/disasm/tests.rs index c3ec0f3..d456f73 100644 --- a/src/disasm/tests.rs +++ b/src/disasm/tests.rs @@ -64,7 +64,7 @@ fn round_trip_test(filename: &str, check_bin: bool) -> Status { println!("{}", asm0); print_tree_of_cells(&toc0); print_tree_of_cells(&toc1); - assert!(false); + unreachable!(); } } Ok(()) diff --git a/src/simple.rs b/src/simple.rs index d635423..f5d6caf 100644 --- a/src/simple.rs +++ b/src/simple.rs @@ -876,11 +876,19 @@ impl Engine { simple_commands! { enumerate_ton_commands - STORAGEFEES => 0xF8, 0x2C + GASCONSUMED => 0xF8, 0x07 + SENDMSG => 0xFB, 0x08 INCOMINGVALUE => 0xF8, 0x2B - DUEPAYMENT => 0xF8, 0x2F - SENDMSG => 0xFB, 0x08 + STORAGEFEES => 0xF8, 0x2C + DUEPAYMENT => 0xF8, 0x2F + GETGASFEE => 0xF8, 0x36 + GETSTORAGEFEE => 0xF8, 0x37 + GETFORWARDFEE => 0xF8, 0x38 + GETPRECOMPILEDGAS => 0xF8, 0x39 + GETORIGINALFWDFEE => 0xF8, 0x3A + GETGASFEESIMPLE => 0xF8, 0x3B + GETFORWARDFEESIMPLE => 0xF8, 0x3C MULADDDIVMOD => 0xA9, 0x80 MULADDDIVMODR => 0xA9, 0x81