diff --git a/src/smartcontracts/code.spec.ts b/src/smartcontracts/code.spec.ts index 0fa090df..1a5f3d94 100644 --- a/src/smartcontracts/code.spec.ts +++ b/src/smartcontracts/code.spec.ts @@ -32,6 +32,7 @@ describe("Code Class Tests", function() { const code = Code.fromHex(sampleHex); const hash = code.computeHash(); - assert.instanceOf(hash, Hash); + assert.instanceOf(hash, Buffer); + assert.equal(hash.toString('hex'), 'ac86b78afd9bdda3641a47a4aff2a7ee26acd40cc534d63655e9dfbf3f890a02') }); }); diff --git a/src/smartcontracts/code.ts b/src/smartcontracts/code.ts index bd069387..54c540a3 100644 --- a/src/smartcontracts/code.ts +++ b/src/smartcontracts/code.ts @@ -38,11 +38,11 @@ export class Code { return Buffer.from(this.hex, "hex"); } - computeHash(): Hash { + computeHash(): Buffer { const hash = createHasher(CODE_HASH_LENGTH) .update(this.valueOf()) - .digest('hex') + .digest(); - return new Hash(hash) + return Buffer.from(hash) } }