@@ -16,7 +16,7 @@ use mainsail_evm_core::{
1616 logs_bloom,
1717 receipt:: { TxReceipt , map_execution_result} ,
1818 state_changes:: AccountUpdate ,
19- state_commit, state_hash ,
19+ state_commit, state_root ,
2020} ;
2121use napi:: { JsBigInt , JsObject , JsString , bindgen_prelude:: * } ;
2222use napi_derive:: napi;
@@ -801,7 +801,7 @@ impl EvmInner {
801801 }
802802 }
803803
804- pub fn state_hash (
804+ pub fn state_root (
805805 & mut self ,
806806 commit_key : CommitKey ,
807807 current_hash : B256 ,
@@ -811,12 +811,12 @@ impl EvmInner {
811811 . get_mut ( & commit_key)
812812 . expect ( "pending commit exists" ) ;
813813
814- let result = state_hash :: calculate ( & mut self . persistent_db , pending_commit, current_hash) ;
814+ let result = state_root :: calculate ( & mut self . persistent_db , pending_commit, current_hash) ;
815815
816816 match result {
817817 Ok ( result) => Ok ( result. encode_hex ( ) ) ,
818818 Err ( err) => Err ( EVMError :: Database (
819- format ! ( "state_hash failed: {}" , err) . into ( ) ,
819+ format ! ( "state_root failed: {}" , err) . into ( ) ,
820820 ) ) ,
821821 }
822822 }
@@ -1454,7 +1454,7 @@ impl JsEvmWrapper {
14541454 }
14551455
14561456 #[ napi( ts_return_type = "Promise<string>" ) ]
1457- pub fn state_hash (
1457+ pub fn state_root (
14581458 & mut self ,
14591459 node_env : Env ,
14601460 commit_key : JsCommitKey ,
@@ -1463,7 +1463,7 @@ impl JsEvmWrapper {
14631463 let commit_key = CommitKey :: try_from ( commit_key) ?;
14641464 let current_hash = utils:: convert_string_to_b256 ( current_hash) ?;
14651465 node_env. execute_tokio_future (
1466- Self :: state_hash_async ( self . evm . clone ( ) , commit_key, current_hash) ,
1466+ Self :: state_root_async ( self . evm . clone ( ) , commit_key, current_hash) ,
14671467 |& mut node_env, result| Ok ( node_env. create_string_from_std ( result) ?) ,
14681468 )
14691469 }
@@ -1786,13 +1786,13 @@ impl JsEvmWrapper {
17861786 }
17871787 }
17881788
1789- async fn state_hash_async (
1789+ async fn state_root_async (
17901790 evm : Arc < tokio:: sync:: Mutex < EvmInner > > ,
17911791 commit_key : CommitKey ,
17921792 current_hash : B256 ,
17931793 ) -> Result < String > {
17941794 let mut lock = evm. lock ( ) . await ;
1795- let result = lock. state_hash ( commit_key, current_hash) ;
1795+ let result = lock. state_root ( commit_key, current_hash) ;
17961796
17971797 match result {
17981798 Ok ( result) => Result :: Ok ( result) ,
0 commit comments