Skip to content

Commit

Permalink
Merge pull request #326 from Concordium/bugfix-issue-324
Browse files Browse the repository at this point in the history
Removed `tag` field from CustomEvent
  • Loading branch information
magnusbechwind authored Mar 6, 2024
2 parents f913623 + de875a6 commit 76951be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 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
- Fixed a bug in `CustomEvent`. Removed unnecessary `tag` field.
- Added `Web3IdProof` class with `getWeb3IdProof` method to create Presentations. (And supporting classes)
- Fixed an issue where `ConcordiumHdWallet.fromSeedPhrase` always produced an invalid seed as hex.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ public static Cis2Event deserializeCis2Event(byte[] eventBytes) {
case TOKEN_METADATA:
return SerializationUtils.deserializeTokenMetadataEvent(buffer);
case CUSTOM:
return SerializationUtils.deserializeCustomEvent(tag, buffer);
return SerializationUtils.deserializeCustomEvent(buffer);
}
throw new IllegalArgumentException("Malformed CIS2 event");
}

private static Cis2Event deserializeCustomEvent(byte tag, ByteBuffer buffer) {
return new CustomEvent(tag, buffer.array());
private static Cis2Event deserializeCustomEvent(ByteBuffer buffer) {
return new CustomEvent(buffer.array());
}

@SneakyThrows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
@Getter
public class CustomEvent implements Cis2Event {

private final byte tag;
private final byte[] data;

public CustomEvent(byte tag, byte[] data) {
this.tag = tag;
public CustomEvent(byte[] data) {
this.data = data;
}

Expand Down

0 comments on commit 76951be

Please sign in to comment.