Make TransactionConfig.overrides optional (#420)

yorhodes/427
Nam Chu Hoai 3 years ago committed by GitHub
parent de74f868be
commit 406f0fada7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      typescript/deploy/src/config.ts
  2. 10
      typescript/deploy/src/utils.ts

@ -11,7 +11,7 @@ export interface CheckerViolation {
}
export type TransactionConfig = {
overrides: ethers.Overrides;
overrides?: ethers.Overrides;
supports1559?: boolean;
// The number of confirmations considered reorg safe
confirmations?: number;

@ -37,15 +37,15 @@ export function getRouterConfig<N extends ChainName>(
function fixOverrides(config: TransactionConfig): ethers.Overrides {
if (config.supports1559) {
return {
maxFeePerGas: config.overrides.maxFeePerGas,
maxPriorityFeePerGas: config.overrides.maxPriorityFeePerGas,
gasLimit: config.overrides.gasLimit,
maxFeePerGas: config.overrides?.maxFeePerGas,
maxPriorityFeePerGas: config.overrides?.maxPriorityFeePerGas,
gasLimit: config.overrides?.gasLimit,
};
} else {
return {
type: 0,
gasPrice: config.overrides.gasPrice,
gasLimit: config.overrides.gasLimit,
gasPrice: config.overrides?.gasPrice,
gasLimit: config.overrides?.gasLimit,
};
}
}

Loading…
Cancel
Save