diff --git a/pkg/util/fixed8.go b/pkg/util/fixed8.go index 80216edef..21317a2aa 100644 --- a/pkg/util/fixed8.go +++ b/pkg/util/fixed8.go @@ -116,7 +116,7 @@ func (f Fixed8) MarshalJSON() ([]byte, error) { // Satoshi defines the value of a 'Satoshi'. func Satoshi() Fixed8 { - return NewFixed8(1) + return Fixed8(1) } // Div implements Fixd8 division operator. diff --git a/pkg/util/fixed8_test.go b/pkg/util/fixed8_test.go index 7bb4aa9d0..352b75250 100644 --- a/pkg/util/fixed8_test.go +++ b/pkg/util/fixed8_test.go @@ -66,6 +66,11 @@ func TestFixed8DecodeString(t *testing.T) { assert.Equal(t, Fixed8(90123410000), n) } +func TestSatoshi(t *testing.T) { + satoshif8 := Satoshi() + assert.Equal(t, "0.00000001", satoshif8.String()) +} + func TestFixed8UnmarshalJSON(t *testing.T) { var testCases = []float64{ 123.45,