Skip to content

Commit

Permalink
chore(test): rm unuseful utils
Browse files Browse the repository at this point in the history
  • Loading branch information
gitmp01 committed Jul 27, 2024
1 parent c231b79 commit 6d041cb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 33 deletions.
5 changes: 1 addition & 4 deletions solidity/test/hardhat/Adapter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,7 @@ const deployERC1820 = () => helpers.setCode(ERC1820, ERC1820BYTES)
)

if (_isNative) {
await hre.network.provider.send('hardhat_setBalance', [
lockbox.target,
hre.ethers.toBeHex(amount),
])
await helpers.setBalance(lockbox.target, hre.ethers.toBeHex(amount))
} else {
await erc20.connect(owner).transfer(lockbox, amount)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { upgradeProxy } from '../utils/upgrade-proxy.cjs'
import PTokenAbi from './abi/bsc/PToken.json' assert { type: 'json' }
import Erc20Abi from './abi/eth/ERC20.json' assert { type: 'json' }
import VaultAbi from './abi/eth/Vault.json' assert { type: 'json' }
import { hardhatReset, hardhatSetBalance } from './utils/index.cjs'

const ADDRESS_PTOKEN_V1_VAULT = '0xe396757ec7e6ac7c8e5abe7285dde47b98f22db8' // vault on ETH
const ADDRESS_ERC20_TOKEN = '0x1fe24f25b1cf609b9c4e7e12d802e3640dfa5e43' // CGG on ETH
Expand Down Expand Up @@ -65,13 +64,13 @@ conditionalDescribe(
before(async () => {
const rpc = hre.config.networks.bscFork.url
const blockToForkFrom = 40729521 // 2024-07-23 15:22
await hardhatReset(hre, rpc, blockToForkFrom)
await helpers.reset(rpc, blockToForkFrom)

user = await hre.ethers.getImpersonatedSigner(
'0x816a99530B0f272Bb6ba4913b8952249f8d2E21b',
)

await hardhatSetBalance(hre, rpc, user.address, oneEth)
await helpers.setBalance(user.address, oneEth)
ptoken = await hre.ethers.getContractAt(PTokenAbi, ADDRESS_PTOKEN)
proxyAdminOwner = await hre.ethers.getImpersonatedSigner(
ADDRESS_PTOKEN_PROXY_ADMIN_OWNER,
Expand All @@ -81,7 +80,7 @@ conditionalDescribe(
ADDRESS_ERC20_TOKEN,
])

await hardhatSetBalance(hre, rpc, proxyAdminOwner.address, oneEth)
await helpers.setBalance(proxyAdminOwner.address, oneEth)
})

it('Should upgrade the ptoken successfully', async () => {
Expand Down Expand Up @@ -173,7 +172,7 @@ conditionalDescribe(
await xerc20.setLockbox(lockbox)
await xerc20.setLimits(adapterEth, mintingLimit, burningLimit)

await hardhatSetBalance(hre, rpc, pnetwork.address, oneEth)
await helpers.setBalance(pnetwork.address, oneEth)
})

it('Should transfer all the funds to the lockbox', async () => {
Expand Down
12 changes: 0 additions & 12 deletions solidity/test/hardhat/forked-environment/utils/hardhat-reset.cjs

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions solidity/test/hardhat/forked-environment/utils/index.cjs

This file was deleted.

0 comments on commit 6d041cb

Please sign in to comment.