Skip to content

Commit

Permalink
fix conflict with js toString method
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed Apr 15, 2020
1 parent 4eab8fc commit 51cb947
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contracts/mocks/StringsMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.6.0;
import "../utils/Strings.sol";

contract StringsMock {
function toString(uint256 value) public pure returns (string memory) {
function fromUint256(uint256 value) public pure returns (string memory) {
return Strings.toString(value);
}
}
6 changes: 3 additions & 3 deletions test/utils/Strings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ describe('Strings', function () {

describe('from uint256', function () {
it('converts 0', async function () {
expect(await this.strings.toString(0)).to.equal('0');
expect(await this.strings.fromUint256(0)).to.equal('0');
});

it('converts a positive number', async function () {
expect(await this.strings.toString(4132)).to.equal('4132');
expect(await this.strings.fromUint256(4132)).to.equal('4132');
});

it('converts MAX_UINT256', async function () {
expect(await this.strings.toString(constants.MAX_UINT256)).to.equal(constants.MAX_UINT256.toString());
expect(await this.strings.fromUint256(constants.MAX_UINT256)).to.equal(constants.MAX_UINT256.toString());
});
});
});

0 comments on commit 51cb947

Please sign in to comment.