diff --git a/packages/guardian-crypto/src/transactions/guardian-group-permissions.ts b/packages/guardian-crypto/src/transactions/guardian-group-permissions.ts index ec1a270c..eeb6f666 100644 --- a/packages/guardian-crypto/src/transactions/guardian-group-permissions.ts +++ b/packages/guardian-crypto/src/transactions/guardian-group-permissions.ts @@ -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()); diff --git a/packages/guardian-crypto/src/transactions/guardian-user-permissions.ts b/packages/guardian-crypto/src/transactions/guardian-user-permissions.ts index bd414cc3..ae8711d4 100644 --- a/packages/guardian-crypto/src/transactions/guardian-user-permissions.ts +++ b/packages/guardian-crypto/src/transactions/guardian-user-permissions.ts @@ -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")); } }