mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-06-29 01:12:31 +00:00

* distributed & result msgs * added DistributionResult * added RDDL token conversion methods * set proper validatoraddress within the testcases for e2e/dao * set proper root dir for test cases * fixed some wordings --------- Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
34 lines
739 B
Go
34 lines
739 B
Go
package util
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gotest.tools/assert"
|
|
)
|
|
|
|
func Test2FloatConvertion(t *testing.T) {
|
|
var expectedValue uint64 = 99869000000
|
|
value := RDDLToken2Uint(998.69)
|
|
assert.Equal(t, expectedValue, value)
|
|
}
|
|
|
|
func Test2UintConvertion(t *testing.T) {
|
|
expectedValue := 998.69
|
|
value := RDDLToken2Float(99869000000)
|
|
assert.Equal(t, expectedValue, value)
|
|
}
|
|
|
|
func TestStringToFloat(t *testing.T) {
|
|
expectedValue := 998.69
|
|
value, err := RDDLTokenStringToFloat("998.69")
|
|
assert.Equal(t, expectedValue, value)
|
|
assert.Equal(t, nil, err)
|
|
}
|
|
|
|
func TestStringToUint(t *testing.T) {
|
|
var expectedValue uint64 = 99869000000
|
|
value, err := RDDLTokenStringToUint("998.69")
|
|
assert.Equal(t, expectedValue, value)
|
|
assert.Equal(t, nil, err)
|
|
}
|