Skip to content

Commit

Permalink
fix borsh writes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpe7s committed Sep 11, 2024
1 parent 5b30a07 commit 06aa2f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/software/sava/core/borsh/Borsh.java
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ static int write(final Borsh[][] array, final byte[] data, final int offset) {
}

static int write(final Borsh val, final byte[] data, final int offset) {
return 1 + val.write(data, offset + 1);
return val.write(data, offset);
}

static int len(final Borsh val) {
Expand All @@ -1030,7 +1030,7 @@ static int writeOptional(final Borsh val, final byte[] data, final int offset) {
return 1;
} else {
data[offset] = (byte) 1;
return write(val, data, offset);
return 1 + write(val, data, offset + 1);
}
}
}

0 comments on commit 06aa2f4

Please sign in to comment.