Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
leovct committed Dec 5, 2023
1 parent c15196f commit c5af77c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
11 changes: 10 additions & 1 deletion migrations/7_pol_migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ async function migrateMatic(governance, depositManager, mintAmount) {
*/
}

function assertBigNumberEquality(num1, num2) {
if (!ethUtils.BN.isBN(num1)) num1 = web3.utils.toBN(num1.toString())
if (!ethUtils.BN.isBN(num2)) num2 = web3.utils.toBN(num2.toString())
assert(
num1.eq(num2),
`expected ${num1.toString(10)} and ${num2.toString(10)} to be equal`
)
}

module.exports = async function(deployer, _, _) {
deployer.then(async() => {
const oneEther = web3.utils.toBN('10').pow(web3.utils.toBN('18'))
Expand All @@ -94,7 +103,7 @@ module.exports = async function(deployer, _, _) {
await migrateMatic(governance, newDepositManager, maticAmountToMintAndMigrateInDepositManager)

const newDepositManagerPOLBalance = await polToken.contract.methods.balanceOf(newDepositManager.address).call()
utils.assertBigNumberEquality(newDepositManagerPOLBalance, maticAmountToMintAndMigrateInDepositManager)
assertBigNumberEquality(newDepositManagerPOLBalance, maticAmountToMintAndMigrateInDepositManager)

// Update contract addresses.
contractAddresses.root.NewDepositManager = newDepositManager.address
Expand Down
9 changes: 0 additions & 9 deletions migrations/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,3 @@ export async function updateContractMap(governance, registry, name, value) {
registry.contract.methods.updateContractMap(ethUtils.keccak256(name), value).encodeABI()
)
}

export function assertBigNumberEquality(num1, num2) {
if (!ethUtils.BN.isBN(num1)) num1 = web3.utils.toBN(num1.toString())
if (!ethUtils.BN.isBN(num2)) num2 = web3.utils.toBN(num2.toString())
assert(
num1.eq(num2),
`expected ${num1.toString(10)} and ${num2.toString(10)} to be equal`
)
}

0 comments on commit c5af77c

Please sign in to comment.