Migrate ERC20 extensions tests to ethers v6 (#4773)

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: ernestognw <ernestognw@gmail.com>
This commit is contained in:
Renan Souza
2023-12-13 19:31:56 -03:00
committed by GitHub
parent 6ba452dea4
commit 88512b23d2
19 changed files with 989 additions and 1334 deletions

View File

@ -1,44 +1,52 @@
module.exports = {
EIP712Domain: [
{ name: 'name', type: 'string' },
{ name: 'version', type: 'string' },
{ name: 'chainId', type: 'uint256' },
{ name: 'verifyingContract', type: 'address' },
{ name: 'salt', type: 'bytes32' },
],
Permit: [
{ name: 'owner', type: 'address' },
{ name: 'spender', type: 'address' },
{ name: 'value', type: 'uint256' },
{ name: 'nonce', type: 'uint256' },
{ name: 'deadline', type: 'uint256' },
],
Ballot: [
{ name: 'proposalId', type: 'uint256' },
{ name: 'support', type: 'uint8' },
{ name: 'voter', type: 'address' },
{ name: 'nonce', type: 'uint256' },
],
ExtendedBallot: [
{ name: 'proposalId', type: 'uint256' },
{ name: 'support', type: 'uint8' },
{ name: 'voter', type: 'address' },
{ name: 'nonce', type: 'uint256' },
{ name: 'reason', type: 'string' },
{ name: 'params', type: 'bytes' },
],
Delegation: [
{ name: 'delegatee', type: 'address' },
{ name: 'nonce', type: 'uint256' },
{ name: 'expiry', type: 'uint256' },
],
ForwardRequest: [
{ name: 'from', type: 'address' },
{ name: 'to', type: 'address' },
{ name: 'value', type: 'uint256' },
{ name: 'gas', type: 'uint256' },
{ name: 'nonce', type: 'uint256' },
{ name: 'deadline', type: 'uint48' },
{ name: 'data', type: 'bytes' },
],
};
const { mapValues } = require('./iterate');
const formatType = schema => Object.entries(schema).map(([name, type]) => ({ name, type }));
module.exports = mapValues(
{
EIP712Domain: {
name: 'string',
version: 'string',
chainId: 'uint256',
verifyingContract: 'address',
salt: 'bytes32',
},
Permit: {
owner: 'address',
spender: 'address',
value: 'uint256',
nonce: 'uint256',
deadline: 'uint256',
},
Ballot: {
proposalId: 'uint256',
support: 'uint8',
voter: 'address',
nonce: 'uint256',
},
ExtendedBallot: {
proposalId: 'uint256',
support: 'uint8',
voter: 'address',
nonce: 'uint256',
reason: 'string',
params: 'bytes',
},
Delegation: {
delegatee: 'address',
nonce: 'uint256',
expiry: 'uint256',
},
ForwardRequest: {
from: 'address',
to: 'address',
value: 'uint256',
gas: 'uint256',
nonce: 'uint256',
deadline: 'uint48',
data: 'bytes',
},
},
formatType,
);
module.exports.formatType = formatType;