Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixFan1992 committed May 29, 2024
1 parent b762237 commit 68d5062
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions .changeset/eleven-terms-explain.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"chainlink": patch
---

#bugfix
fix a funding bug in LinkAvailableBalanceMonitor
1 change: 1 addition & 0 deletions contracts/.changeset/tricky-meals-decide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"@chainlink/contracts": patch
---

#bugfix
fix a funding bug in LinkAvailableBalanceMonitor
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const setup = async () => {
await setTx.wait()
}

describe.only('LinkAvailableBalanceMonitor', () => {
describe('LinkAvailableBalanceMonitor', () => {
beforeEach(async () => {
await loadFixture(setup)
})
Expand Down Expand Up @@ -388,7 +388,7 @@ describe.only('LinkAvailableBalanceMonitor', () => {
await expect(setTxStranger).to.be.reverted
})

it('Should revert if any of the addresses are empty', async () => {
it('should revert if any of the addresses are empty', async () => {
const tx = labm
.connect(owner)
.setWatchList(
Expand Down Expand Up @@ -662,12 +662,12 @@ describe.only('LinkAvailableBalanceMonitor', () => {
assert.equal(watchlist.length, minBalances.length)
})

it('Should not include more than MAX_PERFORM addresses', async () => {
it('should not include more than MAX_PERFORM addresses', async () => {
const addresses = await labm.sampleUnderfundedAddresses()
expect(addresses.length).to.be.lessThanOrEqual(MAX_PERFORM)
})

it('Should sample from the list of addresses pseudorandomly', async () => {
it('should sample from the list of addresses pseudorandomly', async () => {
const firstAddress: string[] = []
for (let idx = 0; idx < 10; idx++) {
const addresses = await labm.sampleUnderfundedAddresses()
Expand Down Expand Up @@ -721,7 +721,7 @@ describe.only('LinkAvailableBalanceMonitor', () => {
await expect(performTx).to.be.revertedWith(PAUSED_ERR)
})

it('Should fund the appropriate addresses', async () => {
it('should fund the appropriate addresses', async () => {
await aggregator1.mock.linkAvailableForPayment.returns(zeroLINK)
await aggregator2.mock.linkAvailableForPayment.returns(zeroLINK)
await aggregator3.mock.linkAvailableForPayment.returns(zeroLINK)
Expand Down Expand Up @@ -805,13 +805,13 @@ describe.only('LinkAvailableBalanceMonitor', () => {
})

describe('topUp()', () => {
it('Should revert topUp address(0)', async () => {
it('should revert topUp address(0)', async () => {
const tx = await labm.connect(owner).topUp([ethers.constants.AddressZero])
await expect(tx).to.emit(labm, 'TopUpBlocked')
})

context('when not paused', () => {
it('Should be callable by anyone', async () => {
it('should be callable by anyone', async () => {
const users = [owner, keeperRegistry, stranger]
for (let idx = 0; idx < users.length; idx++) {
const user = users[idx]
Expand All @@ -821,7 +821,7 @@ describe.only('LinkAvailableBalanceMonitor', () => {
})

context('when paused', () => {
it('Should be callable by no one', async () => {
it('should be callable by no one', async () => {
await labm.connect(owner).pause()
const users = [owner, keeperRegistry, stranger]
for (let idx = 0; idx < users.length; idx++) {
Expand Down Expand Up @@ -1012,7 +1012,7 @@ describe.only('LinkAvailableBalanceMonitor', () => {
})

context('when partially funded', () => {
it('Should fund as many addresses as possible', async () => {
it('should fund as many addresses as possible', async () => {
await lt.connect(owner).transfer(
labm.address,
fourLINK, // only enough LINK to fund 2 addresses
Expand Down

0 comments on commit 68d5062

Please sign in to comment.