Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ConsenSys/besu-tracing-plugin into …
Browse files Browse the repository at this point in the history
…add-tracer-spec-test
  • Loading branch information
macfarla committed Apr 27, 2023
2 parents 544e008 + d671a73 commit 7132d95
Show file tree
Hide file tree
Showing 17 changed files with 1,575 additions and 110 deletions.
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,18 @@ allprojects {
useJUnitPlatform()
}

task unitTests(type: Test) {
useJUnitPlatform {
excludeTags("CorsetTest")
}
}

task corsetTests(type: Test) {
useJUnitPlatform {
includeTags("CorsetTest")
}
}

javadoc {
options.addStringOption('Xdoclint:all', '-quiet')
options.addStringOption('Xwerror', '-html5')
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/net/consensys/linea/zktracer/OpCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public enum OpCode {
SGT(0x13),
EQ(0x14),
ISZERO(0x15),
// mul
MUL(0x02),
EXP(0x0a),
// shf
SHL(0x1b),
SHR(0x1c),
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/net/consensys/linea/zktracer/ZkTracer.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import net.consensys.linea.zktracer.module.ModuleTracer;
import net.consensys.linea.zktracer.module.alu.add.AddTracer;
import net.consensys.linea.zktracer.module.alu.mod.ModTracer;
import net.consensys.linea.zktracer.module.alu.mul.MulTracer;
import net.consensys.linea.zktracer.module.shf.ShfTracer;
import net.consensys.linea.zktracer.module.wcp.WcpTracer;

Expand All @@ -42,7 +43,8 @@ public ZkTracer(final ZkTraceBuilder zkTraceBuilder, final List<ModuleTracer> tr
public ZkTracer(final ZkTraceBuilder zkTraceBuilder) {
this(
zkTraceBuilder,
List.of(new ShfTracer(), new WcpTracer(), new AddTracer(), new ModTracer()));
List.of(
new MulTracer(), new ShfTracer(), new WcpTracer(), new AddTracer(), new ModTracer()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static Bytes16 leftPad(Bytes value) {
* Right pad a {@link Bytes} value with zero bytes to create a {@link Bytes16}.
*
* @param value The bytes value pad.
* @return A {@link Bytes16} that exposes the rightw-padded bytes of {@code value}.
* @return A {@link Bytes16} that exposes the right-padded bytes of {@code value}.
* @throws IllegalArgumentException if {@code value.size() > 16}.
*/
static Bytes16 rightPad(Bytes value) {
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/net/consensys/linea/zktracer/module/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,16 @@ public static UInt256 multiplyRange(Bytes[] range1, Bytes[] range2) {
}
return sum;
}
/**
* Converts a boolean value to a byte (1 for true and 0 for false).
*
* @param b The boolean value to be converted.
* @return A byte representing the input boolean value.
*/
public static byte boolToByte(boolean b) {
if (b) {
return 1;
}
return 0;
}
}
Loading

0 comments on commit 7132d95

Please sign in to comment.