Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
replace xxxn with BigInt(xxx)
  • Loading branch information
wk3368 committed Mar 25, 2022
1 parent e96ede7 commit 7af8058
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/abstract-signer/index.ts
Expand Up @@ -85,7 +85,7 @@ export abstract class Signer {
if (typeof txnOutput.gas_used === 'number') {
return 3 * txnOutput.gas_used;
}
return 3n * txnOutput.gas_used.valueOf();
return BigInt(3) * txnOutput.gas_used.valueOf();
}

// calls with the transaction
Expand Down Expand Up @@ -130,7 +130,7 @@ export abstract class Signer {
// eslint-disable-next-line no-restricted-syntax
for (const key of Object.keys(transaction)) {
if (!allowedTransactionKeys.has(key)) {
logger.throwArgumentError(`invalid transaction key: ${key}`, 'transaction', transaction);
logger.throwArgumentError(`invalid transaction key: ${ key }`, 'transaction', transaction);
}
}

Expand Down Expand Up @@ -186,7 +186,7 @@ export abstract class Signer {
if (forwardErrors.has(error.code)) {
throw error;
}
console.log(`err: ${error}`);
console.log(`err: ${ error }`);
return logger.throwError('cannot estimate gas; transaction may fail or may require manual gas limit', Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
error,
tx
Expand Down
2 changes: 1 addition & 1 deletion src/providers/jsonrpc-provider.spec.ts
Expand Up @@ -182,7 +182,7 @@ describe('jsonrpc-provider', () => {
// const txnOutput = await provider.dryRun(txnRequest)

// TODO: generate maxGasAmount from contract.dry_run -> gas_used
let maxGasAmount = 10000000n;
let maxGasAmount = BigInt(10000000);
const gasUnitPrice = 1;
// because the time system in dev network is relatively static,
// we should use nodeInfo.now_secondsinstead of using new Date().getTime()
Expand Down

0 comments on commit 7af8058

Please sign in to comment.