aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJia Chenhui <jiachenhui1989@gmail.com>2018-03-28 14:26:37 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-03-28 14:26:37 +0800
commit1a8894b3d59bdf592244b91b6a629f7cf25dcdde (patch)
treebca6143b817c70a56a6d9d9a6fef60ab2c4b11e3 /core
parent80449719bd664bb0ed9c599765f6313f9b8a8303 (diff)
downloaddexon-1a8894b3d59bdf592244b91b6a629f7cf25dcdde.tar.gz
dexon-1a8894b3d59bdf592244b91b6a629f7cf25dcdde.tar.zst
dexon-1a8894b3d59bdf592244b91b6a629f7cf25dcdde.zip
core/state: uniform parameter style (#16398)
- Uniform code style.
Diffstat (limited to 'core')
-rw-r--r--core/state/statedb.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/core/state/statedb.go b/core/state/statedb.go
index 5473ff8da..bd67e789d 100644
--- a/core/state/statedb.go
+++ b/core/state/statedb.go
@@ -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{}
}
@@ -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
}
@@ -271,7 +271,7 @@ 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 {
@@ -279,7 +279,7 @@ func (self *StateDB) AddBalance(addr common.Address, amount *big.Int) {
}
}
-// 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 {
@@ -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)
@@ -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.
@@ -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 {