Add new EnumerableMap types (#4843)

Co-authored-by: ernestognw <ernestognw@gmail.com>
This commit is contained in:
Hadrien Croubois
2024-01-22 20:25:01 +01:00
committed by GitHub
parent e5c63635e3
commit a5c4cd8182
6 changed files with 417 additions and 52 deletions

View File

@ -8,12 +8,10 @@ const formatType = (keyType, valueType) => ({
valueType,
});
const TYPES = [
['uint256', 'uint256'],
['uint256', 'address'],
['address', 'uint256'],
['bytes32', 'uint256'],
].map(args => formatType(...args));
const TYPES = ['uint256', 'address', 'bytes32']
.flatMap((key, _, array) => array.map(value => [key, value]))
.slice(0, -1) // remove bytes32 → byte32 (last one) that is already defined
.map(args => formatType(...args));
module.exports = {
TYPES,