From 82b6d507405f31d0ed93663c80698e02b04489e1 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 2 Oct 2024 06:27:19 -0600 Subject: [PATCH] Remove unused helper function --- pkg/pipeline/helpers.go | 10 ---------- pkg/pipeline/helpers_test.go | 21 --------------------- 2 files changed, 31 deletions(-) delete mode 100644 pkg/pipeline/helpers.go delete mode 100644 pkg/pipeline/helpers_test.go diff --git a/pkg/pipeline/helpers.go b/pkg/pipeline/helpers.go deleted file mode 100644 index d045332..0000000 --- a/pkg/pipeline/helpers.go +++ /dev/null @@ -1,10 +0,0 @@ -package pipeline - -import "math/big" - -// bigIntRatio calculates a ratio of a big int. -func bigIntRatio(i *big.Int, ratio float64) *big.Int { - r := big.NewFloat(ratio) - bump, _ := r.Mul(r, new(big.Float).SetInt(i)).Int(nil) - return bump -} diff --git a/pkg/pipeline/helpers_test.go b/pkg/pipeline/helpers_test.go deleted file mode 100644 index f6af323..0000000 --- a/pkg/pipeline/helpers_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package pipeline - -import ( - "math/big" - "testing" - - "github.com/stretchr/testify/require" -) - -func TestBigIntRatio(t *testing.T) { - ten := big.NewInt(10) - - ratio := bigIntRatio(ten, 0.1) - require.Equal(t, big.NewInt(1), ratio) - - ratio = bigIntRatio(ten, 1.0) - require.Equal(t, big.NewInt(10), ratio) - - ratio = bigIntRatio(ten, 2.0) - require.Equal(t, big.NewInt(20), ratio) -}