@@ -175,13 +175,12 @@ impl<DB: Database> JournaledStateTrait for JournaledState<DB> {
175
175
}
176
176
177
177
impl < DB : Database > JournaledState < DB > {
178
- /// Create new JournaledState.
178
+ /// Creates new JournaledState.
179
179
///
180
- /// warm_preloaded_addresses is used to determine if address is considered warm loaded.
180
+ /// ` warm_preloaded_addresses` is used to determine if address is considered warm loaded.
181
181
/// In ordinary case this is precompile or beneficiary.
182
182
///
183
183
/// # Note
184
- ///
185
184
/// This function will journal state after Spurious Dragon fork.
186
185
/// And will not take into account if account is not existing or empty.
187
186
pub fn new ( spec : SpecId , database : DB ) -> JournaledState < DB > {
@@ -259,8 +258,9 @@ impl<DB: Database> JournaledState<DB> {
259
258
account. info . code = Some ( code) ;
260
259
}
261
260
262
- /// use it only if you know that acc is warm
263
- /// Assume account is warm
261
+ /// Use it only if you know that acc is warm.
262
+ ///
263
+ /// Assume account is warm.
264
264
#[ inline]
265
265
pub fn set_code ( & mut self , address : Address , code : Bytecode ) {
266
266
let hash = code. hash_slow ( ) ;
@@ -336,7 +336,7 @@ impl<DB: Database> JournaledState<DB> {
336
336
Ok ( None )
337
337
}
338
338
339
- /// Create account or return false if collision is detected.
339
+ /// Creates account or returns false if collision is detected.
340
340
///
341
341
/// There are few steps done:
342
342
/// 1. Make created account warm loaded (AccessList) and this should
@@ -421,7 +421,7 @@ impl<DB: Database> JournaledState<DB> {
421
421
Ok ( checkpoint)
422
422
}
423
423
424
- /// Revert all changes that happened in given journal entries.
424
+ /// Reverts all changes that happened in given journal entries.
425
425
#[ inline]
426
426
fn journal_revert (
427
427
state : & mut EvmState ,
@@ -540,7 +540,7 @@ impl<DB: Database> JournaledState<DB> {
540
540
checkpoint
541
541
}
542
542
543
- /// Commit the checkpoint.
543
+ /// Commits the checkpoint.
544
544
#[ inline]
545
545
pub fn checkpoint_commit ( & mut self ) {
546
546
self . depth -= 1 ;
@@ -572,14 +572,14 @@ impl<DB: Database> JournaledState<DB> {
572
572
self . journal . truncate ( checkpoint. journal_i ) ;
573
573
}
574
574
575
- /// Performances selfdestruct action.
575
+ /// Performs selfdestruct action.
576
576
/// Transfers balance from address to target. Check if target exist/is_cold
577
577
///
578
578
/// Note: Balance will be lost if address and target are the same BUT when
579
579
/// current spec enables Cancun, this happens only when the account associated to address
580
580
/// is created in the same tx
581
581
///
582
- /// references :
582
+ /// # References :
583
583
/// * <https://github.com/ethereum/go-ethereum/blob/141cd425310b503c5678e674a8c3872cf46b7086/core/vm/instructions.go#L832-L833>
584
584
/// * <https://github.com/ethereum/go-ethereum/blob/141cd425310b503c5678e674a8c3872cf46b7086/core/state/statedb.go#L449>
585
585
/// * <https://eips.ethereum.org/EIPS/eip-6780>
@@ -675,7 +675,7 @@ impl<DB: Database> JournaledState<DB> {
675
675
Ok ( account)
676
676
}
677
677
678
- /// load account into memory. return if it is cold or warm accessed
678
+ /// Loads account into memory. return if it is cold or warm accessed
679
679
#[ inline]
680
680
pub fn load_account ( & mut self , address : Address ) -> Result < StateLoad < & mut Account > , DB :: Error > {
681
681
self . load_account_optional ( address, false )
@@ -707,7 +707,7 @@ impl<DB: Database> JournaledState<DB> {
707
707
self . load_account_optional ( address, true )
708
708
}
709
709
710
- /// Loads code.
710
+ /// Loads code
711
711
#[ inline]
712
712
pub fn load_account_optional (
713
713
& mut self ,
@@ -762,7 +762,7 @@ impl<DB: Database> JournaledState<DB> {
762
762
Ok ( load)
763
763
}
764
764
765
- /// Load storage slot
765
+ /// Loads storage slot.
766
766
///
767
767
/// # Panics
768
768
///
@@ -805,11 +805,10 @@ impl<DB: Database> JournaledState<DB> {
805
805
}
806
806
807
807
/// Stores storage slot.
808
- /// And returns (original,present,new) slot value.
809
808
///
810
- /// Note:
809
+ /// And returns (original,present,new) slot value.
811
810
///
812
- /// account should already be present in our state.
811
+ /// **Note**: Account should already be present in our state.
813
812
#[ inline]
814
813
pub fn sstore (
815
814
& mut self ,
@@ -909,7 +908,7 @@ impl<DB: Database> JournaledState<DB> {
909
908
}
910
909
}
911
910
912
- /// push log into subroutine
911
+ /// Pushes log into subroutine.
913
912
#[ inline]
914
913
pub fn log ( & mut self , log : Log ) {
915
914
self . logs . push ( log) ;
0 commit comments