Skip to content

Commit

Permalink
format tests
Browse files Browse the repository at this point in the history
  • Loading branch information
infiloop2 committed Feb 16, 2024
1 parent 351104a commit 61f9f5d
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions contracts/test/v0.8/automation/AutomationRegistry2_2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ describe('AutomationRegistry2_2', () => {
gasMultiplier: BigNumber,
premiumPPB: BigNumber,
flatFee: BigNumber,
l1CostWei?: BigNumber
l1CostWei?: BigNumber,
) => {
l1CostWei = l1CostWei === undefined ? BigNumber.from(0) : l1CostWei

Expand All @@ -535,9 +535,7 @@ describe('AutomationRegistry2_2', () => {
.mul(gasSpent)
.mul(linkDivisibility)
.div(linkEth)
const l1Fee = l1CostWei
.mul(linkDivisibility)
.div(linkEth)
const l1Fee = l1CostWei.mul(linkDivisibility).div(linkEth)
const gasPayment = base.add(l1Fee)

const premium = gasWei
Expand Down Expand Up @@ -2495,7 +2493,6 @@ describe('AutomationRegistry2_2', () => {
.add(chargedGasOverhead)
}


console.log(
'Gas Benchmarking - batching (passedConditionalUpkeeps: ',
numPassingConditionalUpkeeps,
Expand Down Expand Up @@ -3295,8 +3292,8 @@ describe('AutomationRegistry2_2', () => {
})

describe('#getMaxPaymentForGas', () => {
let maxl1CostWeiArbWithoutMultiplier : BigNumber
let maxl1CostWeiOptWithoutMultiplier : BigNumber
let maxl1CostWeiArbWithoutMultiplier: BigNumber
let maxl1CostWeiOptWithoutMultiplier: BigNumber

beforeEach(async () => {
let arbL1PriceinWei = BigNumber.from(1000) // Same as MockArbGasInfo.sol

Check warning on line 3299 in contracts/test/v0.8/automation/AutomationRegistry2_2.test.ts

View workflow job for this annotation

GitHub Actions / Solidity Lint

'arbL1PriceinWei' is never reassigned. Use 'const' instead
Expand All @@ -3311,19 +3308,27 @@ describe('AutomationRegistry2_2', () => {
),
),
)
maxl1CostWeiOptWithoutMultiplier = BigNumber.from(2000000) // Same as MockOVMGasPriceOracle.sol
maxl1CostWeiOptWithoutMultiplier = BigNumber.from(2000000) // Same as MockOVMGasPriceOracle.sol
})

itMaybe('calculates the max fee appropriately', async () => {
await verifyMaxPayment(registry, chainModuleBase)
})

itMaybe('calculates the max fee appropriately for Arbitrum', async () => {
await verifyMaxPayment(arbRegistry, arbitrumModule, maxl1CostWeiArbWithoutMultiplier)
await verifyMaxPayment(
arbRegistry,
arbitrumModule,
maxl1CostWeiArbWithoutMultiplier,
)
})

itMaybe('calculates the max fee appropriately for Optimism', async () => {
await verifyMaxPayment(opRegistry, optimismModule, maxl1CostWeiOptWithoutMultiplier)
await verifyMaxPayment(
opRegistry,
optimismModule,
maxl1CostWeiOptWithoutMultiplier,
)
})

it('uses the fallback gas price if the feed has issues', async () => {
Expand Down

0 comments on commit 61f9f5d

Please sign in to comment.