Skip to content

Commit

Permalink
code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
sezna committed Jun 1, 2021
1 parent b59f3eb commit ab0327d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
1 change: 0 additions & 1 deletion core_lang/src/asm_generation/finalized_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ fn to_bytecode<'sc>(
half_word_ix += 2;
}
Either::Left(mut op) => {
println!("Serializing {:?}", op);
op.read(&mut buf[half_word_ix * 4..])
.expect("Failed to write to in-memory buffer.");
half_word_ix += 1;
Expand Down
1 change: 1 addition & 0 deletions core_lang/src/parse_tree/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub enum Literal<'sc> {
}

impl<'sc> Literal<'sc> {
#[allow(dead_code)]
pub(crate) fn as_type(&self) -> ResolvedType<'sc> {
use Literal::*;
match self {
Expand Down
10 changes: 2 additions & 8 deletions test_suite/src/e2e_vm_tests/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use fuel_vm_rust::interpreter::Interpreter;

/// Very basic check that code does indeed run in the VM.
/// `true` if it does, `false` if not.
pub(crate) fn runs_in_vm(file_name: &str) -> bool {
pub(crate) fn runs_in_vm(file_name: &str) {
let script = compile_to_bytes(file_name);
let gas_price = 10;
let gas_limit = 10000;
Expand All @@ -26,13 +26,7 @@ pub(crate) fn runs_in_vm(file_name: &str) -> bool {
);
let block_height = (u32::MAX >> 1) as u64;
tx.validate(block_height).unwrap();
match Interpreter::execute_tx(tx) {
Ok(_) => true,
Err(e) => {
println!("Failed: {}", e);
false
}
}
Interpreter::execute_tx(tx).unwrap();
}

/// Returns `true` if a file compiled without any errors or warnings,
Expand Down
12 changes: 3 additions & 9 deletions test_suite/src/e2e_vm_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ mod harness;

pub fn run() {
let project_names = vec!["script_1", "script_2", "script_3"];
assert!(project_names.into_iter().all(|name| {
let result = crate::e2e_vm_tests::harness::runs_in_vm(name);
if !result {
println!("E2E Failure: {} should have run in the VM.", name);
false
} else {
true
}
}));
project_names.into_iter().for_each(|name| {
crate::e2e_vm_tests::harness::runs_in_vm(name);
});
}

0 comments on commit ab0327d

Please sign in to comment.