11import { Common , Hardfork , Mainnet } from '@ethereumjs/common'
22import {
3- MAX_INTEGER ,
4- MAX_UINT64 ,
53 SECP256K1_ORDER ,
64 bytesToBigInt ,
75 equalsBytes ,
@@ -28,7 +26,6 @@ import {
2826 createLegacyTxFromRLP ,
2927 paramsTx ,
3028} from '../src/index.ts'
31- import { valueBoundaryCheck } from '../src/util/internal.ts'
3229
3330import { eip1559TxsData } from './testData/eip1559txs.ts'
3431import { eip2930TxsData } from './testData/eip2930txs.ts'
@@ -443,45 +440,4 @@ describe('[BaseTransaction]', () => {
443440 assert . strictEqual ( tx . gasLimit , bytesToBigInt ( bufferZero ) )
444441 assert . strictEqual ( tx . nonce , bytesToBigInt ( bufferZero ) )
445442 } )
446-
447- // TODO: move this to a different file (not part of base transaction anymore)
448- it ( 'valueBoundaryCheck()' , ( ) => {
449- try {
450- valueBoundaryCheck ( { a : MAX_INTEGER } , 256 , true )
451- } catch ( err : any ) {
452- assert . isTrue (
453- err . message . includes ( 'equal or exceed MAX_INTEGER' ) ,
454- 'throws when value equals or exceeds MAX_INTEGER' ,
455- )
456- }
457- try {
458- valueBoundaryCheck ( { a : MAX_INTEGER + BigInt ( 1 ) } , 256 , false )
459- } catch ( err : any ) {
460- assert . isTrue (
461- err . message . includes ( 'exceed MAX_INTEGER' ) ,
462- 'throws when value exceeds MAX_INTEGER' ,
463- )
464- }
465- try {
466- valueBoundaryCheck ( { a : BigInt ( 0 ) } , 100 , false )
467- } catch ( err : any ) {
468- assert . isTrue (
469- err . message . includes ( 'unimplemented bits value' ) ,
470- 'throws when bits value other than 64 or 256 provided' ,
471- )
472- }
473- try {
474- valueBoundaryCheck ( { a : MAX_UINT64 + BigInt ( 1 ) } , 64 , false )
475- } catch ( err : any ) {
476- assert . isTrue ( err . message . includes ( '2^64' ) , 'throws when 64 bit integer exceeds MAX_UINT64' )
477- }
478- try {
479- valueBoundaryCheck ( { a : MAX_UINT64 } , 64 , true )
480- } catch ( err : any ) {
481- assert . isTrue (
482- err . message . includes ( '2^64' ) ,
483- 'throws when 64 bit integer equals or exceeds MAX_UINT64' ,
484- )
485- }
486- } )
487443} )
0 commit comments