Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions avm-transpiler/src/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ impl Default for AvmInstruction {
}

/// AVM instructions may include a type tag
#[allow(clippy::upper_case_acronyms, dead_code)]
#[derive(Copy, Clone, Debug)]
pub enum AvmTypeTag {
UNINITIALIZED,
Expand Down
1 change: 1 addition & 0 deletions avm-transpiler/src/opcodes.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// All AVM opcodes
/// Keep updated with TS, cpp, and docs protocol specs!
#[allow(clippy::upper_case_acronyms, dead_code)]
#[derive(PartialEq, Copy, Clone, Debug)]
pub enum AvmOpcode {
// Compute
Expand Down
9 changes: 3 additions & 6 deletions avm-transpiler/src/transpile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ fn handle_external_call(
_ => panic!("Call instruction's success destination should be a basic MemoryAddress",),
};
avm_instrs.push(AvmInstruction {
opcode: opcode,
opcode,
// (left to right)
// * selector direct
// * success offset direct
Expand Down Expand Up @@ -735,7 +735,7 @@ fn handle_send_l2_to_l1_msg(
destinations: &Vec<ValueOrArray>,
inputs: &Vec<ValueOrArray>,
) {
if destinations.len() != 0 || inputs.len() != 2 {
if !destinations.is_empty() || inputs.len() != 2 {
panic!(
"Transpiler expects ForeignCall::SENDL2TOL1MSG to have 0 destinations and 2 inputs, got {} and {}",
destinations.len(),
Expand Down Expand Up @@ -1268,10 +1268,7 @@ pub fn map_brillig_pcs_to_avm_pcs(brillig_bytecode: &[BrilligOpcode]) -> Vec<usi
}

fn is_integral_bit_size(bit_size: u32) -> bool {
match bit_size {
1 | 8 | 16 | 32 | 64 | 128 => true,
_ => false,
}
matches!(bit_size, 1 | 8 | 16 | 32 | 64 | 128)
}

fn tag_from_bit_size(bit_size: u32) -> AvmTypeTag {
Expand Down