File tree Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -1935,7 +1935,7 @@ export class EthImpl implements Eth {
1935
1935
networkGasPriceInWeiBars : number ,
1936
1936
requestDetails : RequestDetails ,
1937
1937
) : Promise < EthersTransaction > {
1938
- const parsedTx = Precheck . parseTxIfNeeded ( transaction ) ;
1938
+ const parsedTx = Precheck . parseRawTransaction ( transaction ) ;
1939
1939
try {
1940
1940
if ( this . logger . isLevelEnabled ( 'debug' ) ) {
1941
1941
this . logger . debug (
Original file line number Diff line number Diff line change @@ -35,12 +35,8 @@ export class Precheck {
35
35
* @param {string | Transaction } transaction - The transaction to parse.
36
36
* @returns {Transaction } The parsed transaction.
37
37
*/
38
- public static parseTxIfNeeded ( transaction : string | Transaction ) : Transaction {
39
- try {
40
- return typeof transaction === 'string' ? Transaction . from ( transaction ) : transaction ;
41
- } catch ( e : any ) {
42
- throw predefined . INVALID_ARGUMENTS ( e . message . toString ( ) ) ;
43
- }
38
+ public static parseRawTransaction ( transaction : string | Transaction ) : Transaction {
39
+ return typeof transaction === 'string' ? Transaction . from ( transaction ) : transaction ;
44
40
}
45
41
46
42
/**
Original file line number Diff line number Diff line change @@ -785,15 +785,15 @@ describe('Precheck', async function () {
785
785
} ) ;
786
786
} ) ;
787
787
788
- describe ( 'parseTxIfNeeded ' , async function ( ) {
788
+ describe ( 'parseRawTransaction ' , async function ( ) {
789
789
it ( 'should successfully parse a valid transaction string' , function ( ) {
790
- const parsedTx = Precheck . parseTxIfNeeded ( parsedTxWithMatchingChainId ) ;
790
+ const parsedTx = Precheck . parseRawTransaction ( parsedTxWithMatchingChainId ) ;
791
791
expect ( parsedTx ) . to . be . instanceOf ( Transaction ) ;
792
792
expect ( parsedTx . chainId ) . to . equal ( BigInt ( 298 ) ) ;
793
793
} ) ;
794
794
795
795
it ( 'should throw INVALID_ARGUMENTS for invalid RLP' , function ( ) {
796
- expect ( ( ) => Precheck . parseTxIfNeeded ( invalidTx ) ) . to . throw ( 'Invalid arguments: invalid BytesLike value' ) ;
796
+ expect ( ( ) => Precheck . parseRawTransaction ( invalidTx ) ) . to . throw ( 'Invalid arguments: invalid BytesLike value' ) ;
797
797
} ) ;
798
798
} ) ;
799
799
} ) ;
You can’t perform that action at this time.
0 commit comments