Test distributeFeeRebate FRT existance case
Make sure there is no revert when
Deposit TBTC balance > signerFee
&&
FRT does not exist
@@ -770,6 +770,14 @@ describe("DepositUtils", async function() {
})
describe("distributeFeeRebate()", async () => {
+ beforeEach(async () => {
+ await createSnapshot()
+ })
+
+ afterEach(async () => {
+ await restoreSnapshot()
+ })
+
it("checks that beneficiary is rewarded", async () => {
// min an arbitrary reward value to the funding contract
const reward = await testDeposit.signerFee.call()
@@ -786,6 +794,22 @@ describe("DepositUtils", async function() {
"tokens not rewarded to beneficiary correctly",
).to.eq.BN(tokenCheck)
})
+
+ it("does not revert if feeRebateToken does not exist and balance > signerFee", async () => {
+ feeRebateToken.burn(web3.utils.toBN(testDeposit.address), {
+ from: beneficiary,
+ })
+ // min an arbitrary reward value to the funding contract
+ const reward = await testDeposit.signerFee.call()
+ await tbtcToken.forceMint(testDeposit.address, reward)
+
+ const initialTokenBalance = await tbtcToken.balanceOf(beneficiary)
+
+ await testDeposit.distributeFeeRebate()
+
+ const finalTokenBalance = await tbtcToken.balanceOf(beneficiary)
+ expect(initialTokenBalance).to.eq.BN(finalTokenBalance)
+ })
})
describe("pushFundsToKeepGroup()", async () => {
