diff --git a/CHANGELOG.md b/CHANGELOG.md index 7372bf738..ae92953c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` as opposed to just `PendingChange`. diff --git a/concordium-sdk/src/main/java/com/concordium/sdk/responses/AccountIndex.java b/concordium-sdk/src/main/java/com/concordium/sdk/responses/AccountIndex.java index fc186f846..fc446ac60 100644 --- a/concordium-sdk/src/main/java/com/concordium/sdk/responses/AccountIndex.java +++ b/concordium-sdk/src/main/java/com/concordium/sdk/responses/AccountIndex.java @@ -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