forked from OpenZeppelin/openzeppelin-contracts
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate ERC20 extensions tests to ethers v6 (OpenZeppelin#4773)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com> Co-authored-by: ernestognw <ernestognw@gmail.com>
- Loading branch information
1 parent
6ba452d
commit 88512b2
Showing
19 changed files
with
1,046 additions
and
1,391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.