diff --git a/ironfish/src/wallet/walletdb/accountValue.test.ts b/ironfish/src/wallet/walletdb/accountValue.test.ts index fda4eab513..686b6d7f2c 100644 --- a/ironfish/src/wallet/walletdb/accountValue.test.ts +++ b/ironfish/src/wallet/walletdb/accountValue.test.ts @@ -45,9 +45,9 @@ describe('AccountValueEncoding', () => { version: 1, createdAt: null, multiSigKeys: { - identifier: 'a', - keyPackage: 'b', - proofGenerationKey: 'c', + identifier: 'deaf', + keyPackage: 'beef', + proofGenerationKey: 'feed', }, } const buffer = encoder.serialize(value) diff --git a/ironfish/src/wallet/walletdb/accountValue.ts b/ironfish/src/wallet/walletdb/accountValue.ts index fbafdc32fb..95907331b6 100644 --- a/ironfish/src/wallet/walletdb/accountValue.ts +++ b/ironfish/src/wallet/walletdb/accountValue.ts @@ -55,9 +55,9 @@ export class AccountValueEncoding implements IDatabaseEncoding { } if (value.multiSigKeys) { - bw.writeVarString(value.multiSigKeys.identifier, 'utf8') - bw.writeVarString(value.multiSigKeys.keyPackage, 'utf8') - bw.writeVarString(value.multiSigKeys.proofGenerationKey, 'utf8') + bw.writeVarBytes(Buffer.from(value.multiSigKeys.identifier, 'hex')) + bw.writeVarBytes(Buffer.from(value.multiSigKeys.keyPackage, 'hex')) + bw.writeVarBytes(Buffer.from(value.multiSigKeys.proofGenerationKey, 'hex')) } return bw.render() @@ -87,9 +87,9 @@ export class AccountValueEncoding implements IDatabaseEncoding { let multiSigKeys = undefined if (hasMultiSigKeys) { multiSigKeys = { - identifier: reader.readVarString('utf8'), - keyPackage: reader.readVarString('utf8'), - proofGenerationKey: reader.readVarString('utf8'), + identifier: reader.readVarBytes().toString('hex'), + keyPackage: reader.readVarBytes().toString('hex'), + proofGenerationKey: reader.readVarBytes().toString('hex'), } } @@ -125,9 +125,9 @@ export class AccountValueEncoding implements IDatabaseEncoding { size += encoding.nonNullSize } if (value.multiSigKeys) { - size += bufio.sizeVarString(value.multiSigKeys.identifier, 'utf8') - size += bufio.sizeVarString(value.multiSigKeys.keyPackage, 'utf8') - size += bufio.sizeVarString(value.multiSigKeys.proofGenerationKey, 'utf8') + size += bufio.sizeVarString(value.multiSigKeys.identifier, 'hex') + size += bufio.sizeVarString(value.multiSigKeys.keyPackage, 'hex') + size += bufio.sizeVarString(value.multiSigKeys.proofGenerationKey, 'hex') } return size