Skip to content

Commit

Permalink
Skip the sign message step in deposit flow
Browse files Browse the repository at this point in the history
There is a bug in Ledger Live and the sign Bitcoin message feature
doesn't work correctly. As a temporary solution we skip this step to be
able to go through the whole deposit flow.
  • Loading branch information
r-czajkowski committed Apr 26, 2024
1 parent acd80cf commit f96e32a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions sdk/src/modules/staking/stake-initialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,18 @@ class StakeInitialization {
* @dev Use this function as a second step of the staking flow. Signed message
* is required to stake BTC.
*/
// eslint-disable-next-line @typescript-eslint/require-await
async signMessage() {
const { domain, types, message } = this.#getStakeMessageTypedData()

const signedMessage = await this.#messageSigner.sign(domain, types, message)

const addressFromSignature = signedMessage.verify()

if (!this.#staker.equals(addressFromSignature)) {
throw new Error("Invalid staker address")
}

this.#signedMessage = signedMessage
// TODO: Uncomment once the Ledger adds supports for signing Bitcoin
// messages.
// const { domain, types, message } = this.#getStakeMessageTypedData()
// const signedMessage = await this.#messageSigner.sign(domain, types,
// message)
// const addressFromSignature = signedMessage.verify()
// if (!this.#staker.equals(addressFromSignature)) { throw new
// Error("Invalid staker address") } this.#signedMessage = signedMessage

this.#signedMessage = {} as ChainSignedMessage
}

/**
Expand Down

0 comments on commit f96e32a

Please sign in to comment.