Skip to content

Commit

Permalink
common/math: rename variable name int to n (ethereum#29890)
Browse files Browse the repository at this point in the history
* chore: rename variable name `int` to `in`

* chore: rename variable name `int` to `n`
  • Loading branch information
tianyeyouyou authored and jorgemmsilva committed Jun 17, 2024
1 parent 7152d74 commit 8531f6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions common/math/big_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ func BenchmarkByteAtOld(b *testing.B) {
func TestReadBits(t *testing.T) {
check := func(input string) {
want, _ := hex.DecodeString(input)
int, _ := new(big.Int).SetString(input, 16)
n, _ := new(big.Int).SetString(input, 16)
buf := make([]byte, len(want))
ReadBits(int, buf)
ReadBits(n, buf)
if !bytes.Equal(buf, want) {
t.Errorf("have: %x\nwant: %x", buf, want)
}
Expand Down
4 changes: 2 additions & 2 deletions common/math/integer.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ func (i *HexOrDecimal64) UnmarshalJSON(input []byte) error {

// UnmarshalText implements encoding.TextUnmarshaler.
func (i *HexOrDecimal64) UnmarshalText(input []byte) error {
int, ok := ParseUint64(string(input))
n, ok := ParseUint64(string(input))
if !ok {
return fmt.Errorf("invalid hex or decimal integer %q", input)
}
*i = HexOrDecimal64(int)
*i = HexOrDecimal64(n)
return nil
}

Expand Down

0 comments on commit 8531f6b

Please sign in to comment.