Skip to content

Commit 3f86bfc

Browse files
committed
deprecate: mark journal entry functions as deprecated
Deprecate `nonce_bump_journal_entry` and `caller_accounting_journal_entry` functions in JournalTr trait and implementations. Closes #3365
1 parent f3b74d4 commit 3f86bfc

4 files changed

Lines changed: 10 additions & 0 deletions

File tree

crates/context/interface/src/journaled_state.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ pub trait JournalTr {
139139
) -> Option<TransferError>;
140140

141141
/// Increments the balance of the account.
142+
#[deprecated]
142143
fn caller_accounting_journal_entry(
143144
&mut self,
144145
address: Address,
@@ -154,6 +155,7 @@ pub trait JournalTr {
154155
) -> Result<(), <Self::Database as Database>::Error>;
155156

156157
/// Increments the nonce of the account.
158+
#[deprecated]
157159
fn nonce_bump_journal_entry(&mut self, address: Address);
158160

159161
/// Loads the account.

crates/context/src/journal.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ impl<DB: Database, ENTRY: JournalEntryTr> JournalTr for Journal<DB, ENTRY> {
225225
}
226226

227227
#[inline]
228+
#[allow(deprecated)]
228229
fn caller_accounting_journal_entry(
229230
&mut self,
230231
address: Address,
@@ -248,6 +249,7 @@ impl<DB: Database, ENTRY: JournalEntryTr> JournalTr for Journal<DB, ENTRY> {
248249

249250
/// Increments the nonce of the account.
250251
#[inline]
252+
#[allow(deprecated)]
251253
fn nonce_bump_journal_entry(&mut self, address: Address) {
252254
self.inner.nonce_bump_journal_entry(address)
253255
}

crates/context/src/journal/inner.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ impl<ENTRY: JournalEntryTr> JournalInner<ENTRY> {
270270

271271
/// Add journal entry for caller accounting.
272272
#[inline]
273+
#[deprecated]
273274
pub fn caller_accounting_journal_entry(
274275
&mut self,
275276
address: Address,
@@ -305,6 +306,7 @@ impl<ENTRY: JournalEntryTr> JournalInner<ENTRY> {
305306

306307
/// Increments the nonce of the account.
307308
#[inline]
309+
#[deprecated]
308310
pub fn nonce_bump_journal_entry(&mut self, address: Address) {
309311
self.journal.push(ENTRY::nonce_bumped(address));
310312
}

examples/cheatcode_inspector/src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,14 @@ impl JournalTr for Backend {
235235
self.journaled_state.finalize()
236236
}
237237

238+
#[allow(deprecated)]
238239
fn caller_accounting_journal_entry(
239240
&mut self,
240241
address: Address,
241242
old_balance: U256,
242243
bump_nonce: bool,
243244
) {
245+
#[allow(deprecated)]
244246
self.journaled_state
245247
.caller_accounting_journal_entry(address, old_balance, bump_nonce)
246248
}
@@ -253,7 +255,9 @@ impl JournalTr for Backend {
253255
self.journaled_state.balance_incr(address, balance)
254256
}
255257

258+
#[allow(deprecated)]
256259
fn nonce_bump_journal_entry(&mut self, address: Address) {
260+
#[allow(deprecated)]
257261
self.journaled_state.nonce_bump_journal_entry(address)
258262
}
259263

0 commit comments

Comments
 (0)