Add uint to uint enumerable map (#3338)

This commit is contained in:
ashhanai
2022-05-20 14:31:53 +01:00
committed by GitHub
parent 6339027a7a
commit c4f76cfa15
4 changed files with 151 additions and 2 deletions

View File

@ -3,6 +3,7 @@ const { BN, constants } = require('@openzeppelin/test-helpers');
const AddressToUintMapMock = artifacts.require('AddressToUintMapMock');
const UintToAddressMapMock = artifacts.require('UintToAddressMapMock');
const Bytes32ToBytes32MapMock = artifacts.require('Bytes32ToBytes32MapMock');
const UintToUintMapMock = artifacts.require('UintToUintMapMock');
const { shouldBehaveLikeMap } = require('./EnumerableMap.behavior');
@ -55,4 +56,17 @@ contract('EnumerableMap', function (accounts) {
constants.ZERO_BYTES32,
);
});
// UintToUintMap
describe('UintToUintMap', function () {
beforeEach(async function () {
this.map = await UintToUintMapMock.new();
});
shouldBehaveLikeMap(
[ keyA, keyB, keyC ],
[ keyA, keyB, keyC ].map(k => k.add(new BN('1332'))),
new BN('0'),
);
});
});