add test for chainId
MODIFY
src/utils/base_token.ts
src/utils/base_token.ts
@@ -184,16 +184,13 @@ export class BaseToken<T_CLIENT_CONFIG> {
const isMaxFeeProvided = (maxFeePerGas || maxPriorityFeePerGas);
if (!isEIP1559Supported && isMaxFeeProvided) {
- // tslint:disable-next-line
- debugger;
this.client.logger.error(ERROR_TYPE.EIP1559NotSupported, isParent).throw();
}
- const [gasLimit, gasPrice, nonce] = await Promise.all([
+ const [gasLimit, nonce] = await Promise.all([
!(txConfig.gasLimit)
? estimateGas({ from: txConfig.from, value: txConfig.value })
: txConfig.gasLimit,
- !txConfig.gasPrice ? client.getGasPrice() : txConfig.gasPrice,
!txConfig.nonce ? client.getTransactionCount(txConfig.from as string, 'pending') : txConfig.nonce,
]);
this.client.logger.log("options filled");
@@ -204,6 +201,7 @@ export class BaseToken<T_CLIENT_CONFIG> {
txConfig.maxPriorityFeePerGas = maxPriorityFeePerGas;
}
else {
+ const gasPrice = !txConfig.gasPrice ? client.getGasPrice() : txConfig.gasPrice;
txConfig.gasPrice = Number(gasPrice);
}

MODIFY
test/specs/erc20.spec.ts
test/specs/erc20.spec.ts
@@ -71,6 +71,7 @@ describe('ERC20', () => {
expect(result).to.have.not.property('maxFeePerGas')
expect(result).to.have.not.property('maxPriorityFeePerGas')
expect(result).to.have.property('gasPrice')
+ expect(result).to.have.property('chainId', '0x13881');
});
it('parent transfer returnTransaction with erp1159', async () => {
@@ -85,6 +86,7 @@ describe('ERC20', () => {
expect(result).to.have.property('maxFeePerGas', 20)
expect(result).to.have.property('maxPriorityFeePerGas', 20)
expect(result).to.have.not.property('gasPrice')
+ expect(result).to.have.property('chainId', '0x5');
});

add test for chainId