Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Strings.toHexString function #2504

Merged
merged 15 commits into from
Feb 8, 2021
Prev Previous commit
fix test
  • Loading branch information
frangio committed Feb 8, 2021
commit c73fc6b7e73b950be05d6b4292f53479ff51503e
8 changes: 5 additions & 3 deletions test/utils/Strings.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { constants } = require('@openzeppelin/test-helpers');
const { constants, expectRevert } = require('@openzeppelin/test-helpers');

const { expect } = require('chai');

Expand Down Expand Up @@ -45,8 +45,10 @@ contract('Strings', function (accounts) {
});

it('converts a positive number (short)', async function () {
expect(await this.strings.fromUint256HexFixed(0x4132, 1))
.to.equal('0x32');
await expectRevert(
this.strings.fromUint256HexFixed(0x4132, 1),
'Strings: hex length insufficient',
);
});

it('converts MAX_UINT256', async function () {
Expand Down