@@ -32,8 +32,7 @@ export type VotingRegistrationKeyType = {
3232 public : ( ...args : Array < any > ) => any ;
3333} ;
3434export type VotingDataType = {
35- stakeAddress : string ;
36- stakeAddressHex : string ;
35+ addressHex : string ;
3736 votingKey : string ;
3837 stakeKey : string ;
3938 role : PathRoleIdentityType ;
@@ -214,9 +213,10 @@ export default class VotingStore extends Store {
214213 } ;
215214 prepareVotingData = async ( { walletId } : { walletId : string } ) => {
216215 try {
217- const { stakeAddresses } = this . stores . addresses ;
218- const stakeAddress = stakeAddresses [ walletId ] ;
219- const stakeAddressHex = await this . _getHexFromBech32 ( stakeAddress ) ;
216+ const [ address ] = await this . stores . addresses . getAddressesByWalletId (
217+ walletId
218+ ) ;
219+ const addressHex = await this . _getHexFromBech32 ( address . id ) ;
220220 await this . _generateVotingRegistrationKey ( ) ;
221221 if ( ! this . votingRegistrationKey )
222222 throw new Error ( 'Failed to generate voting registration key.' ) ;
@@ -255,7 +255,7 @@ export default class VotingStore extends Store {
255255 int : 3 ,
256256 } ,
257257 v : {
258- bytes : stakeAddressHex ,
258+ bytes : addressHex ,
259259 } ,
260260 } ,
261261 {
@@ -283,8 +283,8 @@ export default class VotingStore extends Store {
283283 } ,
284284 } ;
285285 const votingData = {
286- stakeAddress ,
287- stakeAddressHex ,
286+ address ,
287+ addressHex ,
288288 votingKey,
289289 stakeKey,
290290 role : 'mutable_account' ,
@@ -337,16 +337,10 @@ export default class VotingStore extends Store {
337337 const votingData = await this . prepareVotingData ( {
338338 walletId,
339339 } ) ;
340- const {
341- stakeAddressHex,
342- votingKey,
343- stakeKey,
344- role,
345- index,
346- } = votingData ;
340+ const { addressHex, votingKey, stakeKey, role, index } = votingData ;
347341 // @ts -ignore ts-migrate(1320) FIXME: Type of 'await' operand must either be a valid pro... Remove this comment to see the full error message
348342 const signature = await this . signMetadataRequest . execute ( {
349- addressHex : stakeAddressHex ,
343+ addressHex,
350344 walletId,
351345 passphrase,
352346 votingKey,
@@ -359,7 +353,7 @@ export default class VotingStore extends Store {
359353 // @ts -ignore ts-migrate(1320) FIXME: Type of 'await' operand must either be a valid pro... Remove this comment to see the full error message
360354 await this . createVotingRegistrationTransactionRequest . execute ( {
361355 address : address . id ,
362- addressHex : stakeAddressHex ,
356+ addressHex,
363357 amount,
364358 passphrase,
365359 walletId,
0 commit comments