aboutsummaryrefslogtreecommitdiffstats
path: root/core/state
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2017-01-06 22:52:03 +0800
committerFelix Lange <fjl@twurst.com>2017-01-06 22:52:03 +0800
commit35a7dcb162546f7f31cb6492f716cb93159218d7 (patch)
tree4828026948031719a703a87e0ce909e82da21d3b /core/state
parente0fde022909d272e55fb9ea2d4f8cfe9f178dba8 (diff)
downloadgo-tangerine-35a7dcb162546f7f31cb6492f716cb93159218d7.tar
go-tangerine-35a7dcb162546f7f31cb6492f716cb93159218d7.tar.gz
go-tangerine-35a7dcb162546f7f31cb6492f716cb93159218d7.tar.bz2
go-tangerine-35a7dcb162546f7f31cb6492f716cb93159218d7.tar.lz
go-tangerine-35a7dcb162546f7f31cb6492f716cb93159218d7.tar.xz
go-tangerine-35a7dcb162546f7f31cb6492f716cb93159218d7.tar.zst
go-tangerine-35a7dcb162546f7f31cb6492f716cb93159218d7.zip
all: gofmt -w -s
Diffstat (limited to 'core/state')
-rw-r--r--core/state/iterator_test.go2
-rw-r--r--core/state/managed_state_test.go6
-rw-r--r--core/state/statedb.go6
-rw-r--r--core/state/sync_test.go4
4 files changed, 9 insertions, 9 deletions
diff --git a/core/state/iterator_test.go b/core/state/iterator_test.go
index aa05c5dfe..aa9c5b728 100644
--- a/core/state/iterator_test.go
+++ b/core/state/iterator_test.go
@@ -41,7 +41,7 @@ func TestNodeIteratorCoverage(t *testing.T) {
}
}
// Cross check the hashes and the database itself
- for hash, _ := range hashes {
+ for hash := range hashes {
if _, err := db.Get(hash.Bytes()); err != nil {
t.Errorf("failed to retrieve reported node %x: %v", hash, err)
}
diff --git a/core/state/managed_state_test.go b/core/state/managed_state_test.go
index 3f7bc2aa8..d9c232ebb 100644
--- a/core/state/managed_state_test.go
+++ b/core/state/managed_state_test.go
@@ -52,7 +52,7 @@ func TestRemove(t *testing.T) {
ms, account := create()
nn := make([]bool, 10)
- for i, _ := range nn {
+ for i := range nn {
nn[i] = true
}
account.nonces = append(account.nonces, nn...)
@@ -68,7 +68,7 @@ func TestReuse(t *testing.T) {
ms, account := create()
nn := make([]bool, 10)
- for i, _ := range nn {
+ for i := range nn {
nn[i] = true
}
account.nonces = append(account.nonces, nn...)
@@ -84,7 +84,7 @@ func TestReuse(t *testing.T) {
func TestRemoteNonceChange(t *testing.T) {
ms, account := create()
nn := make([]bool, 10)
- for i, _ := range nn {
+ for i := range nn {
nn[i] = true
}
account.nonces = append(account.nonces, nn...)
diff --git a/core/state/statedb.go b/core/state/statedb.go
index bbcde9443..75c40b364 100644
--- a/core/state/statedb.go
+++ b/core/state/statedb.go
@@ -479,7 +479,7 @@ func (self *StateDB) Copy() *StateDB {
logSize: self.logSize,
}
// Copy the dirty states and logs
- for addr, _ := range self.stateObjectsDirty {
+ for addr := range self.stateObjectsDirty {
state.stateObjects[addr] = self.stateObjects[addr].deepCopy(state, state.MarkStateObjectDirty)
state.stateObjectsDirty[addr] = struct{}{}
}
@@ -530,7 +530,7 @@ func (self *StateDB) GetRefund() *big.Int {
// It is called in between transactions to get the root hash that
// goes into transaction receipts.
func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash {
- for addr, _ := range s.stateObjectsDirty {
+ for addr := range s.stateObjectsDirty {
stateObject := s.stateObjects[addr]
if stateObject.suicided || (deleteEmptyObjects && stateObject.empty()) {
s.deleteStateObject(stateObject)
@@ -553,7 +553,7 @@ func (s *StateDB) DeleteSuicides() {
// Reset refund so that any used-gas calculations can use this method.
s.clearJournalAndRefund()
- for addr, _ := range s.stateObjectsDirty {
+ for addr := range s.stateObjectsDirty {
stateObject := s.stateObjects[addr]
// If the object has been removed by a suicide
diff --git a/core/state/sync_test.go b/core/state/sync_test.go
index 2a30c86f4..cb585f78c 100644
--- a/core/state/sync_test.go
+++ b/core/state/sync_test.go
@@ -198,7 +198,7 @@ func testIterativeRandomStateSync(t *testing.T, batch int) {
for len(queue) > 0 {
// Fetch all the queued nodes in a random order
results := make([]trie.SyncResult, 0, len(queue))
- for hash, _ := range queue {
+ for hash := range queue {
data, err := srcDb.Get(hash.Bytes())
if err != nil {
t.Fatalf("failed to retrieve node data for %x: %v", hash, err)
@@ -235,7 +235,7 @@ func TestIterativeRandomDelayedStateSync(t *testing.T) {
for len(queue) > 0 {
// Sync only half of the scheduled nodes, even those in random order
results := make([]trie.SyncResult, 0, len(queue)/2+1)
- for hash, _ := range queue {
+ for hash := range queue {
delete(queue, hash)
data, err := srcDb.Get(hash.Bytes())