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

Commit

Permalink
more fix
Browse files Browse the repository at this point in the history
  • Loading branch information
leovct committed Dec 5, 2023
1 parent 0fa96c1 commit c15196f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion migrations/7_pol_migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ module.exports = async function(deployer, _, _) {
const maticAmountToMintAndMigrateInDepositManager = oneEther.mul(web3.utils.toBN('1000000000')).toString() // 100 ethers
await migrateMatic(governance, newDepositManager, maticAmountToMintAndMigrateInDepositManager)

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

// Update contract addresses.
Expand Down
9 changes: 9 additions & 0 deletions migrations/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ 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 c15196f

Please sign in to comment.