Skip to content

Commit fa08f2a

Browse files
authored
chore(provider sdks): remove old alt vm signer and provider methods that have been replaced by the artifact api [PART 1] (#8593)
1 parent 6319f49 commit fa08f2a

42 files changed

Lines changed: 993 additions & 4436 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@hyperlane-xyz/provider-sdk': major
3+
'@hyperlane-xyz/sealevel-sdk': major
4+
'@hyperlane-xyz/cosmos-sdk': major
5+
'@hyperlane-xyz/radix-sdk': major
6+
'@hyperlane-xyz/starknet-sdk': major
7+
'@hyperlane-xyz/aleo-sdk': major
8+
'@hyperlane-xyz/tron-sdk': major
9+
'@hyperlane-xyz/deploy-sdk': major
10+
'@hyperlane-xyz/cli': major
11+
---
12+
13+
IProvider and ISigner interfaces were slimmed to their minimal surface. IProvider was reduced from 53 to 22 query-only methods by removing all get*Transaction methods. ISigner was reduced from 36 to 5 infrastructure methods by removing all action methods (createMailbox, setDefaultIsm, enrollRemoteRouter, etc.). Transaction building is now handled exclusively by artifact managers using concrete class methods or standalone helper functions.
14+
15+
Throwing stubs were removed from SVM, Cosmos, Radix, and Starknet provider/signer implementations. Old action-method-based e2e tests were replaced with artifact API equivalents. Cosmos routing ISM writer was fixed to handle domain route updates correctly via remove + re-add.

typescript/aleo-sdk/src/testing/utils.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { type AltVM } from '@hyperlane-xyz/provider-sdk';
21
import { type TestChainMetadata } from '@hyperlane-xyz/provider-sdk/chain';
32

43
import { AleoSigner } from '../clients/signer.js';
5-
import { type AleoReceipt, type AleoTransaction } from '../utils/types.js';
64

75
import {
86
TEST_ALEO_CHAIN_METADATA,
@@ -19,7 +17,7 @@ import {
1917
export async function createSigner(
2018
privateKey: string = TEST_ALEO_PRIVATE_KEY,
2119
chainMetadata: TestChainMetadata = TEST_ALEO_CHAIN_METADATA,
22-
): Promise<AltVM.ISigner<AleoTransaction, AleoReceipt>> {
20+
): Promise<AleoSigner> {
2321
return AleoSigner.connectWithSigner([chainMetadata.rpcUrl], privateKey, {
2422
metadata: chainMetadata,
2523
});
@@ -35,6 +33,6 @@ export async function createSigner(
3533
export async function createSigners(
3634
privateKeys: string[],
3735
chainMetadata: TestChainMetadata = TEST_ALEO_CHAIN_METADATA,
38-
): Promise<AltVM.ISigner<AleoTransaction, AleoReceipt>[]> {
36+
): Promise<AleoSigner[]> {
3937
return Promise.all(privateKeys.map((pk) => createSigner(pk, chainMetadata)));
4038
}

typescript/aleo-sdk/src/tests/1_interchain_security.e2e-test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,15 @@ import chai from 'chai';
33
import chaiAsPromised from 'chai-as-promised';
44
import { step } from 'mocha-steps';
55

6-
import { type AltVM } from '@hyperlane-xyz/provider-sdk';
7-
86
import { AleoSigner } from '../clients/signer.js';
9-
import { type AleoReceipt, type AleoTransaction } from '../utils/types.js';
107

118
chai.use(chaiAsPromised);
129
const { expect } = chai;
1310

1411
describe('1. aleo sdk interchain security e2e tests', async function () {
1512
this.timeout(100_000);
1613

17-
let signer: AltVM.ISigner<AleoTransaction, AleoReceipt>;
14+
let signer: AleoSigner;
1815

1916
let noop_ism: string;
2017
let routing_ism: string;

typescript/aleo-sdk/src/tests/2_core.e2e-test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ import { Account } from '@provablehq/sdk';
22
import { expect } from 'chai';
33
import { step } from 'mocha-steps';
44

5-
import { type AltVM } from '@hyperlane-xyz/provider-sdk';
6-
75
import { AleoSigner } from '../clients/signer.js';
8-
import { type AleoReceipt, type AleoTransaction } from '../utils/types.js';
96

107
describe('2. aleo sdk core e2e tests', async function () {
118
this.timeout(100_000);
129

13-
let signer: AltVM.ISigner<AleoTransaction, AleoReceipt>;
10+
let signer: AleoSigner;
1411

1512
let mailboxAddress: string;
1613
let ismAddress: string;

typescript/aleo-sdk/src/tests/3_post_dispatch.e2e-test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ import { Account } from '@provablehq/sdk';
22
import { expect } from 'chai';
33
import { step } from 'mocha-steps';
44

5-
import { type AltVM } from '@hyperlane-xyz/provider-sdk';
6-
75
import { AleoSigner } from '../clients/signer.js';
8-
import { type AleoReceipt, type AleoTransaction } from '../utils/types.js';
96

107
describe('3. aleo sdk post dispatch e2e tests', async function () {
118
this.timeout(100_000);
129

13-
let signer: AltVM.ISigner<AleoTransaction, AleoReceipt>;
10+
let signer: AleoSigner;
1411

1512
let mailboxAddress: string;
1613
let igpAddress: string;

typescript/aleo-sdk/src/tests/4_warp.e2e-test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ import {
2121
fromAleoAddress,
2222
stringToU128,
2323
} from '../utils/helper.js';
24-
import { type AleoReceipt, type AleoTransaction } from '../utils/types.js';
2524

2625
describe('4. aleo sdk warp e2e tests', async function () {
2726
this.timeout(100_000);
2827

29-
let signer: AltVM.ISigner<AleoTransaction, AleoReceipt>;
28+
let signer: AleoSigner;
3029

3130
let mailboxAddress: string;
3231
let collateralDenom: string;

typescript/aleo-sdk/src/tests/6_hook_artifacts.e2e-test.ts

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect } from 'chai';
22
import { step } from 'mocha-steps';
33

44
import { 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';
66
import {
77
type ArtifactDeployed,
88
ArtifactState,
@@ -19,14 +19,12 @@ import { assert, normalizeConfig } from '@hyperlane-xyz/utils';
1919

2020
import { AleoSigner } from '../clients/signer.js';
2121
import { AleoHookArtifactManager } from '../hook/hook-artifact-manager.js';
22-
import { type AleoReceipt, type AleoTransaction } from '../utils/types.js';
2322

2423
describe('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(

typescript/aleo-sdk/src/tests/8_mailbox_artifacts.e2e-test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import chai, { expect } from 'chai';
22
import chaiAsPromised from 'chai-as-promised';
33

44
import { AltVM } from '@hyperlane-xyz/provider-sdk';
5+
import { type ISigner } from '@hyperlane-xyz/provider-sdk/altvm';
56
import {
67
type ArtifactDeployed,
78
ArtifactState,
@@ -34,7 +35,7 @@ chai.use(chaiAsPromised);
3435
describe('8. aleo sdk Mailbox artifacts e2e tests', async function () {
3536
this.timeout(100_000);
3637

37-
let signer: AltVM.ISigner<AnnotatedTx, TxReceipt>;
38+
let signer: ISigner<AnnotatedTx, TxReceipt>;
3839
let aleoSigner: AleoSigner;
3940
let aleoClient: AnyAleoNetworkClient;
4041
let mailboxArtifactManager: AleoMailboxArtifactManager;
@@ -57,8 +58,8 @@ describe('8. aleo sdk Mailbox artifacts e2e tests', async function () {
5758
},
5859
},
5960
);
60-
6161
signer = aleoSigner;
62+
6263
aleoClient = aleoSigner.getAleoClient();
6364

6465
mailboxArtifactManager = new AleoMailboxArtifactManager(

typescript/cli/src/tests/cosmosnative/commands/helpers.ts

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import { DirectSecp256k1Wallet } from '@cosmjs/proto-signing';
22
import path from 'path';
33

4-
import { CosmosNativeSigner } from '@hyperlane-xyz/cosmos-sdk';
5-
import { type Address } from '@hyperlane-xyz/utils';
4+
import { AltVM } from '@hyperlane-xyz/provider-sdk';
5+
import {
6+
CosmosNativeSigner,
7+
CosmosWarpArtifactManager,
8+
} from '@hyperlane-xyz/cosmos-sdk';
9+
import { type Address, assert } from '@hyperlane-xyz/utils';
610

711
import { getContext } from '../../../context/context.js';
812
import { REGISTRY_PATH, getCombinedWarpRoutePath } from '../consts.js';
@@ -44,12 +48,27 @@ export async function deployCollateralToken(
4448
},
4549
);
4650

47-
const { tokenAddress } = await signer.createCollateralToken({
48-
mailboxAddress: mailbox,
49-
collateralDenom: metadata.nativeToken?.denom ?? '',
51+
const denom = metadata.nativeToken?.denom;
52+
assert(denom, `Missing nativeToken denom for chain ${chain}`);
53+
54+
const rpcUrls = signer.getRpcUrls();
55+
const artifactManager = new CosmosWarpArtifactManager(rpcUrls);
56+
const writer = artifactManager.createWriter(
57+
AltVM.TokenType.collateral,
58+
signer,
59+
);
60+
const [result] = await writer.create({
61+
config: {
62+
type: AltVM.TokenType.collateral,
63+
owner: signer.getSignerAddress(),
64+
mailbox,
65+
token: denom,
66+
remoteRouters: {},
67+
destinationGas: {},
68+
},
5069
});
5170

52-
return tokenAddress;
71+
return result.deployed.address;
5372
}
5473

5574
export async function deploySyntheticToken(
@@ -77,12 +96,24 @@ export async function deploySyntheticToken(
7796
},
7897
);
7998

80-
const { tokenAddress } = await signer.createSyntheticToken({
81-
mailboxAddress: mailbox,
82-
name: '',
83-
denom: '',
84-
decimals: 0,
99+
const rpcUrls = signer.getRpcUrls();
100+
const artifactManager = new CosmosWarpArtifactManager(rpcUrls);
101+
const writer = artifactManager.createWriter(
102+
AltVM.TokenType.synthetic,
103+
signer,
104+
);
105+
const [result] = await writer.create({
106+
config: {
107+
type: AltVM.TokenType.synthetic,
108+
owner: signer.getSignerAddress(),
109+
mailbox,
110+
name: '',
111+
symbol: '',
112+
decimals: 0,
113+
remoteRouters: {},
114+
destinationGas: {},
115+
},
85116
});
86117

87-
return tokenAddress;
118+
return result.deployed.address;
88119
}

0 commit comments

Comments
 (0)