[#168] sdk/accounting: Refactor Decimal type

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-13 13:36:18 +03:00 committed by Alex Vanin
parent e721734599
commit 52fae76533
4 changed files with 62 additions and 6 deletions

View file

@ -0,0 +1,25 @@
package accounting
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestDecimal_Value(t *testing.T) {
d := NewDecimal()
v := int64(3)
d.SetValue(v)
require.Equal(t, v, d.Value())
}
func TestDecimal_Precision(t *testing.T) {
d := NewDecimal()
p := uint32(3)
d.SetPrecision(p)
require.Equal(t, p, d.Precision())
}