Skip to content

Commit

Permalink
Fix bug in AccountIndex serialization. (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
MilkywayPirate authored Feb 6, 2024
1 parent f337f03 commit 0411b87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

# Unreleased changes
- Fix a bug in the serialization of `AccountIndex`
- Fix a bug that caused `getAccountInfo` to fail for delegator and baker accounts if they had no stake pending changes.
This change is also propagated to the type level such that `Baker` and `AccountDelegation` retains an `Optional<PendingChange>`
as opposed to just `PendingChange`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ public static AccountIndex from(DelegatorId delegatorId) {
}

public byte[] getBytes() {
val buffer = ByteBuffer.allocate(UInt16.BYTES);
buffer.put(index.getBytes());
return buffer.array();
return this.index.getBytes();
}

@Override
Expand Down

0 comments on commit 0411b87

Please sign in to comment.