1
- const { ethers, network } = require ( 'hardhat' ) ;
1
+ const { ethers, eip2935 } = require ( 'hardhat' ) ;
2
2
const { expect } = require ( 'chai' ) ;
3
- const { loadFixture, mineUpTo } = require ( '@nomicfoundation/hardhat-network-helpers' ) ;
3
+ const { loadFixture, mineUpTo, setCode } = require ( '@nomicfoundation/hardhat-network-helpers' ) ;
4
4
const { impersonate } = require ( '../helpers/account' ) ;
5
5
6
- const HISTORY_STORAGE_ADDRESS = '0x0000F90827F1C53a10cb7A02335B175320002935' ;
7
6
const SYSTEM_ADDRESS = '0xfffffffffffffffffffffffffffffffffffffffe' ;
8
7
const HISTORY_SERVE_WINDOW = 8191 ;
9
8
const BLOCKHASH_SERVE_WINDOW = 256 ;
@@ -25,10 +24,9 @@ describe('Blockhash', function () {
25
24
describe ( `${ supported ? 'supported' : 'unsupported' } chain` , function ( ) {
26
25
beforeEach ( async function ( ) {
27
26
if ( supported ) {
28
- await this . systemSigner . sendTransaction ( { to : HISTORY_STORAGE_ADDRESS , data : this . latestBlock . hash } ) ;
27
+ await this . systemSigner . sendTransaction ( { to : eip2935 , data : this . latestBlock . hash } ) ;
29
28
} else {
30
- // `setCode` in hardhat-network-helpers doesn't support empty code :/
31
- await network . provider . request ( { method : 'hardhat_setCode' , params : [ HISTORY_STORAGE_ADDRESS , '0x' ] } ) ;
29
+ await setCode ( eip2935 . target , '0x' ) ;
32
30
}
33
31
} ) ;
34
32
0 commit comments