Skip to content

Commit

Permalink
fix(guardian-crypto): deserializing strings (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
amacar authored Mar 23, 2021
1 parent ee2ecdb commit 7989451
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class GuardianGroupPermissionsTransaction extends Transactions.Transactio
const { data } = this;

const nameLength: number = buf.readUint8();
const name: string = buf.readString(nameLength);
const name: string = buf.readBytes(nameLength).toBuffer().toString("utf8");
const priority = buf.readUInt32();
const active = Boolean(buf.readUint8());
const isDefault = Boolean(buf.readUint8());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class GuardianUserPermissionsTransaction extends Transactions.Transaction
setUserPermissions.groupNames = [];
for (let i = 0; i < numOfGroupNames; i++) {
const groupNameLength: number = buf.readUint8();
setUserPermissions.groupNames.push(buf.readString(groupNameLength));
setUserPermissions.groupNames.push(buf.readBytes(groupNameLength).toBuffer().toString("utf8"));
}
}

Expand Down

0 comments on commit 7989451

Please sign in to comment.