File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ describe('PLT TokenAmount', () => {
12
12
expect ( TokenAmount . fromDecimal ( '15.002456687544126548' , 18 ) ) . toEqual (
13
13
TokenAmount . create ( 15002456687544126548n , 18 )
14
14
) ;
15
+ expect ( TokenAmount . fromDecimal ( MAX_U64 , 0 ) ) . toEqual (
16
+ TokenAmount . create ( MAX_U64 , 0 )
17
+ ) ;
15
18
} ) ;
16
19
17
20
test ( 'Parses large decimal values correctly' , ( ) => {
@@ -35,6 +38,11 @@ describe('PLT TokenAmount', () => {
35
38
expect ( ( ) => TokenAmount . fromDecimal ( 99999999999999999999999999n , 1 ) ) . toThrow (
36
39
TokenAmount . Err . exceedsMaxValue ( )
37
40
) ;
41
+
42
+ } ) ;
43
+
44
+ test ( 'Token amounts with more decimals than specified throws' , ( ) => {
45
+ expect ( ( ) => TokenAmount . fromDecimal ( '1.000003' , 0 ) ) . toThrow ( 'The amount has more decimal places than the specified decimals.' ) ;
38
46
} ) ;
39
47
40
48
test ( 'Returns expected amount' , ( ) => {
You can’t perform that action at this time.
0 commit comments