File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
modules/utxo-staking/src/babylon Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ class BitGoStakingManager extends vendor.BabylonBtcStakingManager {
3939 stakerBtcAddress : string ,
4040 sigType : BTCSigType
4141 ) : Promise < ProofOfPossessionBTC > {
42+ if ( ! bech32Address . startsWith ( 'bbn1' ) ) {
43+ throw new Error ( 'invalid bech32 babylon address, must start with bbn1' ) ;
44+ }
4245 const signedBabylonAddress = await this . btcProvider . signMessage (
4346 bech32Address ,
4447 sigType === BTCSigType . BIP322 ? 'bip322-simple' : 'ecdsa'
@@ -65,11 +68,16 @@ class BitGoStakingManager extends vendor.BabylonBtcStakingManager {
6568
6669 /**
6770 * Creates a proof of possession for the staker based on ECDSA signature.
71+ * @param channel - The channel for which the proof of possession is created.
6872 * @param bech32Address - The staker's bech32 address on the babylon network.
6973 * @param stakerBtcAddress
7074 * @returns The proof of possession.
7175 */
72- async createProofOfPossession ( bech32Address : string , stakerBtcAddress : string ) : Promise < ProofOfPossessionBTC > {
76+ override async createProofOfPossession (
77+ channel : 'delegation:create' | 'delegation:register' ,
78+ bech32Address : string ,
79+ stakerBtcAddress : string
80+ ) : Promise < ProofOfPossessionBTC > {
7381 // force the ECDSA signature type
7482 return this . createProofOfPossessionWithSigType ( bech32Address , stakerBtcAddress , BTCSigType . ECDSA ) ;
7583 }
You can’t perform that action at this time.
0 commit comments