Skip to content

Commit

Permalink
Merge pull request #2150 from CortexFoundation/dev
Browse files Browse the repository at this point in the history
core/state: get rid of field pointer in journal mdl
  • Loading branch information
ucwong authored Sep 9, 2024
2 parents 49a004f + 46a80ae commit 4e97a0f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions core/state/journal_mdl.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import (

type (
uploadChange struct {
account *common.Address
account common.Address
prev *big.Int
}
numChange struct {
account *common.Address
account common.Address
prev *big.Int
}
)
Expand All @@ -47,31 +47,31 @@ func (ch numChange) copy() journalEntry {
}

func (ch uploadChange) revert(s *StateDB) {
s.getStateObject(*ch.account).setUpload(ch.prev)
s.getStateObject(ch.account).setUpload(ch.prev)
}

func (ch uploadChange) dirtied() *common.Address {
return ch.account
return &ch.account
}

func (ch numChange) revert(s *StateDB) {
s.getStateObject(*ch.account).setNum(ch.prev)
s.getStateObject(ch.account).setNum(ch.prev)
}

func (ch numChange) dirtied() *common.Address {
return ch.account
return &ch.account
}

func (j *journal) uploadChange(addr common.Address, previous *big.Int) {
j.append(uploadChange{
account: &addr,
account: addr,
prev: new(big.Int).Set(previous),
})
}

func (j *journal) numChange(addr common.Address, previous *big.Int) {
j.append(numChange{
account: &addr,
account: addr,
prev: new(big.Int).Set(previous),
})
}

0 comments on commit 4e97a0f

Please sign in to comment.