@ -137,6 +137,7 @@ module.exports = {
. selectAccount ( '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' ) // this account will be used for this test suite
. selectAccount ( '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' ) // this account will be used for this test suite
. click ( '#runTabView button[class^="instanceButton"]' )
. click ( '#runTabView button[class^="instanceButton"]' )
. waitForElementPresent ( '.instance:nth-of-type(2)' )
. waitForElementPresent ( '.instance:nth-of-type(2)' )
. click ( '*[data-id="deployAndRunClearInstances"]' )
} ,
} ,
'Should Compile and Deploy a contract which define a custom error, the error should be logged in the terminal' : function ( browser : NightwatchBrowser ) {
'Should Compile and Deploy a contract which define a custom error, the error should be logged in the terminal' : function ( browser : NightwatchBrowser ) {
@ -144,8 +145,7 @@ module.exports = {
. clickLaunchIcon ( 'udapp' )
. clickLaunchIcon ( 'udapp' )
. selectAccount ( '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' ) // this account will be used for this test suite
. selectAccount ( '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' ) // this account will be used for this test suite
. click ( '#runTabView button[class^="instanceButton"]' )
. click ( '#runTabView button[class^="instanceButton"]' )
. waitForElementPresent ( '.instance:nth-of-type(3)' )
. clickInstance ( 0 )
. click ( '.instance:nth-of-type(3) > div > button' )
. clickFunction ( 'g - transact (not payable)' )
. clickFunction ( 'g - transact (not payable)' )
. pause ( 5000 )
. pause ( 5000 )
. journalLastChildIncludes ( 'Error provided by the contract:' )
. journalLastChildIncludes ( 'Error provided by the contract:' )
@ -158,6 +158,7 @@ module.exports = {
. journalLastChildIncludes ( '"documentation": "param2"' )
. journalLastChildIncludes ( '"documentation": "param2"' )
. journalLastChildIncludes ( '"documentation": "param3"' )
. journalLastChildIncludes ( '"documentation": "param3"' )
. journalLastChildIncludes ( 'Debug the transaction to get more information.' )
. journalLastChildIncludes ( 'Debug the transaction to get more information.' )
. click ( '*[data-id="deployAndRunClearInstances"]' )
} ,
} ,
'Should Compile and Deploy a contract which define a custom error, the error should be logged in the terminal , using London VM Fork' : function ( browser : NightwatchBrowser ) {
'Should Compile and Deploy a contract which define a custom error, the error should be logged in the terminal , using London VM Fork' : function ( browser : NightwatchBrowser ) {
@ -165,8 +166,7 @@ module.exports = {
. click ( '*[data-id="settingsVMLondonMode"]' ) // switch to London fork
. click ( '*[data-id="settingsVMLondonMode"]' ) // switch to London fork
. selectAccount ( '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' ) // this account will be used for this test suite
. selectAccount ( '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' ) // this account will be used for this test suite
. click ( '#runTabView button[class^="instanceButton"]' )
. click ( '#runTabView button[class^="instanceButton"]' )
. waitForElementPresent ( '.instance:nth-of-type(2)' )
. clickInstance ( 0 )
. click ( '.instance:nth-of-type(2) > div > button' )
. clickFunction ( 'g - transact (not payable)' )
. clickFunction ( 'g - transact (not payable)' )
. journalLastChildIncludes ( 'Error provided by the contract:' )
. journalLastChildIncludes ( 'Error provided by the contract:' )
. journalLastChildIncludes ( 'CustomError : error description' )
. journalLastChildIncludes ( 'CustomError : error description' )
@ -178,6 +178,25 @@ module.exports = {
. journalLastChildIncludes ( '"documentation": "param2"' )
. journalLastChildIncludes ( '"documentation": "param2"' )
. journalLastChildIncludes ( '"documentation": "param3"' )
. journalLastChildIncludes ( '"documentation": "param3"' )
. journalLastChildIncludes ( 'Debug the transaction to get more information.' )
. journalLastChildIncludes ( 'Debug the transaction to get more information.' )
} ,
'Should Compile and Deploy a contract which define a custom error in a library, the error should be logged in the terminal' : function ( browser : NightwatchBrowser ) {
browser . testContracts ( 'customErrorLib.sol' , sources [ 5 ] [ 'customErrorLib.sol' ] , [ 'D' ] )
. clickLaunchIcon ( 'udapp' )
. click ( '#runTabView button[class^="instanceButton"]' )
. clickInstance ( 1 )
. clickFunction ( 'h - transact (not payable)' )
. pause ( 5000 )
. journalLastChildIncludes ( 'Error provided by the contract:' )
. journalLastChildIncludes ( 'CustomError : error description from library' )
. journalLastChildIncludes ( 'Parameters:' )
. journalLastChildIncludes ( '"value": "48"' )
. journalLastChildIncludes ( '"value": "46"' )
. journalLastChildIncludes ( '"value": "error_string_from_library"' )
. journalLastChildIncludes ( '"documentation": "param1 from library"' )
. journalLastChildIncludes ( '"documentation": "param2 from library"' )
. journalLastChildIncludes ( '"documentation": "param3 from library"' )
. journalLastChildIncludes ( 'Debug the transaction to get more information.' )
. end ( )
. end ( )
}
}
}
}
@ -281,5 +300,29 @@ contract C {
}
}
} `
} `
}
}
} ,
{
'customErrorLib.sol' : {
content : ` // SPDX-License-Identifier: GPL-3.0
pragma solidity ^ 0.8 . 7 ;
library lib {
/// error description from library
/// @param a param1 from library
/// @param b param2 from library
/// @param c param3 from library
error CustomError ( uint a , uint b , string c ) ;
function set ( ) public {
revert CustomError ( 48 , 46 , "error_string_from_library" ) ;
}
}
contract D {
function h ( ) public {
lib . set ( ) ;
}
} `
}
}
}
]
]