Skip to content

Commit

Permalink
Remove unnecessary method from MockBridge
Browse files Browse the repository at this point in the history
It's no longer needed since we refactored the `requestRedemption`
function in `9249ee5` and `06601b9`.
  • Loading branch information
r-czajkowski committed Jul 6, 2023
1 parent 5c3aba9 commit e814eca
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions typescript/test/utils/mock-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,40 +326,4 @@ export class MockBridge implements Bridge {
walletRegistry(): Promise<WalletRegistry> {
throw new Error("not implemented")
}

buildRedemptionData(
redeemer: Identifier,
walletPublicKey: string,
mainUtxo: UnspentTransactionOutput,
redeemerOutputScript: string
): Hex {
this._buildRedemptionDataLog.push({
redeemer,
walletPublicKey,
mainUtxo,
redeemerOutputScript,
})

// Convert the output script to raw bytes buffer.
const rawRedeemerOutputScript = Buffer.from(redeemerOutputScript, "hex")
// Prefix the output script bytes buffer with 0x and its own length.
const prefixedRawRedeemerOutputScript = `0x${Buffer.concat([
Buffer.from([rawRedeemerOutputScript.length]),
rawRedeemerOutputScript,
]).toString("hex")}`

return Hex.from(
utils.defaultAbiCoder.encode(
["address", "bytes20", "bytes32", "uint32", "uint64", "bytes"],
[
redeemer.identifierHex,
`0x${computeHash160(walletPublicKey)}`,
mainUtxo.transactionHash.reverse().toPrefixedString(),
mainUtxo.outputIndex,
mainUtxo.value,
prefixedRawRedeemerOutputScript,
]
)
)
}
}

0 comments on commit e814eca

Please sign in to comment.