Skip to content

Commit 7dfc734

Browse files
committed
resolve conflict
Signed-off-by: Simeon Nakov <simeon.nakov@limechain.tech>
1 parent e3a2efb commit 7dfc734

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

packages/relay/src/lib/eth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1935,7 +1935,7 @@ export class EthImpl implements Eth {
19351935
networkGasPriceInWeiBars: number,
19361936
requestDetails: RequestDetails,
19371937
): Promise<EthersTransaction> {
1938-
const parsedTx = Precheck.parseTxIfNeeded(transaction);
1938+
const parsedTx = Precheck.parseRawTransaction(transaction);
19391939
try {
19401940
if (this.logger.isLevelEnabled('debug')) {
19411941
this.logger.debug(

packages/relay/src/lib/precheck.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,8 @@ export class Precheck {
3535
* @param {string | Transaction} transaction - The transaction to parse.
3636
* @returns {Transaction} The parsed transaction.
3737
*/
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;
4440
}
4541

4642
/**

packages/relay/tests/lib/precheck.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,15 +785,15 @@ describe('Precheck', async function () {
785785
});
786786
});
787787

788-
describe('parseTxIfNeeded', async function () {
788+
describe('parseRawTransaction', async function () {
789789
it('should successfully parse a valid transaction string', function () {
790-
const parsedTx = Precheck.parseTxIfNeeded(parsedTxWithMatchingChainId);
790+
const parsedTx = Precheck.parseRawTransaction(parsedTxWithMatchingChainId);
791791
expect(parsedTx).to.be.instanceOf(Transaction);
792792
expect(parsedTx.chainId).to.equal(BigInt(298));
793793
});
794794

795795
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');
797797
});
798798
});
799799
});

0 commit comments

Comments
 (0)