@@ -2,7 +2,7 @@ import { expect } from 'chai';
22import { step } from 'mocha-steps' ;
33
44import { AltVM } from '@hyperlane-xyz/provider-sdk' ;
5- import { HookType } from '@hyperlane-xyz/provider-sdk/altvm' ;
5+ import { HookType , type ISigner } from '@hyperlane-xyz/provider-sdk/altvm' ;
66import {
77 type ArtifactDeployed ,
88 ArtifactState ,
@@ -19,14 +19,12 @@ import { assert, normalizeConfig } from '@hyperlane-xyz/utils';
1919
2020import { AleoSigner } from '../clients/signer.js' ;
2121import { AleoHookArtifactManager } from '../hook/hook-artifact-manager.js' ;
22- import { type AleoReceipt , type AleoTransaction } from '../utils/types.js' ;
2322
2423describe ( '6. aleo sdk Hook artifacts e2e tests' , async function ( ) {
2524 this . timeout ( 100_000 ) ;
2625
26+ let signer : ISigner < AnnotatedTx , TxReceipt > ;
2727 let aleoSigner : AleoSigner ;
28- let signer : AltVM . ISigner < AleoTransaction , AleoReceipt > ;
29- let providerSdkSigner : AltVM . ISigner < AnnotatedTx , TxReceipt > ;
3028 let artifactManager : AleoHookArtifactManager ;
3129 let mailboxAddress : string ;
3230
@@ -43,8 +41,6 @@ describe('6. aleo sdk Hook artifacts e2e tests', async function () {
4341 } ) ;
4442 signer = aleoSigner ;
4543
46- providerSdkSigner = signer as any ;
47-
4844 // Create a mailbox for hook testing
4945 const domainId = 1234 ;
5046 const mailbox = await aleoSigner . createMailbox ( {
@@ -64,7 +60,7 @@ describe('6. aleo sdk Hook artifacts e2e tests', async function () {
6460 // Create MerkleTree Hook using artifact writer
6561 const writer = artifactManager . createWriter (
6662 AltVM . HookType . MERKLE_TREE ,
67- signer as any ,
63+ aleoSigner ,
6864 ) ;
6965
7066 const [ deployedArtifact ] = await writer . create ( {
@@ -98,16 +94,16 @@ describe('6. aleo sdk Hook artifacts e2e tests', async function () {
9894 // Create IGP Hook using artifact writer
9995 const writer = artifactManager . createWriter (
10096 AltVM . HookType . INTERCHAIN_GAS_PAYMASTER ,
101- signer as any ,
97+ aleoSigner ,
10298 ) ;
10399
104100 const [ deployedArtifact ] = await writer . create ( {
105101 artifactState : ArtifactState . NEW ,
106102 config : {
107103 type : AltVM . HookType . INTERCHAIN_GAS_PAYMASTER ,
108- owner : signer . getSignerAddress ( ) ,
109- beneficiary : signer . getSignerAddress ( ) ,
110- oracleKey : signer . getSignerAddress ( ) ,
104+ owner : aleoSigner . getSignerAddress ( ) ,
105+ beneficiary : aleoSigner . getSignerAddress ( ) ,
106+ oracleKey : aleoSigner . getSignerAddress ( ) ,
111107 overhead : {
112108 [ DOMAIN_1 ] : 50000 ,
113109 [ DOMAIN_2 ] : 75000 ,
@@ -140,14 +136,14 @@ describe('6. aleo sdk Hook artifacts e2e tests', async function () {
140136 expect ( readHook . config . type ) . to . equal (
141137 AltVM . HookType . INTERCHAIN_GAS_PAYMASTER ,
142138 ) ;
143- expect ( readHook . config . owner ) . to . equal ( signer . getSignerAddress ( ) ) ;
139+ expect ( readHook . config . owner ) . to . equal ( aleoSigner . getSignerAddress ( ) ) ;
144140
145141 // Verify gas configs
146142 const expectedConfig = {
147143 type : AltVM . HookType . INTERCHAIN_GAS_PAYMASTER ,
148- owner : signer . getSignerAddress ( ) ,
149- beneficiary : signer . getSignerAddress ( ) ,
150- oracleKey : signer . getSignerAddress ( ) ,
144+ owner : aleoSigner . getSignerAddress ( ) ,
145+ beneficiary : aleoSigner . getSignerAddress ( ) ,
146+ oracleKey : aleoSigner . getSignerAddress ( ) ,
151147 overhead : {
152148 [ DOMAIN_1 ] : 50000 ,
153149 [ DOMAIN_2 ] : 75000 ,
@@ -173,7 +169,7 @@ describe('6. aleo sdk Hook artifacts e2e tests', async function () {
173169 // Update one of the gas configs using artifact writer
174170 const writer = artifactManager . createWriter (
175171 AltVM . HookType . INTERCHAIN_GAS_PAYMASTER ,
176- signer as any ,
172+ aleoSigner ,
177173 ) ;
178174
179175 // Read current config
@@ -208,7 +204,7 @@ describe('6. aleo sdk Hook artifacts e2e tests', async function () {
208204 // Execute update transactions
209205 const transactions = await writer . update ( updatedArtifact ) ;
210206 for ( const tx of transactions ) {
211- await providerSdkSigner . sendAndConfirmTransaction ( tx ) ;
207+ await signer . sendAndConfirmTransaction ( tx ) ;
212208 }
213209
214210 // Read and verify update
@@ -233,7 +229,7 @@ describe('6. aleo sdk Hook artifacts e2e tests', async function () {
233229 // Remove DOMAIN_2 config using artifact writer
234230 const writer = artifactManager . createWriter (
235231 AltVM . HookType . INTERCHAIN_GAS_PAYMASTER ,
236- signer as any ,
232+ aleoSigner ,
237233 ) ;
238234
239235 // Read current config
@@ -265,7 +261,7 @@ describe('6. aleo sdk Hook artifacts e2e tests', async function () {
265261 // Execute update transactions
266262 const transactions = await writer . update ( updatedArtifact ) ;
267263 for ( const tx of transactions ) {
268- await providerSdkSigner . sendAndConfirmTransaction ( tx ) ;
264+ await signer . sendAndConfirmTransaction ( tx ) ;
269265 }
270266
271267 // Read and verify removal
@@ -291,7 +287,7 @@ describe('6. aleo sdk Hook artifacts e2e tests', async function () {
291287 // Create IGP hook using the artifact writer with a different owner
292288 const writer = artifactManager . createWriter (
293289 AltVM . HookType . INTERCHAIN_GAS_PAYMASTER ,
294- signer as any ,
290+ aleoSigner ,
295291 ) ;
296292
297293 const [ deployedArtifact ] = await writer . create ( {
@@ -316,7 +312,9 @@ describe('6. aleo sdk Hook artifacts e2e tests', async function () {
316312 const readHook = await reader . read ( deployedArtifact . deployed . address ) ;
317313
318314 expect ( readHook . config . owner ) . to . equal ( newOwnerAddress ) ;
319- expect ( readHook . config . owner ) . to . not . equal ( signer . getSignerAddress ( ) ) ;
315+ expect ( readHook . config . owner ) . to . not . equal (
316+ aleoSigner . getSignerAddress ( ) ,
317+ ) ;
320318 } ,
321319 ) ;
322320 } ) ;
@@ -328,7 +326,7 @@ describe('6. aleo sdk Hook artifacts e2e tests', async function () {
328326 // Create MerkleTree Hook
329327 const writer = artifactManager . createWriter (
330328 AltVM . HookType . MERKLE_TREE ,
331- signer as any ,
329+ aleoSigner ,
332330 ) ;
333331
334332 const [ deployedHook ] = await writer . create ( {
@@ -352,16 +350,16 @@ describe('6. aleo sdk Hook artifacts e2e tests', async function () {
352350 // Create IGP Hook
353351 const writer = artifactManager . createWriter (
354352 AltVM . HookType . INTERCHAIN_GAS_PAYMASTER ,
355- signer as any ,
353+ aleoSigner ,
356354 ) ;
357355
358356 const [ deployedHook ] = await writer . create ( {
359357 artifactState : ArtifactState . NEW ,
360358 config : {
361359 type : AltVM . HookType . INTERCHAIN_GAS_PAYMASTER ,
362- owner : signer . getSignerAddress ( ) ,
363- beneficiary : signer . getSignerAddress ( ) ,
364- oracleKey : signer . getSignerAddress ( ) ,
360+ owner : aleoSigner . getSignerAddress ( ) ,
361+ beneficiary : aleoSigner . getSignerAddress ( ) ,
362+ oracleKey : aleoSigner . getSignerAddress ( ) ,
365363 overhead : {
366364 [ DOMAIN_1 ] : 50000 ,
367365 } ,
@@ -392,9 +390,9 @@ describe('6. aleo sdk Hook artifacts e2e tests', async function () {
392390 igpConfig . type === HookType . INTERCHAIN_GAS_PAYMASTER ,
393391 `Expected config to be of type ${ HookType . INTERCHAIN_GAS_PAYMASTER } ` ,
394392 ) ;
395- expect ( igpConfig . owner ) . to . equal ( signer . getSignerAddress ( ) ) ;
396- expect ( igpConfig . beneficiary ) . to . equal ( signer . getSignerAddress ( ) ) ;
397- expect ( igpConfig . oracleKey ) . to . equal ( signer . getSignerAddress ( ) ) ;
393+ expect ( igpConfig . owner ) . to . equal ( aleoSigner . getSignerAddress ( ) ) ;
394+ expect ( igpConfig . beneficiary ) . to . equal ( aleoSigner . getSignerAddress ( ) ) ;
395+ expect ( igpConfig . oracleKey ) . to . equal ( aleoSigner . getSignerAddress ( ) ) ;
398396 expect ( igpConfig . overhead [ DOMAIN_1 ] ) . to . equal ( 50000 ) ;
399397 expect ( igpConfig . oracleConfig [ DOMAIN_1 ] . gasPrice ) . to . equal ( '1000000000' ) ;
400398 expect ( igpConfig . oracleConfig [ DOMAIN_1 ] . tokenExchangeRate ) . to . equal (
0 commit comments