Skip to content

Commit

Permalink
Merge pull request #272 from everx-labs/IgorKoval/ton
Browse files Browse the repository at this point in the history
ton
  • Loading branch information
tonjen authored Oct 20, 2024
1 parent a415e4f commit 0567ffa
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build = 'build.rs'
edition = '2021'
name = 'ever_assembler'
version = '1.7.1'
version = '1.8.0'

[dependencies]
anyhow = '1.0'
Expand Down
2 changes: 1 addition & 1 deletion src/bin/disasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?
Expand Down
6 changes: 3 additions & 3 deletions src/disasm/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn print_code_dict(cell: &Cell, key_size: usize, indent: &str) -> Result<String>
}

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!()
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -167,7 +167,7 @@ impl Code {
}
}

fn print_insn_params(params: &Vec<InstructionParameter>, 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();
Expand Down
2 changes: 1 addition & 1 deletion src/disasm/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down
14 changes: 11 additions & 3 deletions src/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0567ffa

Please sign in to comment.