File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -393,6 +393,8 @@ where
393
393
// `revert` and `require` calls with a reason string can be detected.
394
394
395
395
const GANACHE_VM_EXECUTION_ERROR : i64 = -32000 ;
396
+ const GANACHE_REVERT_MESSAGE : & str =
397
+ "VM Exception while processing transaction: revert" ;
396
398
const PARITY_VM_EXECUTION_ERROR : i64 = -32015 ;
397
399
const PARITY_REVERT_PREFIX : & str = "Reverted 0x" ;
398
400
@@ -444,7 +446,8 @@ where
444
446
445
447
// Check for Ganache revert.
446
448
Err ( web3:: Error :: Rpc ( ref rpc_error) )
447
- if rpc_error. code . code ( ) == GANACHE_VM_EXECUTION_ERROR =>
449
+ if rpc_error. code . code ( ) == GANACHE_VM_EXECUTION_ERROR
450
+ && rpc_error. message == GANACHE_REVERT_MESSAGE =>
448
451
{
449
452
Err ( EthereumContractCallError :: Revert (
450
453
rpc_error. message . clone ( ) ,
You can’t perform that action at this time.
0 commit comments