@@ -126,9 +126,12 @@ export class AztecAdminClient {
126126 } ) ;
127127 } catch ( error ) {
128128 if ( requestSignal . aborted && ! signal ?. aborted ) {
129- throw new Error ( `${ request . label } request timed out after ${ this . timeoutMs } ms` ) ;
129+ throw new Error ( `${ request . label } request timed out after ${ this . timeoutMs } ms` , { cause : error } ) ;
130130 }
131- throw new Error ( `${ request . label } request failed: ${ error instanceof Error ? error . message : String ( error ) } ` ) ;
131+ throw new Error (
132+ `${ request . label } request failed: ${ error instanceof Error ? error . message : String ( error ) } ` ,
133+ { cause : error } ,
134+ ) ;
132135 }
133136
134137 const responseLimit = method === 'aztec_getValidatorStats'
@@ -172,8 +175,8 @@ export function parseNodeInfo(value) {
172175 }
173176 return {
174177 l1ChainId : parseChainId ( value . l1ChainId ) ,
175- registryAddress : parseIdentityAddress ( contracts . registryAddress , 'registryAddress' ) ,
176- rollupAddress : parseIdentityAddress ( contracts . rollupAddress , 'rollupAddress' ) ,
178+ registryAddress : parseAddress ( contracts . registryAddress , 'node info registryAddress' ) ,
179+ rollupAddress : parseAddress ( contracts . rollupAddress , 'node info rollupAddress' ) ,
177180 } ;
178181}
179182
@@ -337,13 +340,6 @@ function parseChainId(value) {
337340 return parsed ;
338341}
339342
340- function parseIdentityAddress ( value , name ) {
341- if ( typeof value !== 'string' || ! / ^ 0 x [ 0 - 9 a - f A - F ] { 40 } $ / . test ( value ) || / ^ 0 x 0 { 40 } $ / i. test ( value ) ) {
342- throw new Error ( `Aztec node info ${ name } must be a nonzero 20-byte hex address` ) ;
343- }
344- return value . toLowerCase ( ) ;
345- }
346-
347343function parseAddress ( value , label ) {
348344 if ( typeof value !== 'string' || ! / ^ 0 x [ 0 - 9 a - f A - F ] { 40 } $ / . test ( value ) || / ^ 0 x 0 { 40 } $ / i. test ( value ) ) {
349345 throw new Error ( `Aztec ${ label } must be a nonzero 20-byte hex address` ) ;
0 commit comments