Migrate EIP712 to ethersjs (#4750)

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: ernestognw <ernestognw@gmail.com>
This commit is contained in:
Renan Souza
2023-11-23 04:40:12 +00:00
committed by GitHub
parent 9702b67ce1
commit 6a56b3b08d
9 changed files with 145 additions and 123 deletions

View File

@ -7,16 +7,14 @@ const ethSigUtil = require('eth-sig-util');
const Wallet = require('ethereumjs-wallet').default;
const { shouldBehaveLikeEIP6372 } = require('./EIP6372.behavior');
const { getDomain, domainType } = require('../../helpers/eip712');
const {
getDomain,
domainType,
types: { Delegation },
} = require('../../helpers/eip712');
const { clockFromReceipt } = require('../../helpers/time');
const { expectRevertCustomError } = require('../../helpers/customError');
const Delegation = [
{ name: 'delegatee', type: 'address' },
{ name: 'nonce', type: 'uint256' },
{ name: 'expiry', type: 'uint256' },
];
const buildAndSignDelegation = (contract, message, pk) =>
getDomain(contract)
.then(domain => ({