Add Strings.toHexString(bytes) (#5761)

This commit is contained in:
Hadrien Croubois
2025-07-09 22:20:46 +02:00
committed by GitHub
parent fd9bbaec30
commit a5350ecdd3
3 changed files with 33 additions and 0 deletions

View File

@ -186,6 +186,17 @@ describe('Strings', function () {
});
});
describe('bytes', function () {
describe('toHexString', function () {
for (const length of [0, 17, 20, 32, 42, 64, 512]) {
const input = ethers.hexlify(ethers.randomBytes(length));
it(`hexlify buffer of length ${length}`, async function () {
expect(await this.mock.getFunction('$toHexString(bytes)')(input)).to.equal(input);
});
}
});
});
describe('equal', function () {
it('compares two empty strings', async function () {
expect(await this.mock.$equal('', '')).to.be.true;