Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
antonis19 committed Dec 2, 2024
1 parent 3bada3b commit 21afa09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 4 additions & 6 deletions erigon-lib/types/accounts/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,19 @@ func decodeLengthForHashing(buffer []byte, pos int) (length int, structure bool,
case firstByte < 192:
// Next byte is the length of the length + 183
lenEnd := pos + 1 + firstByte - 183
len := 0
for i := pos + 1; i < lenEnd; i++ {
len = (len << 8) + int(buffer[i])
length = (length << 8) + int(buffer[i])
}
return len, false, lenEnd
return length, false, lenEnd
case firstByte < 248:
return firstByte - 192, true, pos + 1
default:
// Next byte is the length of the length + 247
lenEnd := pos + 1 + firstByte - 247
len := 0
for i := pos + 1; i < lenEnd; i++ {
len = (len << 8) + int(buffer[i])
length = (length << 8) + int(buffer[i])
}
return len, true, lenEnd
return length, true, lenEnd
}
}

Expand Down
2 changes: 2 additions & 0 deletions erigon-lib/types/accounts/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ func TestEncodeAccountWithEmptyBalanceAndNotZeroIncarnation(t *testing.T) {
}

func isAccountsEqual(t *testing.T, src, dst Account) {
t.Helper()
if dst.Initialised != src.Initialised {
t.Fatal("cant decode the account Initialised", src.Initialised, dst.Initialised)
}
Expand Down Expand Up @@ -325,6 +326,7 @@ func TestIncarnationWithInvalidEncodedAccount(t *testing.T) {
}

func isIncarnationEqual(t *testing.T, initialIncarnation uint64, decodedIncarnation uint64) {
t.Helper()
if initialIncarnation != decodedIncarnation {
t.Fatal("Can't decode the incarnation", initialIncarnation, decodedIncarnation)
}
Expand Down

0 comments on commit 21afa09

Please sign in to comment.