Skip to content

Commit

Permalink
Merge pull request #144 from peanutprotocol/fix/tests
Browse files Browse the repository at this point in the history
Fixing broken tests
  • Loading branch information
Hugo0 authored Aug 24, 2024
2 parents 7bb53e2 + b684e63 commit e553c28
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 39 deletions.
22 changes: 0 additions & 22 deletions test/basic/getSquidChainsAndTokens.test.ts

This file was deleted.

10 changes: 1 addition & 9 deletions test/basic/raffle.test.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import { BigNumber } from 'ethersv5'
import { getRaffleInfo, generateAmountsDistribution, claimRaffleLink, interfaces } from '../../src'
import { generateAmountsDistribution, claimRaffleLink, interfaces } from '../../src'
import { makeRandomAddress } from '../util'
import dotenv from 'dotenv'
dotenv.config()

const APIKey = process.env.PEANUT_DEV_API_KEY!

describe('raffle', () => {
test('get raffle info', async () => {
const link = 'https://red.peanut.to/packet?c=5000&v=v4.3&i=(33248,5098)&t=mantle#p=7SMDzKEn7ZOwdwPw'
const info = await getRaffleInfo({ link, APIKey })
console.log('Raffle info!', info)

expect(info).toBeDefined()
}, 120000)

test('generate amounts distribution', async () => {
const totalAmount = BigNumber.from(1e6)
const numberOfLinks = 1
Expand Down
8 changes: 0 additions & 8 deletions test/basic/supportsEIP1559.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ describe('supportsEIP1559', function () {
expect(result).toBe(true)
})

it('should return false for a provider that does not support EIP-1559', async () => {
// Use a provider that does not support EIP-1559 (mantle) EDIT: mantle now supports it. Lmao
// we'd need to use smth like ethereum classic (chainId 61)
const provider = new ethers.providers.JsonRpcProvider('https://besu-oc.etc-network.info ')
const result = await peanut.supportsEIP1559(provider)
expect(result).toBe(false)
})

it('should throw an error for an invalid provider', async () => {
// Use an invalid provider
const provider = {} as ethers.providers.Provider
Expand Down

0 comments on commit e553c28

Please sign in to comment.