@@ -619,8 +619,8 @@ impl TopLevelState {
619619 debug_assert_eq ! ( Ok ( false ) , self . regular_account_exists_and_not_null( a) ) ;
620620
621621 let db = TrieFactory :: readonly ( self . db . as_hashdb ( ) , & self . root ) ?;
622- let from_db = || self . db . get_cached_account ( & a) ;
623- self . account . require_item_or_from ( & a, db, from_db )
622+ let from_global_cache = || self . db . get_cached_account ( & a) ;
623+ self . account . require_item_or_from ( & a, db, from_global_cache )
624624 }
625625
626626 /// Check caches for required data
@@ -638,35 +638,35 @@ impl TopLevelState {
638638 fn require_regular_account ( & self , public : & Public ) -> TrieResult < RefMut < RegularAccount > > {
639639 let regular_account_address = RegularAccountAddress :: new ( public) ;
640640 let db = TrieFactory :: readonly ( self . db . as_hashdb ( ) , & self . root ) ?;
641- let from_db = || self . db . get_cached_regular_account ( & regular_account_address) ;
642- self . regular_account . require_item_or_from ( & regular_account_address, db, from_db )
641+ let from_global_cache = || self . db . get_cached_regular_account ( & regular_account_address) ;
642+ self . regular_account . require_item_or_from ( & regular_account_address, db, from_global_cache )
643643 }
644644
645645 fn require_regular_account_from_address ( & self , a : & Address ) -> TrieResult < RefMut < RegularAccount > > {
646646 let regular_account_address = RegularAccountAddress :: from_address ( a) ;
647647 let db = TrieFactory :: readonly ( self . db . as_hashdb ( ) , & self . root ) ?;
648- let from_db = || self . db . get_cached_regular_account ( & regular_account_address) ;
649- self . regular_account . require_item_or_from ( & regular_account_address, db, from_db )
648+ let from_global_cache = || self . db . get_cached_regular_account ( & regular_account_address) ;
649+ self . regular_account . require_item_or_from ( & regular_account_address, db, from_global_cache )
650650 }
651651
652652 fn require_metadata ( & self ) -> TrieResult < RefMut < Metadata > > {
653653 let db = TrieFactory :: readonly ( self . db . as_hashdb ( ) , & self . root ) ?;
654654 let address = MetadataAddress :: new ( ) ;
655- let from_db = || self . db . get_cached_metadata ( & address) ;
656- self . metadata . require_item_or_from ( & address, db, from_db )
655+ let from_global_cache = || self . db . get_cached_metadata ( & address) ;
656+ self . metadata . require_item_or_from ( & address, db, from_global_cache )
657657 }
658658
659659 fn require_shard ( & self , shard_id : ShardId ) -> TrieResult < RefMut < Shard > > {
660660 let db = TrieFactory :: readonly ( self . db . as_hashdb ( ) , & self . root ) ?;
661661 let shard_address = ShardAddress :: new ( shard_id) ;
662- let from_db = || self . db . get_cached_shard ( & shard_address) ;
663- self . shard . require_item_or_from ( & shard_address, db, from_db )
662+ let from_global_cache = || self . db . get_cached_shard ( & shard_address) ;
663+ self . shard . require_item_or_from ( & shard_address, db, from_global_cache )
664664 }
665665
666666 fn require_action_data ( & self , key : & H256 ) -> TrieResult < RefMut < ActionData > > {
667667 let db = TrieFactory :: readonly ( self . db . as_hashdb ( ) , & self . root ) ?;
668- let from_db = || self . db . get_cached_action_data ( key) ;
669- self . action_data . require_item_or_from ( key, db, from_db )
668+ let from_global_cache = || self . db . get_cached_action_data ( key) ;
669+ self . action_data . require_item_or_from ( key, db, from_global_cache )
670670 }
671671}
672672
0 commit comments