mirror of
https://github.com/vacp2p/status-linea-besu.git
synced 2026-01-08 23:08:15 -05:00
Merge branch 'main' into zkbesu
This commit is contained in:
@@ -14,8 +14,6 @@
|
||||
*/
|
||||
package org.hyperledger.besu.evm.tracing;
|
||||
|
||||
import static com.google.common.base.Strings.padStart;
|
||||
|
||||
import org.hyperledger.besu.evm.code.OpcodeInfo;
|
||||
import org.hyperledger.besu.evm.frame.ExceptionalHaltReason;
|
||||
import org.hyperledger.besu.evm.frame.MessageFrame;
|
||||
@@ -224,7 +222,7 @@ public class StandardJsonTracer implements OperationTracer {
|
||||
.append("\"");
|
||||
} else if (messageFrame.getRevertReason().isPresent()) {
|
||||
sb.append(",\"error\":\"")
|
||||
.append(quoteEscape(messageFrame.getRevertReason().orElse(Bytes.EMPTY)))
|
||||
.append(messageFrame.getRevertReason().get().toHexString())
|
||||
.append("\"");
|
||||
}
|
||||
|
||||
@@ -232,37 +230,6 @@ public class StandardJsonTracer implements OperationTracer {
|
||||
out.println(sb);
|
||||
}
|
||||
|
||||
private static String quoteEscape(final Bytes bytes) {
|
||||
final StringBuilder result = new StringBuilder(bytes.size());
|
||||
for (final byte b : bytes.toArrayUnsafe()) {
|
||||
final int c = Byte.toUnsignedInt(b);
|
||||
// list from RFC-4627 section 2
|
||||
if (c == '"') {
|
||||
result.append("\\\"");
|
||||
} else if (c == '\\') {
|
||||
result.append("\\\\");
|
||||
} else if (c == '/') {
|
||||
result.append("\\/");
|
||||
} else if (c == '\b') {
|
||||
result.append("\\b");
|
||||
} else if (c == '\f') {
|
||||
result.append("\\f");
|
||||
} else if (c == '\n') {
|
||||
result.append("\\n");
|
||||
} else if (c == '\r') {
|
||||
result.append("\\r");
|
||||
} else if (c == '\t') {
|
||||
result.append("\\t");
|
||||
} else if (c <= 0x1F) {
|
||||
result.append("\\u");
|
||||
result.append(padStart(Integer.toHexString(c), 4, '0'));
|
||||
} else {
|
||||
result.append((char) b);
|
||||
}
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tracePrecompileCall(
|
||||
final MessageFrame frame, final long gasRequirement, final Bytes output) {
|
||||
|
||||
@@ -32,7 +32,6 @@ import org.hyperledger.besu.evm.worldstate.WorldUpdater;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.math.BigInteger;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Deque;
|
||||
import java.util.List;
|
||||
|
||||
@@ -208,9 +207,7 @@ public class EvmToyCommand implements Runnable {
|
||||
out.println(messageFrame.getExceptionalHaltReason().get());
|
||||
}
|
||||
if (messageFrame.getRevertReason().isPresent()) {
|
||||
out.println(
|
||||
new String(
|
||||
messageFrame.getRevertReason().get().toArrayUnsafe(), StandardCharsets.UTF_8));
|
||||
out.println(messageFrame.getRevertReason().get().toHexString());
|
||||
}
|
||||
}
|
||||
if (messageFrameStack.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user