Skip to content

Commit

Permalink
Merge pull request #2054 from CortexFoundation/dev
Browse files Browse the repository at this point in the history
common/math: rename variable name `int` to `n`
  • Loading branch information
ucwong authored Jun 11, 2024
2 parents 5b696b1 + 3fe3c1b commit ff68cba
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 @@ -181,9 +181,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 ff68cba

Please sign in to comment.