@@ -38,6 +38,8 @@ function shouldSupportDifferentTransactions({
3838 fromWei,
3939 getTransactionCount,
4040 getBalance,
41+ getCode,
42+ keccak256,
4143 getGasUsed,
4244 testedTxObjProps,
4345 checkTxObj,
@@ -323,6 +325,24 @@ function shouldSupportDifferentTransactions({
323325
324326 gasCosts . should . be . equal ( gasPrice * gasUsed ) ;
325327 } ) ;
328+
329+ if ( ! ownerIsRecognizedContract ) {
330+ it ( 'deploys proxy which matches factory specs' , async ( ) => {
331+ const cpkFactory = await CPKFactory . deployed ( ) ;
332+ const idPrecompile = `0x${ '0' . repeat ( 39 ) } 4` ;
333+ await cpk . execTransactions ( [ {
334+ operation : CPK . CALL ,
335+ to : idPrecompile ,
336+ value : 0 ,
337+ data : '0x' ,
338+ } ] , { gasLimit : defaultGasLimit } ) ;
339+ const proxyRuntimeCode = await getCode ( cpk . address ) ;
340+ await cpkFactory . proxyRuntimeCode ( )
341+ . should . eventually . equal ( proxyRuntimeCode ) ;
342+ await cpkFactory . proxyRuntimeCodeHash ( )
343+ . should . eventually . equal ( keccak256 ( proxyRuntimeCode ) ) ;
344+ } ) ;
345+ }
326346 } ) ;
327347}
328348
@@ -340,6 +360,8 @@ function shouldWorkWithWeb3(Web3, defaultAccount, safeOwner, gnosisSafeProviderB
340360 testedTxObjProps : 'the PromiEvent for the transaction and the hash' ,
341361 getBalance : ( address ) => web3Box [ 0 ] . eth . getBalance ( address )
342362 . then ( ( balance ) => web3Box [ 0 ] . utils . toBN ( balance ) ) ,
363+ getCode : ( address ) => web3Box [ 0 ] . eth . getCode ( address ) ,
364+ keccak256 : ( hex ) => web3Box [ 0 ] . utils . keccak256 ( hex ) ,
343365 getGasUsed : ( { promiEvent } ) => new Promise (
344366 ( resolve , reject ) => promiEvent
345367 . on ( 'confirmation' , ( confNumber , receipt ) => resolve ( receipt . gasUsed ) )
@@ -462,6 +484,8 @@ function shouldWorkWithEthers(ethers, defaultAccount, safeOwner, gnosisSafeProvi
462484 getGasUsed : async ( { transactionResponse } ) => (
463485 await transactionResponse . wait ( )
464486 ) . gasUsed . toNumber ( ) ,
487+ getCode : ( address ) => signer . provider . getCode ( address ) ,
488+ keccak256 : ( hex ) => ethers . utils . keccak256 ( hex ) ,
465489 testedTxObjProps : 'the TransactionResponse and the hash' ,
466490 checkTxObj : ( { transactionResponse, hash } ) => {
467491 should . exist ( transactionResponse ) ;
0 commit comments