[#365] settlement/basic: Use big.Int constructor for unification

Check if `new(big.Int)` will be efficient later and replace
all `big.NewInt()` in code or leave it as it is.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-02-03 15:07:37 +03:00 committed by Alex Vanin
parent 6a9a2b5d04
commit 3775d61ccb
4 changed files with 8 additions and 8 deletions

View file

@ -44,10 +44,10 @@ func TestNormalizedValues(t *testing.T) {
}
func testNormalizedValues(t *testing.T, c normalizedValueCase) {
n := new(big.Int).SetUint64(c.n)
total := new(big.Int).SetUint64(c.total)
limit := new(big.Int).SetUint64(c.limit)
exp := new(big.Int).SetUint64(c.expected)
n := big.NewInt(0).SetUint64(c.n)
total := big.NewInt(0).SetUint64(c.total)
limit := big.NewInt(0).SetUint64(c.limit)
exp := big.NewInt(0).SetUint64(c.expected)
got := normalizedValue(n, total, limit)
require.Zero(t, exp.Cmp(got), c.name)