Skip to content

Commit b569340

Browse files
committed
fix tests
1 parent b964ce0 commit b569340

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/utils/Base64.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { expect } = require('chai');
33
const Base64 = artifacts.require('$Base64');
44
const Base64Dirty = artifacts.require('$Base64Dirty');
55

6-
contract('Strings', function () {
6+
contract('Base64', function () {
77
beforeEach(async function () {
88
this.base64 = await Base64.new();
99
});
@@ -32,12 +32,12 @@ contract('Strings', function () {
3232
});
3333
});
3434

35-
it('Encode reads beyond the input buffer into dirty memory', async function () {
35+
it.only('Encode reads beyond the input buffer into dirty memory', async function () {
3636
const mock = await Base64Dirty.new();
37-
const buffer32 = web3.utils.soliditySha3('example');
37+
const buffer32 = Buffer.from(web3.utils.soliditySha3('example').replace(/0x/, ''), 'hex');
3838
const buffer31 = buffer32.slice(0, -2);
3939

40-
expect(await mock.encode(buffer31)).to.equal(Buffer(buffer31).toString('base64'));
41-
expect(await mock.encode(buffer32)).to.equal(Buffer(buffer32).toString('base64'));
40+
expect(await mock.encode(buffer31)).to.equal(buffer31.toString('base64'));
41+
expect(await mock.encode(buffer32)).to.equal(buffer32.toString('base64'));
4242
});
4343
});

0 commit comments

Comments
 (0)