diff --git a/solidity/contracts/bridge/Bridge.sol b/solidity/contracts/bridge/Bridge.sol index 454b78cb1..2bac3cd12 100644 --- a/solidity/contracts/bridge/Bridge.sol +++ b/solidity/contracts/bridge/Bridge.sol @@ -632,11 +632,13 @@ contract Bridge is function mock__submitRedemptionProof( bytes20 walletPubKeyHash, - bytes calldata redeemerOutputScript + bytes calldata redeemerOutputScript, + bytes32 redemptionTxHash ) external { self.mock__submitRedemptionProof( walletPubKeyHash, - redeemerOutputScript + redeemerOutputScript, + redemptionTxHash ); } diff --git a/solidity/contracts/bridge/Redemption.sol b/solidity/contracts/bridge/Redemption.sol index cebc6f13c..6fe5f5888 100644 --- a/solidity/contracts/bridge/Redemption.sol +++ b/solidity/contracts/bridge/Redemption.sol @@ -638,7 +638,8 @@ library Redemption { function mock__submitRedemptionProof( BridgeState.Storage storage self, bytes20 walletPubKeyHash, - bytes calldata redeemerOutputScript + bytes calldata redeemerOutputScript, + bytes32 redemptionTxHash ) external { uint256 redemptionKey = getRedemptionKey( walletPubKeyHash, @@ -650,7 +651,7 @@ library Redemption { uint64 redeemableAmount = request.requestedAmount - request.treasuryFee; delete self.pendingRedemptions[redemptionKey]; - emit RedemptionsCompleted(walletPubKeyHash, 0x0); + emit RedemptionsCompleted(walletPubKeyHash, redemptionTxHash); self.bank.decreaseBalance(redeemableAmount); self.bank.transferBalance(self.treasury, request.treasuryFee); diff --git a/solidity/tasks/dapp.ts b/solidity/tasks/dapp.ts index 0cba1adc1..96717431a 100644 --- a/solidity/tasks/dapp.ts +++ b/solidity/tasks/dapp.ts @@ -81,9 +81,20 @@ task("dapp:submit-redemption-proof", "Submits a redemption proof") undefined, types.string ) + .addParam( + "redemptionTxHash", + "Hash of the redemption transaction on the Bitcoin chain.", + undefined, + types.string + ) .setAction(async (args, hre) => { - const { walletPubKeyHash, redeemerOutputScript } = args - await submitRedemptionProof(hre, walletPubKeyHash, redeemerOutputScript) + const { walletPubKeyHash, redeemerOutputScript, redemptionTxHash } = args + await submitRedemptionProof( + hre, + walletPubKeyHash, + redeemerOutputScript, + redemptionTxHash + ) }) task( @@ -233,14 +244,16 @@ async function submitDepositSweepProof( async function submitRedemptionProof( hre: HardhatRuntimeEnvironment, walletPubKeyHash: string, - redeemerOutputScript: string + redeemerOutputScript: string, + redemptionTxHash: string ) { const { helpers } = hre const bridge = await helpers.contracts.getContract("Bridge") const tx = await bridge.mock__submitRedemptionProof( walletPubKeyHash, - redeemerOutputScript + redeemerOutputScript, + redemptionTxHash ) await tx.wait()