Skip to content

Commit d6ee4d9

Browse files
committed
core/state: drop Journal-prefix on journal methods
1 parent 2a2c432 commit d6ee4d9

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

core/state/journal.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,30 +148,30 @@ func (j *journal) copy() *journal {
148148
}
149149
}
150150

151-
func (j *journal) JournalAccessListAddAccount(addr common.Address) {
151+
func (j *journal) AccessListAddAccount(addr common.Address) {
152152
j.append(accessListAddAccountChange{&addr})
153153
}
154154

155-
func (j *journal) JournalAccessListAddSlot(addr common.Address, slot common.Hash) {
155+
func (j *journal) AccessListAddSlot(addr common.Address, slot common.Hash) {
156156
j.append(accessListAddSlotChange{
157157
address: &addr,
158158
slot: &slot,
159159
})
160160
}
161161

162-
func (j *journal) JournalLog(txHash common.Hash) {
162+
func (j *journal) Log(txHash common.Hash) {
163163
j.append(addLogChange{txhash: txHash})
164164
}
165165

166-
func (j *journal) JournalCreate(addr common.Address) {
166+
func (j *journal) Create(addr common.Address) {
167167
j.append(createObjectChange{account: &addr})
168168
}
169169

170-
func (j *journal) JournalDestruct(addr common.Address) {
170+
func (j *journal) Destruct(addr common.Address) {
171171
j.append(selfDestructChange{account: &addr})
172172
}
173173

174-
func (j *journal) JournalSetState(addr common.Address, key, prev, origin common.Hash) {
174+
func (j *journal) SetStorage(addr common.Address, key, prev, origin common.Hash) {
175175
j.append(storageChange{
176176
account: &addr,
177177
key: key,
@@ -180,37 +180,37 @@ func (j *journal) JournalSetState(addr common.Address, key, prev, origin common.
180180
})
181181
}
182182

183-
func (j *journal) JournalSetTransientState(addr common.Address, key, prev common.Hash) {
183+
func (j *journal) SetTransientState(addr common.Address, key, prev common.Hash) {
184184
j.append(transientStorageChange{
185185
account: &addr,
186186
key: key,
187187
prevalue: prev,
188188
})
189189
}
190190

191-
func (j *journal) JournalRefundChange(previous uint64) {
191+
func (j *journal) RefundChange(previous uint64) {
192192
j.append(refundChange{prev: previous})
193193
}
194194

195-
func (j *journal) JournalBalanceChange(addr common.Address, previous *uint256.Int) {
195+
func (j *journal) BalanceChange(addr common.Address, previous *uint256.Int) {
196196
j.append(balanceChange{
197197
account: &addr,
198198
prev: previous.Clone(),
199199
})
200200
}
201201

202-
func (j *journal) JournalSetCode(address common.Address) {
202+
func (j *journal) SetCode(address common.Address) {
203203
j.append(codeChange{account: &address})
204204
}
205205

206-
func (j *journal) JournalNonceChange(address common.Address, prev uint64) {
206+
func (j *journal) NonceChange(address common.Address, prev uint64) {
207207
j.append(nonceChange{
208208
account: &address,
209209
prev: prev,
210210
})
211211
}
212212

213-
func (j *journal) JournalTouch(address common.Address) {
213+
func (j *journal) Touch(address common.Address) {
214214
j.append(touchChange{
215215
account: &address,
216216
})

core/state/state_object.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (s *stateObject) markSelfdestructed() {
114114
}
115115

116116
func (s *stateObject) touch() {
117-
s.db.journal.JournalTouch(s.address)
117+
s.db.journal.Touch(s.address)
118118
}
119119

120120
// getTrie returns the associated storage trie. The trie will be opened if it's
@@ -244,7 +244,7 @@ func (s *stateObject) SetState(key, value common.Hash) {
244244
return
245245
}
246246
// New value is different, update and journal the change
247-
s.db.journal.JournalSetState(s.address, key, prev, origin)
247+
s.db.journal.SetStorage(s.address, key, prev, origin)
248248
s.setState(key, value, origin)
249249
if s.db.logger != nil && s.db.logger.OnStorageChange != nil {
250250
s.db.logger.OnStorageChange(s.address, key, prev, value)
@@ -498,7 +498,7 @@ func (s *stateObject) SubBalance(amount *uint256.Int, reason tracing.BalanceChan
498498
}
499499

500500
func (s *stateObject) SetBalance(amount *uint256.Int, reason tracing.BalanceChangeReason) {
501-
s.db.journal.JournalBalanceChange(s.address, s.data.Balance)
501+
s.db.journal.BalanceChange(s.address, s.data.Balance)
502502
if s.db.logger != nil && s.db.logger.OnBalanceChange != nil {
503503
s.db.logger.OnBalanceChange(s.address, s.Balance().ToBig(), amount.ToBig(), reason)
504504
}
@@ -574,7 +574,7 @@ func (s *stateObject) CodeSize() int {
574574
}
575575

576576
func (s *stateObject) SetCode(codeHash common.Hash, code []byte) {
577-
s.db.journal.JournalSetCode(s.address)
577+
s.db.journal.SetCode(s.address)
578578
if s.db.logger != nil && s.db.logger.OnCodeChange != nil {
579579
// TODO remove prevcode from this callback
580580
s.db.logger.OnCodeChange(s.address, common.BytesToHash(s.CodeHash()), nil, codeHash, code)
@@ -589,7 +589,7 @@ func (s *stateObject) setCode(codeHash common.Hash, code []byte) {
589589
}
590590

591591
func (s *stateObject) SetNonce(nonce uint64) {
592-
s.db.journal.JournalNonceChange(s.address, s.data.Nonce)
592+
s.db.journal.NonceChange(s.address, s.data.Nonce)
593593
if s.db.logger != nil && s.db.logger.OnNonceChange != nil {
594594
s.db.logger.OnNonceChange(s.address, s.data.Nonce, nonce)
595595
}

core/state/statedb.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func (s *StateDB) Error() error {
248248
}
249249

250250
func (s *StateDB) AddLog(log *types.Log) {
251-
s.journal.JournalLog(s.thash)
251+
s.journal.Log(s.thash)
252252

253253
log.TxHash = s.thash
254254
log.TxIndex = uint(s.txIndex)
@@ -293,14 +293,14 @@ func (s *StateDB) Preimages() map[common.Hash][]byte {
293293

294294
// AddRefund adds gas to the refund counter
295295
func (s *StateDB) AddRefund(gas uint64) {
296-
s.journal.JournalRefundChange(s.refund)
296+
s.journal.RefundChange(s.refund)
297297
s.refund += gas
298298
}
299299

300300
// SubRefund removes gas from the refund counter.
301301
// This method will panic if the refund counter goes below zero
302302
func (s *StateDB) SubRefund(gas uint64) {
303-
s.journal.JournalRefundChange(s.refund)
303+
s.journal.RefundChange(s.refund)
304304
if gas > s.refund {
305305
panic(fmt.Sprintf("Refund counter below zero (gas: %d > refund: %d)", gas, s.refund))
306306
}
@@ -508,7 +508,7 @@ func (s *StateDB) SelfDestruct(addr common.Address) {
508508
// If it is already marked as self-destructed, we do not need to add it
509509
// for journalling a second time.
510510
if !stateObject.selfDestructed {
511-
s.journal.JournalDestruct(addr)
511+
s.journal.Destruct(addr)
512512
stateObject.markSelfdestructed()
513513
}
514514
}
@@ -531,7 +531,7 @@ func (s *StateDB) SetTransientState(addr common.Address, key, value common.Hash)
531531
if prev == value {
532532
return
533533
}
534-
s.journal.JournalSetTransientState(addr, key, prev)
534+
s.journal.SetTransientState(addr, key, prev)
535535
s.setTransientState(addr, key, value)
536536
}
537537

@@ -650,7 +650,7 @@ func (s *StateDB) getOrNewStateObject(addr common.Address) *stateObject {
650650
// existing account with the given address, otherwise it will be silently overwritten.
651651
func (s *StateDB) createObject(addr common.Address) *stateObject {
652652
obj := newObject(s, addr, nil)
653-
s.journal.JournalCreate(addr)
653+
s.journal.Create(addr)
654654
s.setStateObject(obj)
655655
return obj
656656
}
@@ -1387,7 +1387,7 @@ func (s *StateDB) Prepare(rules params.Rules, sender, coinbase common.Address, d
13871387
// AddAddressToAccessList adds the given address to the access list
13881388
func (s *StateDB) AddAddressToAccessList(addr common.Address) {
13891389
if s.accessList.AddAddress(addr) {
1390-
s.journal.JournalAccessListAddAccount(addr)
1390+
s.journal.AccessListAddAccount(addr)
13911391
}
13921392
}
13931393

@@ -1399,10 +1399,10 @@ func (s *StateDB) AddSlotToAccessList(addr common.Address, slot common.Hash) {
13991399
// scope of 'address' without having the 'address' become already added
14001400
// to the access list (via call-variant, create, etc).
14011401
// Better safe than sorry, though
1402-
s.journal.JournalAccessListAddAccount(addr)
1402+
s.journal.AccessListAddAccount(addr)
14031403
}
14041404
if slotMod {
1405-
s.journal.JournalAccessListAddSlot(addr, slot)
1405+
s.journal.AccessListAddSlot(addr, slot)
14061406
}
14071407
}
14081408

core/state/statedb_fuzz_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func newStateTestAction(addr common.Address, r *rand.Rand, index int) testAction
7373
args: make([]int64, 1),
7474
},
7575
{
76-
name: "SetState",
76+
name: "SetStorage",
7777
fn: func(a testAction, s *StateDB) {
7878
var key, val common.Hash
7979
binary.BigEndian.PutUint16(key[:], uint16(a.args[0]))

core/state/statedb_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ func newTestAction(addr common.Address, r *rand.Rand) testAction {
360360
args: make([]int64, 1),
361361
},
362362
{
363-
name: "SetState",
363+
name: "SetStorage",
364364
fn: func(a testAction, s *StateDB) {
365365
var key, val common.Hash
366366
binary.BigEndian.PutUint16(key[:], uint16(a.args[0]))

0 commit comments

Comments
 (0)