Skip to content

Commit

Permalink
Fix Trace.java template (#270)
Browse files Browse the repository at this point in the history
This fixes the `Trace.java` template for modules which have no columns.
Previously, this was generating malformed java in that case.
  • Loading branch information
DavePearce committed Oct 15, 2024
1 parent 39a4b98 commit 0d0b53b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/exporters/besu_trace_columns.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.math.BigInteger;
import java.nio.MappedByteBuffer;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.List;

Expand All @@ -43,10 +44,11 @@ public class Trace {
{{/each}}

static List<ColumnHeader> headers(int length) {
return List.of(
{{ #each registers }}
new ColumnHeader("{{ this.corset_name }}", {{ this.bytes_width }}, length){{ #if @last }});{{ else }},{{ /if }}
{{ /each }}
List<ColumnHeader> headers = new ArrayList<>();
{{ #each registers }}
headers.add(new ColumnHeader("{{ this.corset_name }}", {{ this.bytes_width }}, length));
{{ /each }}
return headers;
}

public Trace(List<MappedByteBuffer> buffers) {
Expand Down

0 comments on commit 0d0b53b

Please sign in to comment.