Expose getOwnerRedemptionTbtcRequirement
Expose this so VendingMachine can use it
@@ -42,6 +42,10 @@ contract Deposit {
return self.remainingTerm();
}
+ function getOwnerRedemptionTbtcRequirement(address _redeemer) public view returns(uint256){
+ return self.getOwnerRedemptionTbtcRequirement(_redeemer);
+ }
+
/// @notice Get the signer fee for the Deposit.
/// @return Fee amount in TBTC
function signerFee() public view returns (uint256) {
@@ -78,11 +82,28 @@ contract Deposit {
/// @param _requesterPKH The 20-byte Bitcoin pubkeyhash to which to send funds
/// @return True if successful, otherwise revert
function requestRedemption(
+ bytes8 _outputValueBytes,
+ bytes20 _requesterPKH
+ ) public returns (bool) {
+ self.requestRedemption(_outputValueBytes, _requesterPKH);
+ return true;
+ }
+
+ /// @notice Anyone can request redemption
+ /// @dev The redeemer specifies details about the Bitcoin redemption tx
+ /// @param _outputValueBytes The 8-byte LE output size
+ /// @param _requesterPKH The 20-byte Bitcoin pubkeyhash to which to send funds
+ /// @param _finalRecipient The address to receive the TDT and later be recorded as deposit redeemer.
+ function requestRedemptionAndTransfer(
bytes8 _outputValueBytes,
bytes20 _requesterPKH,
- address payable _requesterAddress
+ address payable _finalRecipient
) public returns (bool) {
- self.requestRedemption(_outputValueBytes, _requesterPKH, _requesterAddress);
+ self.requestRedemptionAndTransfer(
+ _outputValueBytes,
+ _requesterPKH,
+ _finalRecipient
+ );
return true;
}
