Skip to content

Commit

Permalink
test lint + Changelog entry
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed Jan 15, 2021
1 parent 2b69162 commit b75705e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
* `ERC20Permit`: added an implementation of the ERC20 permit extension for gasless token approvals. ([#2237](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2237))
* Presets: added token presets with preminted fixed supply `ERC20PresetFixedSupply` and `ERC777PresetFixedSupply`. ([#2399](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2399))
* `Address`: added `functionDelegateCall`, similar to the existing `functionCall`. ([#2333](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2333))
* `Context`: moved from `contracts/GSN` to `contracts/utils`. ([#2453](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2453))
* `Context`: moved from `contracts/GSN` to `contracts/utils`. ([#2453](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2453))
* `PaymentSplitter`: replace usage of `.transfer()` with `Address.sendValue` for improved compatibility with smart wallets. ([#2455](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2455))
* `UpgradeableProxy`: bubble revert reasons from initialization calls. ([#2454](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2454))
* `UpgradeableProxy`: bubble revert reasons from initialization calls. ([#2454](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2454))
* `SafeMath`: fix a memory allocation issue by adding new `SafeMath.tryXXX(uint,uint)→(bool,uint)` function. `SafeMath.XXX(uint,uint,string)→(uint)` are not deprecated. ([#2462](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2462))
* `EnumerableMap`: fix a memory allocation issue by adding new `EnumerableMap.tryGet(uint)→(bool,address)` function. `SafeMath.get(uint)→(string)` is now deprecated. ([#2462](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2462))

## 3.3.0 (2020-11-26)

Expand Down
15 changes: 7 additions & 8 deletions test/utils/EnumerableMap.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,33 +150,32 @@ contract('EnumerableMap', function (accounts) {
expect(await this.map.get(keyA)).to.be.equal(accountA);
});
it('missing value', async function () {
await expectRevert(this.map.get(keyB), "EnumerableMap: nonexistent key");
await expectRevert(this.map.get(keyB), 'EnumerableMap: nonexistent key');
});
});

describe('get with message', function () {
it('existing value', async function () {
expect(await this.map.getWithMessage(keyA, "custom error string")).to.be.equal(accountA);
expect(await this.map.getWithMessage(keyA, 'custom error string')).to.be.equal(accountA);
});
it('missing value', async function () {
await expectRevert(this.map.getWithMessage(keyB, "custom error string"), "custom error string");
await expectRevert(this.map.getWithMessage(keyB, 'custom error string'), 'custom error string');
});
});

describe('tryGet', function () {
it('existing value', async function () {
expect(await this.map.tryGet(keyA)).to.be.deep.equal({
'0': true,
'1': accountA
0: true,
1: accountA,
});
});
it('missing value', async function () {
expect(await this.map.tryGet(keyB)).to.be.deep.equal({
'0': false,
'1': constants.ZERO_ADDRESS
0: false,
1: constants.ZERO_ADDRESS,
});
});
});

});
});

0 comments on commit b75705e

Please sign in to comment.