Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zjma committed Feb 22, 2024
1 parent 76f7eca commit 388350f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 2 additions & 0 deletions aptos-move/aptos-vm/src/aptos_vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1671,6 +1671,7 @@ impl AptosVM {
None,
))
});

let mut gas_meter = UnmeteredGasMeter;
let mut session = self.new_session(resolver, SessionId::block_meta(&block_metadata));

Expand Down Expand Up @@ -1772,6 +1773,7 @@ impl AptosVM {
ExecutionStatus::Success,
&get_or_vm_startup_failure(&self.storage_gas_params, log_context)?.change_set_configs,
)?;

Ok((VMStatus::Executed, output))
}

Expand Down
3 changes: 0 additions & 3 deletions aptos-move/framework/aptos-framework/sources/block.move
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ module aptos_framework::block {
use std::vector;
use std::option;
use std::option::Option;
use std::string::utf8;
use aptos_std::debug;
use aptos_framework::randomness;

use aptos_framework::account;
Expand Down Expand Up @@ -174,7 +172,6 @@ module aptos_framework::block {
let epoch_interval = block_prologue_common(&vm, hash, epoch, round, proposer, failed_proposer_indices, previous_block_votes_bitvec, timestamp);
randomness::on_new_block(&vm, epoch, round, option::none());
if (timestamp - reconfiguration::last_reconfiguration_time() >= epoch_interval) {
debug::print(&utf8(b"epoch time out"));
reconfiguration::reconfigure();
};
}
Expand Down
14 changes: 8 additions & 6 deletions aptos-move/framework/src/natives/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ fn native_print(
debug_assert!(ty_args.is_empty());
debug_assert!(args.len() == 1);

let val = safely_pop_arg!(args, Struct);
let bytes = val.unpack()?.next().unwrap();
if cfg!(feature = "testing") {
let val = safely_pop_arg!(args, Struct);
let bytes = val.unpack()?.next().unwrap();

println!(
"[debug] {}",
std::str::from_utf8(&bytes.value_as::<Vec<u8>>()?).unwrap()
);
println!(
"[debug] {}",
std::str::from_utf8(&bytes.value_as::<Vec<u8>>()?).unwrap()
);
}

Ok(smallvec![])
}
Expand Down

0 comments on commit 388350f

Please sign in to comment.