Skip to content

Commit

Permalink
Request redemption via tBTC token
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszslabon committed Jul 14, 2023
1 parent 8380f5b commit 7aba3cf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion system-tests/test/deposit-redemption.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import type { UnspentTransactionOutput } from "@keep-network/tbtc-v2.ts/dist/src
import type { SystemTestsContext } from "./utils/context"
import type { RedemptionRequest } from "@keep-network/tbtc-v2.ts/dist/src/redemption"
import type { Deposit } from "@keep-network/tbtc-v2.ts/dist/src/deposit"
import { TBTCToken } from "@keep-network/tbtc-v2.ts/dist/src/ethereum"

chai.use(chaiAsPromised)

Expand All @@ -46,8 +47,10 @@ chai.use(chaiAsPromised)
describe("System Test - Deposit and redemption", () => {
let systemTestsContext: SystemTestsContext
let electrumClient: ElectrumClient
let tbtcTokenAddress: string
let bridgeAddress: string
let vaultAddress: string
let tbtcTokenHandle: TBTCToken
let maintainerBridgeHandle: EthereumBridge
let depositorBridgeHandle: EthereumBridge
let bank: Contract
Expand Down Expand Up @@ -77,9 +80,15 @@ describe("System Test - Deposit and redemption", () => {
ELECTRUM_RETRY_BACKOFF_STEP_MS
)

tbtcTokenAddress = deployedContracts.TBTC.address
bridgeAddress = deployedContracts.Bridge.address
vaultAddress = deployedContracts.TBTCVault.address

tbtcTokenHandle = new TBTCToken({
address: tbtcTokenAddress,
signerOrProvider: depositor,
})

maintainerBridgeHandle = new EthereumBridge({
address: bridgeAddress,
signerOrProvider: maintainer,
Expand Down Expand Up @@ -536,11 +545,12 @@ describe("System Test - Deposit and redemption", () => {
systemTestsContext.depositorBitcoinKeyPair.publicKey.compressed
)}`

await depositorBridgeHandle.requestRedemption(
await TBTC.requestRedemption(
systemTestsContext.walletBitcoinKeyPair.publicKey.compressed,
sweepUtxo,
redeemerOutputScript,
requestedAmount,
tbtcTokenHandle,
)

console.log(
Expand Down

0 comments on commit 7aba3cf

Please sign in to comment.