Update tests
Update tbtcToDot burn value requirement
Add test for escrow mint condition on dotToTbtc
@@ -100,7 +100,7 @@ contract('VendingMachine', (accounts) => {
const lotSize = await deployed.TBTCConstants.getLotSize()
const satoshiMultiplier = await deployed.TBTCConstants.getSatoshiMultiplier()
signerFee = await deployed.TestDepositUtils.signerFee.call()
- depositValue = lotSize.mul(satoshiMultiplier).sub(signerFee)
+ depositValue = lotSize.mul(satoshiMultiplier)
})
describe('#isQualified', async () => {
@@ -136,6 +136,17 @@ contract('VendingMachine', (accounts) => {
await vendingMachine.dotToTbtc(dotId)
+ await assertBalance.tbtc(accounts[0], depositValue.sub(signerFee))
+ })
+
+ it('mints full lot size if backing deposit has signer fee escrowed', async () => {
+ await tbtcToken.forceMint(testInstance.address, signerFee)
+
+ await depositOwnerToken.forceMint(accounts[0], dotId)
+ await depositOwnerToken.approve(vendingMachine.address, dotId, { from: accounts[0] })
+
+ await vendingMachine.dotToTbtc(dotId)
+
await assertBalance.tbtc(accounts[0], depositValue)
})
@@ -283,7 +294,7 @@ contract('VendingMachine', (accounts) => {
await vendingMachine.unqualifiedDepositToTbtc(testInstance.address, _version, _txInputVector, _txOutputVector, _txLocktime, _fundingOutputIndex, _merkleProof, _txIndexInBlock, _bitcoinHeaders)
- await assertBalance.tbtc(accounts[0], depositValue)
+ await assertBalance.tbtc(accounts[0], depositValue.sub(signerFee))
await assertBalance.tbtc(testInstance.address, signerFee)
})
})
