Skip to content

Commit

Permalink
change number
Browse files Browse the repository at this point in the history
  • Loading branch information
DongLieu committed Oct 25, 2023
1 parent 07f1b6b commit 720bad7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions uint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,23 @@ func (s *uintTestSuite) TestIsNil() {
}

func (s *uintTestSuite) TestConvertToBigIntMutativeForUint() {
r := big.NewInt(42)
r := big.NewInt(30)
i := sdkmath.NewUintFromBigInt(r)

// Compare value of BigInt & BigIntMut
s.Require().Equal(i.BigInt(), i.BigIntMut())

// Modify BigIntMut() pointer and ensure i.BigIntMut() & i.BigInt() change
p := i.BigIntMut()
p.SetInt64(50)
s.Require().Equal(big.NewInt(50), i.BigIntMut())
s.Require().Equal(big.NewInt(50), i.BigInt())
p1 := i.BigIntMut()
p1.SetInt64(40)
s.Require().Equal(big.NewInt(40), i.BigIntMut())
s.Require().Equal(big.NewInt(40), i.BigInt())

// Modify big.Int() pointer and ensure i.BigIntMut() & i.BigInt() don't change
p = i.BigInt()
p.SetInt64(60)
s.Require().NotEqual(big.NewInt(60), i.BigIntMut())
s.Require().NotEqual(big.NewInt(60), i.BigInt())
p2 := i.BigInt()
p2.SetInt64(50)
s.Require().NotEqual(big.NewInt(50), i.BigIntMut())
s.Require().NotEqual(big.NewInt(50), i.BigInt())
}

func (s *uintTestSuite) TestArithUint() {
Expand Down

0 comments on commit 720bad7

Please sign in to comment.