Skip to content

Commit

Permalink
make fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow authored and Sixtysixter committed Sep 10, 2024
1 parent 3edf401 commit 57af2ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions silkworm/rpc/core/evm_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void DebugTracer::on_execution_start(evmc_revision rev, const evmc_message& msg,
const evmc::address sender(msg.sender);

if (!logs_.empty()) {
auto &log = logs_[logs_.size() - 1]; // it should be a CALL* opcode
auto& log = logs_[logs_.size() - 1]; // it should be a CALL* opcode
log.gas_cost_check = msg.gas_cost;
}

Expand Down Expand Up @@ -190,12 +190,12 @@ void DebugTracer::on_instruction_start(uint32_t pc, const intx::uint256* stack_t
}

if (!logs_.empty()) {
auto &log = logs_[logs_.size() - 1];
auto& log = logs_[logs_.size() - 1];

if (log.opcode == OP_RETURN || log.opcode == OP_STOP || log.opcode == OP_REVERT) {
log.gas_cost_check = 0;
} else if (log.depth == execution_state.msg->depth + 1) { //if (log.opcode != OP_CALL && log.opcode != OP_CALLCODE && log.opcode != OP_STATICCALL && log.opcode != OP_DELEGATECALL && log.opcode != OP_CREATE && log.opcode != OP_CREATE2) {
log.gas_cost_check = execution_state.last_opcode_gas_cost;
} else if (log.depth == execution_state.msg->depth + 1) { // if (log.opcode != OP_CALL && log.opcode != OP_CALLCODE && log.opcode != OP_STATICCALL && log.opcode != OP_DELEGATECALL && log.opcode != OP_CREATE && log.opcode != OP_CREATE2) {
log.gas_cost_check = execution_state.last_opcode_gas_cost;
}
}

Expand Down Expand Up @@ -406,7 +406,7 @@ void DebugTracer::write_log(const DebugLog& log) {
stream_.open_object();
stream_.write_field("depth", log.depth);
stream_.write_field("gas", log.gas);
// stream_.write_field("gasCost", log.gas_cost);
// stream_.write_field("gasCost", log.gas_cost);
stream_.write_field("gasCost", log.gas_cost_check);
stream_.write_field("op", log.op);
stream_.write_field("pc", log.pc);
Expand Down
2 changes: 1 addition & 1 deletion silkworm/rpc/core/evm_debug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class DebugTracer : public EvmTracer {
const char* const* opcode_names_ = nullptr;
const evmc_instruction_metrics* metrics_ = nullptr;
std::stack<std::int64_t> start_gas_;
// std::int64_t gas_cost_;
// std::int64_t gas_cost_;
std::optional<FixCallGasInfo> fix_call_gas_info_;
std::optional<uint8_t> last_opcode_;
};
Expand Down

0 comments on commit 57af2ad

Please sign in to comment.