Release v5.3 cherrypick #3 (#5572)

Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
Hadrien Croubois
2025-03-17 11:29:32 +01:00
committed by GitHub
parent d4b2e98c73
commit bfdbb67ebc
5 changed files with 10 additions and 288 deletions

View File

@ -1,16 +1,12 @@
const { capitalize } = require('../../helpers');
const mapType = ({ type, size }) => [type == 'uint256' ? 'Uint' : capitalize(type), size].filter(Boolean).join('x');
const mapType = str => (str == 'uint256' ? 'Uint' : capitalize(str));
const formatType = ({ type, size = undefined }) => ({
name: `${mapType({ type, size })}Set`,
type: size != undefined ? `${type}[${size}]` : type,
base: size != undefined ? type : undefined,
size,
const formatType = type => ({
name: `${mapType(type)}Set`,
type,
});
const TYPES = [{ type: 'bytes32' }, { type: 'bytes32', size: 2 }, { type: 'address' }, { type: 'uint256' }].map(
formatType,
);
const TYPES = ['bytes32', 'address', 'uint256'].map(formatType);
module.exports = { TYPES, formatType };