Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/state: Modify parameter name. #16398

Merged
merged 1 commit into from
Mar 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ func (self *StateDB) GetCodeHash(addr common.Address) common.Hash {
return common.BytesToHash(stateObject.CodeHash())
}

func (self *StateDB) GetState(a common.Address, b common.Hash) common.Hash {
stateObject := self.getStateObject(a)
func (self *StateDB) GetState(addr common.Address, bhash common.Hash) common.Hash {
stateObject := self.getStateObject(addr)
if stateObject != nil {
return stateObject.GetState(self.db, b)
return stateObject.GetState(self.db, bhash)
}
return common.Hash{}
}
Expand All @@ -250,8 +250,8 @@ func (self *StateDB) Database() Database {

// StorageTrie returns the storage trie of an account.
// The return value is a copy and is nil for non-existent accounts.
func (self *StateDB) StorageTrie(a common.Address) Trie {
stateObject := self.getStateObject(a)
func (self *StateDB) StorageTrie(addr common.Address) Trie {
stateObject := self.getStateObject(addr)
if stateObject == nil {
return nil
}
Expand All @@ -271,15 +271,15 @@ func (self *StateDB) HasSuicided(addr common.Address) bool {
* SETTERS
*/

// AddBalance adds amount to the account associated with addr
// AddBalance adds amount to the account associated with addr.
func (self *StateDB) AddBalance(addr common.Address, amount *big.Int) {
stateObject := self.GetOrNewStateObject(addr)
if stateObject != nil {
stateObject.AddBalance(amount)
}
}

// SubBalance subtracts amount from the account associated with addr
// SubBalance subtracts amount from the account associated with addr.
func (self *StateDB) SubBalance(addr common.Address, amount *big.Int) {
stateObject := self.GetOrNewStateObject(addr)
if stateObject != nil {
Expand Down Expand Up @@ -308,7 +308,7 @@ func (self *StateDB) SetCode(addr common.Address, code []byte) {
}
}

func (self *StateDB) SetState(addr common.Address, key common.Hash, value common.Hash) {
func (self *StateDB) SetState(addr common.Address, key, value common.Hash) {
stateObject := self.GetOrNewStateObject(addr)
if stateObject != nil {
stateObject.SetState(self.db, key, value)
Expand Down Expand Up @@ -337,7 +337,7 @@ func (self *StateDB) Suicide(addr common.Address) bool {
}

//
// Setting, updating & deleting state object methods
// Setting, updating & deleting state object methods.
//

// updateStateObject writes the given object to the trie.
Expand Down Expand Up @@ -388,7 +388,7 @@ func (self *StateDB) setStateObject(object *stateObject) {
self.stateObjects[object.Address()] = object
}

// Retrieve a state object or create a new state object if nil
// Retrieve a state object or create a new state object if nil.
func (self *StateDB) GetOrNewStateObject(addr common.Address) *stateObject {
stateObject := self.getStateObject(addr)
if stateObject == nil || stateObject.deleted {
Expand Down