Skip to content

Commit

Permalink
update tests for latest hardhat compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoenten committed Jan 24, 2024
1 parent a68af36 commit 4dd8698
Show file tree
Hide file tree
Showing 8 changed files with 4,368 additions and 5,468 deletions.
5 changes: 0 additions & 5 deletions .env.tests.json

This file was deleted.

34 changes: 9 additions & 25 deletions hardhat.config.ts → hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { task } from "hardhat/config"
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"
import { BigNumber } from "ethers"
import "@nomiclabs/hardhat-waffle"
import '@nomiclabs/hardhat-etherscan'
import 'hardhat-abi-exporter'
import { APIKEY, TESTNETACCOUNT, MAINNETACCOUNT } from './.env.json'
import "hardhat-interface-generator"
import "hardhat-dependency-compiler"
require("@nomicfoundation/hardhat-toolbox")
require('hardhat-abi-exporter')
require("hardhat-interface-generator")
require("hardhat-dependency-compiler")

const { vars } = require("hardhat/config");

const FORK_FUJI = false
const FORK_MAINNET = false
Expand All @@ -16,22 +13,9 @@ const forkingData = FORK_FUJI ? {
url: 'https://api.avax.network/ext/bc/C/rpc'
} : undefined

task("accounts", "Prints the list of accounts", async (args, hre): Promise<void> => {
const accounts: SignerWithAddress[] = await hre.ethers.getSigners()
accounts.forEach((account: SignerWithAddress): void => {
console.log(account.address)
})
})

task("balances", "Prints the list of AVAX account balances", async (args, hre): Promise<void> => {
const accounts: SignerWithAddress[] = await hre.ethers.getSigners()
for(const account of accounts){
const balance: BigNumber = await hre.ethers.provider.getBalance(
account.address
);
console.log(`${account.address} has balance ${balance.toString()}`);
}
})
const APIKEY = vars.get('APIKEY', "")
const TESTNETACCOUNT = vars.get('TESTNETACCOUNT', "c1ff50a970e7529a24ad552bac0b8d68e75aec98520f397a60152e3b9052b9bf")
const MAINNETACCOUNT = vars.get('MAINNETACCOUNT', "79af9c4529db9e2182de735922ce691b05597b03be43d3adaeebd6cc0208eb98")

/**
* @type import('hardhat/config').HardhatUserConfig
Expand Down
Loading

0 comments on commit 4dd8698

Please sign in to comment.