Refactor EnumerableSet generation and tests (#4762)

This commit is contained in:
Renan Souza
2023-11-28 23:51:58 +00:00
committed by GitHub
parent 74e396a967
commit c411700572
4 changed files with 60 additions and 93 deletions

View File

@ -0,0 +1,10 @@
const mapType = str => (str == 'uint256' ? 'Uint' : `${str.charAt(0).toUpperCase()}${str.slice(1)}`);
const formatType = type => ({
name: `${mapType(type)}Set`,
type,
});
const TYPES = ['bytes32', 'address', 'uint256'].map(formatType);
module.exports = { TYPES, formatType };