This repository was archived by the owner on Mar 5, 2025. It is now read-only.
File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ export const fromWei = (number, unit) => {
195
195
unit = getUnitValue ( unit ) ;
196
196
197
197
if ( ! utils . isBN ( number ) && ! isString ( number ) ) {
198
- throw new Error ( 'Please pass numbers as strings or BigNumber objects to avoid precision errors.' ) ;
198
+ throw new Error ( 'Please pass numbers as strings or BN objects to avoid precision errors.' ) ;
199
199
}
200
200
201
201
return utils . isBN ( number ) ? ethjsUnit . fromWei ( number , unit ) : ethjsUnit . fromWei ( number , unit ) . toString ( 10 ) ;
@@ -229,7 +229,7 @@ export const toWei = (number, unit) => {
229
229
unit = getUnitValue ( unit ) ;
230
230
231
231
if ( ! utils . isBN ( number ) && ! isString ( number ) ) {
232
- throw new Error ( 'Please pass numbers as strings or BigNumber objects to avoid precision errors.' ) ;
232
+ throw new Error ( 'Please pass numbers as strings or BN objects to avoid precision errors.' ) ;
233
233
}
234
234
235
235
return utils . isBN ( number ) ? ethjsUnit . toWei ( number , unit ) : ethjsUnit . toWei ( number , unit ) . toString ( 10 ) ;
Original file line number Diff line number Diff line change @@ -461,7 +461,7 @@ describe('UtilsTest', () => {
461
461
462
462
expect ( ( ) => {
463
463
toWei ( 1 , 'wei' ) ;
464
- } ) . toThrow ( 'Please pass numbers as strings or BigNumber objects to avoid precision errors.' ) ;
464
+ } ) . toThrow ( 'Please pass numbers as strings or BN objects to avoid precision errors.' ) ;
465
465
} ) ;
466
466
467
467
it ( 'calls utf8ToHex and returns the expected results' , ( ) => {
You can’t perform that action at this time.
0 commit comments