Skip to content

Commit

Permalink
fix: trace file template ((#278)
Browse files Browse the repository at this point in the history
This puts in place a simple fix for the trace file template related to
the ability to customise the class name generated.
  • Loading branch information
DavePearce authored Oct 16, 2024
1 parent 09f17f5 commit 357e358
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/exporters/besu_trace_columns.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static List<ColumnHeader> headers(int length) {
return headers;
}

public Trace(List<MappedByteBuffer> buffers) {
public {{ class }} (List<MappedByteBuffer> buffers) {
{{ #each registers }}
this.{{ java_name }} = buffers.get({{ @index }});
{{ /each }}
Expand All @@ -66,7 +66,7 @@ public int size() {
}

{{#each columns}}
public Trace {{ this.appender }}(final {{ this.tupe }} b) {
public {{ class }} {{ this.appender }}(final {{ this.tupe }} b) {
if (filled.get({{ this.reg_id }})) {
throw new IllegalStateException("{{ this.corset_name }} already set");
} else {
Expand All @@ -79,7 +79,7 @@ public int size() {
}

{{/each}}
public Trace validateRow() {
public {{ class }} validateRow() {
{{#each registers}}
if (!filled.get({{ this.id }})) {
throw new IllegalStateException("{{ this.corset_name }} has not been filled");
Expand All @@ -92,7 +92,7 @@ public Trace validateRow() {
return this;
}

public Trace fillAndValidateRow() {
public {{ class }} fillAndValidateRow() {
{{#each registers}}
if (!filled.get({{ this.id }})) {
{{ this.java_name }}.position({{ this.java_name }}.position() + {{ this.bytes_width }});
Expand Down

0 comments on commit 357e358

Please sign in to comment.