@@ -31,6 +31,10 @@ export class QueueAction {
3131 async queue ( params : QueueProposalParams ) : Promise < Transaction > {
3232 const walletClient = this . walletProvider . getWalletClient ( params . chain ) ;
3333
34+ if ( ! walletClient . account ) {
35+ throw new Error ( 'Wallet account is not available' ) ;
36+ }
37+
3438 const descriptionHash = keccak256 ( stringToHex ( params . description ) ) ;
3539
3640 const txData = encodeFunctionData ( {
@@ -51,18 +55,7 @@ export class QueueAction {
5155 value : BigInt ( 0 ) ,
5256 data : txData as Hex ,
5357 chain : chainConfig ,
54- kzg : {
55- blobToKzgCommitment : ( _blob : ByteArray ) : ByteArray => {
56- throw new Error ( "Function not implemented." ) ;
57- } ,
58- computeBlobKzgProof : (
59- _blob : ByteArray ,
60- _commitment : ByteArray
61- ) : ByteArray => {
62- throw new Error ( "Function not implemented." ) ;
63- } ,
64- } ,
65- } as any ) ;
58+ } ) ;
6659
6760 const receipt = await publicClient . waitForTransactionReceipt ( {
6861 hash,
@@ -77,10 +70,9 @@ export class QueueAction {
7770 chainId : this . walletProvider . getChainConfigs ( params . chain ) . id ,
7871 logs : receipt . logs ,
7972 } ;
80- } catch ( error ) {
81- throw new Error (
82- `Vote failed: ${ error instanceof Error ? error . message : String ( error ) } `
83- ) ;
73+ } catch ( error : unknown ) {
74+ const errorMessage = error instanceof Error ? error . message : String ( error ) ;
75+ throw new Error ( `Vote failed: ${ errorMessage } ` ) ;
8476 }
8577 }
8678}
@@ -122,15 +114,11 @@ export const queueAction = {
122114 const walletProvider = new WalletProvider ( privateKey , runtime ) ;
123115 const action = new QueueAction ( walletProvider ) ;
124116 return await action . queue ( queueParams ) ;
125- } catch ( error ) {
126- console . error (
127- "Error in queue handler:" ,
128- error instanceof Error ? error . message : String ( error )
129- ) ;
117+ } catch ( error : unknown ) {
118+ const errorMessage = error instanceof Error ? error . message : String ( error ) ;
119+ console . error ( 'Error in queue handler:' , errorMessage ) ;
130120 if ( callback ) {
131- callback ( {
132- text : `Error: ${ error instanceof Error ? error . message : String ( error ) } ` ,
133- } ) ;
121+ callback ( { text : `Error: ${ errorMessage } ` } ) ;
134122 }
135123 return false ;
136124 }
0 commit comments