forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
math.go
74 lines (64 loc) · 2.07 KB
/
math.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package types
import (
sdkmath "cosmossdk.io/math"
)
// Type aliases to the SDK's math sub-module
//
// Deprecated: Functionality of this package has been moved to it's own module:
// cosmossdk.io/math
//
// Please use the above module instead of this package.
type (
Int = sdkmath.Int
Uint = sdkmath.Uint
)
var (
NewIntFromBigInt = sdkmath.NewIntFromBigInt
OneInt = sdkmath.OneInt
NewInt = sdkmath.NewInt
ZeroInt = sdkmath.ZeroInt
IntEq = sdkmath.IntEq
NewIntFromString = sdkmath.NewIntFromString
NewUint = sdkmath.NewUint
NewIntFromUint64 = sdkmath.NewIntFromUint64
MaxInt = sdkmath.MaxInt
MinInt = sdkmath.MinInt
)
const (
MaxBitLen = sdkmath.MaxBitLen
)
func (ip IntProto) String() string {
return ip.Int.String()
}
type (
Dec = sdkmath.LegacyDec
)
const (
Precision = sdkmath.LegacyPrecision
DecimalPrecisionBits = sdkmath.LegacyDecimalPrecisionBits
)
var (
ZeroDec = sdkmath.LegacyZeroDec
OneDec = sdkmath.LegacyOneDec
SmallestDec = sdkmath.LegacySmallestDec
NewDec = sdkmath.LegacyNewDec
NewDecWithPrec = sdkmath.LegacyNewDecWithPrec
NewDecFromBigInt = sdkmath.LegacyNewDecFromBigInt
NewDecFromBigIntWithPrec = sdkmath.LegacyNewDecFromBigIntWithPrec
NewDecFromInt = sdkmath.LegacyNewDecFromInt
NewDecFromIntWithPrec = sdkmath.LegacyNewDecFromIntWithPrec
NewDecFromStr = sdkmath.LegacyNewDecFromStr
MustNewDecFromStr = sdkmath.LegacyMustNewDecFromStr
MaxSortableDec = sdkmath.LegacyMaxSortableDec
ValidSortableDec = sdkmath.LegacyValidSortableDec
SortableDecBytes = sdkmath.LegacySortableDecBytes
DecsEqual = sdkmath.LegacyDecsEqual
MinDec = sdkmath.LegacyMinDec
MaxDec = sdkmath.LegacyMaxDec
DecEq = sdkmath.LegacyDecEq
DecApproxEq = sdkmath.LegacyDecApproxEq
)
var _ CustomProtobufType = (*Dec)(nil)
func (dp DecProto) String() string {
return dp.Dec.String()
}