@hyperlane-xyz/deploy-sdk 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AltVMCoreModule.d.ts +94 -0
- package/dist/AltVMCoreModule.d.ts.map +1 -0
- package/dist/AltVMCoreModule.js +328 -0
- package/dist/AltVMCoreModule.js.map +1 -0
- package/dist/AltVMCoreReader.d.ts +17 -0
- package/dist/AltVMCoreReader.d.ts.map +1 -0
- package/dist/AltVMCoreReader.js +31 -0
- package/dist/AltVMCoreReader.js.map +1 -0
- package/dist/AltVMHookModule.d.ts +41 -0
- package/dist/AltVMHookModule.d.ts.map +1 -0
- package/dist/AltVMHookModule.js +176 -0
- package/dist/AltVMHookModule.js.map +1 -0
- package/dist/AltVMHookReader.d.ts +17 -0
- package/dist/AltVMHookReader.d.ts.map +1 -0
- package/dist/AltVMHookReader.js +76 -0
- package/dist/AltVMHookReader.js.map +1 -0
- package/dist/AltVMIsmModule.d.ts +41 -0
- package/dist/AltVMIsmModule.d.ts.map +1 -0
- package/dist/AltVMIsmModule.js +255 -0
- package/dist/AltVMIsmModule.js.map +1 -0
- package/dist/AltVMIsmReader.d.ts +19 -0
- package/dist/AltVMIsmReader.d.ts.map +1 -0
- package/dist/AltVMIsmReader.js +101 -0
- package/dist/AltVMIsmReader.js.map +1 -0
- package/dist/AltVMWarpDeployer.d.ts +14 -0
- package/dist/AltVMWarpDeployer.d.ts.map +1 -0
- package/dist/AltVMWarpDeployer.js +69 -0
- package/dist/AltVMWarpDeployer.js.map +1 -0
- package/dist/AltVMWarpModule.d.ts +96 -0
- package/dist/AltVMWarpModule.d.ts.map +1 -0
- package/dist/AltVMWarpModule.js +329 -0
- package/dist/AltVMWarpModule.js.map +1 -0
- package/dist/AltVMWarpModule.test.d.ts +2 -0
- package/dist/AltVMWarpModule.test.d.ts.map +1 -0
- package/dist/AltVMWarpModule.test.js +403 -0
- package/dist/AltVMWarpModule.test.js.map +1 -0
- package/dist/AltVMWarpRouteReader.d.ts +52 -0
- package/dist/AltVMWarpRouteReader.d.ts.map +1 -0
- package/dist/AltVMWarpRouteReader.js +145 -0
- package/dist/AltVMWarpRouteReader.js.map +1 -0
- package/dist/core-module.d.ts +5 -0
- package/dist/core-module.d.ts.map +1 -0
- package/dist/core-module.js +28 -0
- package/dist/core-module.js.map +1 -0
- package/dist/hook-module.d.ts +5 -0
- package/dist/hook-module.d.ts.map +1 -0
- package/dist/hook-module.js +35 -0
- package/dist/hook-module.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/ism-module.d.ts +5 -0
- package/dist/ism-module.d.ts.map +1 -0
- package/dist/ism-module.js +35 -0
- package/dist/ism-module.js.map +1 -0
- package/dist/protocol.d.ts +3 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +23 -0
- package/dist/protocol.js.map +1 -0
- package/dist/utils/validation.d.ts +37 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +66 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/warp-module.d.ts +5 -0
- package/dist/warp-module.d.ts.map +1 -0
- package/dist/warp-module.js +28 -0
- package/dist/warp-module.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AltVMWarpModule.test.d.ts","sourceRoot":"","sources":["../src/AltVMWarpModule.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import chai from 'chai';
|
|
2
|
+
import chaiAsPromised from 'chai-as-promised';
|
|
3
|
+
import Sinon from 'sinon';
|
|
4
|
+
import { MockSigner } from '@hyperlane-xyz/provider-sdk';
|
|
5
|
+
import { TokenType, } from '@hyperlane-xyz/provider-sdk/warp';
|
|
6
|
+
import { AltVMWarpModule } from './AltVMWarpModule.js';
|
|
7
|
+
const TestChainName = {
|
|
8
|
+
test1: 'test1',
|
|
9
|
+
};
|
|
10
|
+
chai.use(chaiAsPromised);
|
|
11
|
+
const expect = chai.expect;
|
|
12
|
+
/*
|
|
13
|
+
|
|
14
|
+
TEST CASES - AltVMWarpModule tests
|
|
15
|
+
|
|
16
|
+
* no updates needed if the config is the same
|
|
17
|
+
* update ownership
|
|
18
|
+
* new remote router with invalid config
|
|
19
|
+
* new remote router
|
|
20
|
+
* multiple new remote routers
|
|
21
|
+
* remove existing remote router
|
|
22
|
+
* update existing router address
|
|
23
|
+
* update existing router gas
|
|
24
|
+
* remove and add remote router at the same time
|
|
25
|
+
* new ISM
|
|
26
|
+
* update existing ISM
|
|
27
|
+
|
|
28
|
+
*/
|
|
29
|
+
describe('AltVMWarpModule', () => {
|
|
30
|
+
let signer;
|
|
31
|
+
let warpModule;
|
|
32
|
+
let chainLookup;
|
|
33
|
+
const tokenAddress = '0x726f757465725f61707000000000000000000000000000010000000000000000';
|
|
34
|
+
const actualConfig = {
|
|
35
|
+
type: TokenType.collateral,
|
|
36
|
+
owner: 'hyp1jq304cthpx0lwhpqzrdjrcza559ukyy3sc4dw5',
|
|
37
|
+
mailbox: '0x68797065726c616e650000000000000000000000000000000000000000000000',
|
|
38
|
+
token: 'uhyp',
|
|
39
|
+
remoteRouters: {
|
|
40
|
+
'1234': {
|
|
41
|
+
address: '0x726f757465725f61707000000000000000000000000000010000000000000000',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
destinationGas: {
|
|
45
|
+
'1234': '200000',
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
let readStub;
|
|
49
|
+
beforeEach(async () => {
|
|
50
|
+
signer = await MockSigner.connectWithSigner();
|
|
51
|
+
Sinon.stub(signer, 'getSignerAddress').returns(actualConfig.owner);
|
|
52
|
+
// Create mock chainLookup
|
|
53
|
+
chainLookup = {
|
|
54
|
+
getChainMetadata: () => ({ name: TestChainName.test1, domainId: 1 }),
|
|
55
|
+
getChainName: () => TestChainName.test1,
|
|
56
|
+
getDomainId: () => 1,
|
|
57
|
+
getKnownChainNames: () => [TestChainName.test1],
|
|
58
|
+
};
|
|
59
|
+
warpModule = new AltVMWarpModule(chainLookup, signer, {
|
|
60
|
+
chain: TestChainName.test1,
|
|
61
|
+
config: actualConfig,
|
|
62
|
+
addresses: {
|
|
63
|
+
deployedTokenRoute: tokenAddress,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
readStub = Sinon.stub(warpModule, 'read').resolves(actualConfig);
|
|
67
|
+
});
|
|
68
|
+
it('no updates needed if the config is the same', async () => {
|
|
69
|
+
// ARRANGE
|
|
70
|
+
const expectedConfig = actualConfig;
|
|
71
|
+
// ACT
|
|
72
|
+
const updateTransactions = await warpModule.update(expectedConfig);
|
|
73
|
+
// ASSERT
|
|
74
|
+
expect(updateTransactions).to.have.lengthOf(0);
|
|
75
|
+
});
|
|
76
|
+
it('update ownership', async () => {
|
|
77
|
+
// ARRANGE
|
|
78
|
+
const newOwner = 'hyp1hvg7zsnrj6h29q9ss577mhrxa04rn94hv2cm2e';
|
|
79
|
+
const expectedConfig = {
|
|
80
|
+
...actualConfig,
|
|
81
|
+
owner: newOwner,
|
|
82
|
+
};
|
|
83
|
+
const updateOwner = Sinon.stub(signer, 'getSetTokenOwnerTransaction').resolves();
|
|
84
|
+
// ACT
|
|
85
|
+
const updateTransactions = await warpModule.update(expectedConfig);
|
|
86
|
+
// ASSERT
|
|
87
|
+
expect(updateTransactions).to.have.lengthOf(1);
|
|
88
|
+
expect(updateTransactions[0].annotation).to.include('Transferring ownership of');
|
|
89
|
+
expect(updateOwner.calledOnceWith({
|
|
90
|
+
signer: actualConfig.owner,
|
|
91
|
+
tokenAddress,
|
|
92
|
+
newOwner,
|
|
93
|
+
})).to.be.true;
|
|
94
|
+
});
|
|
95
|
+
it('new remote router with invalid config', async () => {
|
|
96
|
+
// ARRANGE
|
|
97
|
+
const newRemoteRouter = {
|
|
98
|
+
receiverDomainId: 4321,
|
|
99
|
+
receiverAddress: '0x726f757465725f61707000000000000000000000000000020000000000000000',
|
|
100
|
+
gas: '300000',
|
|
101
|
+
};
|
|
102
|
+
// only add new router to remote routers and not to destination gas
|
|
103
|
+
const expectedConfig = {
|
|
104
|
+
...actualConfig,
|
|
105
|
+
remoteRouters: {
|
|
106
|
+
...actualConfig.remoteRouters,
|
|
107
|
+
[newRemoteRouter.receiverDomainId]: {
|
|
108
|
+
address: newRemoteRouter.receiverAddress,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
// ACT & ASSERT
|
|
113
|
+
expect(warpModule.update(expectedConfig)).to.be.rejectedWith(Error);
|
|
114
|
+
});
|
|
115
|
+
it('new remote router', async () => {
|
|
116
|
+
// ARRANGE
|
|
117
|
+
const newRemoteRouter = {
|
|
118
|
+
receiverDomainId: 4321,
|
|
119
|
+
receiverAddress: '0x726f757465725f61707000000000000000000000000000020000000000000000',
|
|
120
|
+
gas: '300000',
|
|
121
|
+
};
|
|
122
|
+
const expectedConfig = {
|
|
123
|
+
...actualConfig,
|
|
124
|
+
remoteRouters: {
|
|
125
|
+
...actualConfig.remoteRouters,
|
|
126
|
+
[newRemoteRouter.receiverDomainId]: {
|
|
127
|
+
address: newRemoteRouter.receiverAddress,
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
destinationGas: {
|
|
131
|
+
...actualConfig.destinationGas,
|
|
132
|
+
[newRemoteRouter.receiverDomainId]: newRemoteRouter.gas,
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
const enrollRouter = Sinon.stub(signer, 'getEnrollRemoteRouterTransaction').resolves();
|
|
136
|
+
// ACT
|
|
137
|
+
const updateTransactions = await warpModule.update(expectedConfig);
|
|
138
|
+
// ASSERT
|
|
139
|
+
expect(updateTransactions).to.have.lengthOf(1);
|
|
140
|
+
expect(updateTransactions[0].annotation).to.include('Enrolling Router');
|
|
141
|
+
expect(enrollRouter.calledOnceWith({
|
|
142
|
+
signer: actualConfig.owner,
|
|
143
|
+
tokenAddress,
|
|
144
|
+
remoteRouter: newRemoteRouter,
|
|
145
|
+
})).to.be.true;
|
|
146
|
+
});
|
|
147
|
+
it('multiple new remote routers', async () => {
|
|
148
|
+
// ARRANGE
|
|
149
|
+
const newRemoteRouter1 = {
|
|
150
|
+
receiverDomainId: 4321,
|
|
151
|
+
receiverAddress: '0x726f757465725f61707000000000000000000000000000020000000000000000',
|
|
152
|
+
gas: '300000',
|
|
153
|
+
};
|
|
154
|
+
const newRemoteRouter2 = {
|
|
155
|
+
receiverDomainId: 5321,
|
|
156
|
+
receiverAddress: '0x726f757465725f61707000000000000000000000000000030000000000000000',
|
|
157
|
+
gas: '400000',
|
|
158
|
+
};
|
|
159
|
+
const expectedConfig = {
|
|
160
|
+
...actualConfig,
|
|
161
|
+
remoteRouters: {
|
|
162
|
+
...actualConfig.remoteRouters,
|
|
163
|
+
[newRemoteRouter1.receiverDomainId]: {
|
|
164
|
+
address: newRemoteRouter1.receiverAddress,
|
|
165
|
+
},
|
|
166
|
+
[newRemoteRouter2.receiverDomainId]: {
|
|
167
|
+
address: newRemoteRouter2.receiverAddress,
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
destinationGas: {
|
|
171
|
+
...actualConfig.destinationGas,
|
|
172
|
+
[newRemoteRouter1.receiverDomainId]: newRemoteRouter1.gas,
|
|
173
|
+
[newRemoteRouter2.receiverDomainId]: newRemoteRouter2.gas,
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
const enrollRouter = Sinon.stub(signer, 'getEnrollRemoteRouterTransaction').resolves();
|
|
177
|
+
// ACT
|
|
178
|
+
const updateTransactions = await warpModule.update(expectedConfig);
|
|
179
|
+
// ASSERT
|
|
180
|
+
expect(updateTransactions).to.have.lengthOf(2);
|
|
181
|
+
expect(updateTransactions[0].annotation).to.include('Enrolling Router');
|
|
182
|
+
expect(updateTransactions[1].annotation).to.include('Enrolling Router');
|
|
183
|
+
expect(enrollRouter.calledWith({
|
|
184
|
+
signer: actualConfig.owner,
|
|
185
|
+
tokenAddress,
|
|
186
|
+
remoteRouter: newRemoteRouter1,
|
|
187
|
+
})).to.be.true;
|
|
188
|
+
expect(enrollRouter.calledWith({
|
|
189
|
+
signer: actualConfig.owner,
|
|
190
|
+
tokenAddress,
|
|
191
|
+
remoteRouter: newRemoteRouter2,
|
|
192
|
+
})).to.be.true;
|
|
193
|
+
});
|
|
194
|
+
it('remove existing remote router', async () => {
|
|
195
|
+
// ARRANGE
|
|
196
|
+
const expectedConfig = {
|
|
197
|
+
...actualConfig,
|
|
198
|
+
remoteRouters: {},
|
|
199
|
+
destinationGas: {},
|
|
200
|
+
};
|
|
201
|
+
const unenrollRouter = Sinon.stub(signer, 'getUnenrollRemoteRouterTransaction').resolves();
|
|
202
|
+
// ACT
|
|
203
|
+
const updateTransactions = await warpModule.update(expectedConfig);
|
|
204
|
+
// ASSERT
|
|
205
|
+
expect(updateTransactions).to.have.lengthOf(1);
|
|
206
|
+
expect(updateTransactions[0].annotation).to.include('Unenrolling Router');
|
|
207
|
+
expect(unenrollRouter.calledOnceWith({
|
|
208
|
+
signer: actualConfig.owner,
|
|
209
|
+
tokenAddress,
|
|
210
|
+
receiverDomainId: 1234,
|
|
211
|
+
})).to.be.true;
|
|
212
|
+
});
|
|
213
|
+
it('update existing router address', async () => {
|
|
214
|
+
// ARRANGE
|
|
215
|
+
const newAddress = '0x726f757465725f61707000000000000000000000000000020000000000000000';
|
|
216
|
+
const expectedConfig = {
|
|
217
|
+
...actualConfig,
|
|
218
|
+
remoteRouters: {
|
|
219
|
+
'1234': {
|
|
220
|
+
address: newAddress,
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
const enrollRouter = Sinon.stub(signer, 'getEnrollRemoteRouterTransaction').resolves();
|
|
225
|
+
const unenrollRouter = Sinon.stub(signer, 'getUnenrollRemoteRouterTransaction').resolves();
|
|
226
|
+
// ACT
|
|
227
|
+
const updateTransactions = await warpModule.update(expectedConfig);
|
|
228
|
+
// ASSERT
|
|
229
|
+
expect(updateTransactions).to.have.lengthOf(2);
|
|
230
|
+
expect(updateTransactions[0].annotation).to.include('Unenrolling Router');
|
|
231
|
+
expect(updateTransactions[1].annotation).to.include('Enrolling Router');
|
|
232
|
+
expect(enrollRouter.calledOnceWith({
|
|
233
|
+
signer: actualConfig.owner,
|
|
234
|
+
tokenAddress,
|
|
235
|
+
remoteRouter: {
|
|
236
|
+
receiverDomainId: 1234,
|
|
237
|
+
receiverAddress: newAddress,
|
|
238
|
+
gas: '200000',
|
|
239
|
+
},
|
|
240
|
+
})).to.be.true;
|
|
241
|
+
expect(unenrollRouter.calledOnceWith({
|
|
242
|
+
signer: actualConfig.owner,
|
|
243
|
+
tokenAddress,
|
|
244
|
+
receiverDomainId: 1234,
|
|
245
|
+
})).to.be.true;
|
|
246
|
+
});
|
|
247
|
+
it('update existing router gas', async () => {
|
|
248
|
+
// ARRANGE
|
|
249
|
+
const newGas = '300000';
|
|
250
|
+
const expectedConfig = {
|
|
251
|
+
...actualConfig,
|
|
252
|
+
destinationGas: {
|
|
253
|
+
'1234': newGas,
|
|
254
|
+
},
|
|
255
|
+
};
|
|
256
|
+
const enrollRouter = Sinon.stub(signer, 'getEnrollRemoteRouterTransaction').resolves();
|
|
257
|
+
const unenrollRouter = Sinon.stub(signer, 'getUnenrollRemoteRouterTransaction').resolves();
|
|
258
|
+
// ACT
|
|
259
|
+
const updateTransactions = await warpModule.update(expectedConfig);
|
|
260
|
+
// ASSERT
|
|
261
|
+
expect(updateTransactions).to.have.lengthOf(2);
|
|
262
|
+
expect(updateTransactions[0].annotation).to.include('Unenrolling Router');
|
|
263
|
+
expect(updateTransactions[1].annotation).to.include('Enrolling Router');
|
|
264
|
+
expect(enrollRouter.calledOnceWith({
|
|
265
|
+
signer: actualConfig.owner,
|
|
266
|
+
tokenAddress,
|
|
267
|
+
remoteRouter: {
|
|
268
|
+
receiverDomainId: 1234,
|
|
269
|
+
receiverAddress: '0x726f757465725f61707000000000000000000000000000010000000000000000',
|
|
270
|
+
gas: newGas,
|
|
271
|
+
},
|
|
272
|
+
})).to.be.true;
|
|
273
|
+
expect(unenrollRouter.calledOnceWith({
|
|
274
|
+
signer: actualConfig.owner,
|
|
275
|
+
tokenAddress,
|
|
276
|
+
receiverDomainId: 1234,
|
|
277
|
+
})).to.be.true;
|
|
278
|
+
});
|
|
279
|
+
it('remove and add remote router at the same time', async () => {
|
|
280
|
+
// ARRANGE
|
|
281
|
+
const expectedConfig = {
|
|
282
|
+
...actualConfig,
|
|
283
|
+
remoteRouters: {
|
|
284
|
+
'4321': {
|
|
285
|
+
address: '0x726f757465725f61707000000000000000000000000000020000000000000000',
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
destinationGas: {
|
|
289
|
+
'4321': '300000',
|
|
290
|
+
},
|
|
291
|
+
};
|
|
292
|
+
const enrollRouter = Sinon.stub(signer, 'getEnrollRemoteRouterTransaction').resolves();
|
|
293
|
+
const unenrollRouter = Sinon.stub(signer, 'getUnenrollRemoteRouterTransaction').resolves();
|
|
294
|
+
// ACT
|
|
295
|
+
const updateTransactions = await warpModule.update(expectedConfig);
|
|
296
|
+
// ASSERT
|
|
297
|
+
expect(updateTransactions).to.have.lengthOf(2);
|
|
298
|
+
expect(updateTransactions[0].annotation).to.include('Unenrolling Router');
|
|
299
|
+
expect(updateTransactions[1].annotation).to.include('Enrolling Router');
|
|
300
|
+
expect(enrollRouter.calledOnceWith({
|
|
301
|
+
signer: actualConfig.owner,
|
|
302
|
+
tokenAddress,
|
|
303
|
+
remoteRouter: {
|
|
304
|
+
receiverDomainId: 4321,
|
|
305
|
+
receiverAddress: '0x726f757465725f61707000000000000000000000000000020000000000000000',
|
|
306
|
+
gas: '300000',
|
|
307
|
+
},
|
|
308
|
+
})).to.be.true;
|
|
309
|
+
expect(unenrollRouter.calledOnceWith({
|
|
310
|
+
signer: actualConfig.owner,
|
|
311
|
+
tokenAddress,
|
|
312
|
+
receiverDomainId: 1234,
|
|
313
|
+
})).to.be.true;
|
|
314
|
+
});
|
|
315
|
+
it('new ISM', async () => {
|
|
316
|
+
// ARRANGE
|
|
317
|
+
const newIsmAddress = '0x726f757465725f69736d00000000000000000000000000050000000000000000';
|
|
318
|
+
const newIsm = {
|
|
319
|
+
type: 'messageIdMultisigIsm',
|
|
320
|
+
validators: ['0xe699ceCa237DD38e8f2Fa308D7d1a2BeCFC5493E'],
|
|
321
|
+
threshold: 1,
|
|
322
|
+
};
|
|
323
|
+
const expectedConfig = {
|
|
324
|
+
...actualConfig,
|
|
325
|
+
interchainSecurityModule: newIsm,
|
|
326
|
+
};
|
|
327
|
+
const createIsm = Sinon.stub(signer, 'createMessageIdMultisigIsm').resolves({
|
|
328
|
+
ismAddress: newIsmAddress,
|
|
329
|
+
});
|
|
330
|
+
const updateIsm = Sinon.stub(signer, 'getSetTokenIsmTransaction').resolves();
|
|
331
|
+
// ACT
|
|
332
|
+
const updateTransactions = await warpModule.update(expectedConfig);
|
|
333
|
+
// ASSERT
|
|
334
|
+
expect(updateTransactions).to.have.lengthOf(1);
|
|
335
|
+
expect(updateTransactions[0].annotation).to.include('Setting ISM for Warp Route to');
|
|
336
|
+
expect(createIsm.calledOnceWith({
|
|
337
|
+
validators: newIsm.validators,
|
|
338
|
+
threshold: newIsm.threshold,
|
|
339
|
+
})).to.be.true;
|
|
340
|
+
expect(updateIsm.calledOnceWith({
|
|
341
|
+
signer: actualConfig.owner,
|
|
342
|
+
tokenAddress,
|
|
343
|
+
ismAddress: newIsmAddress,
|
|
344
|
+
})).to.be.true;
|
|
345
|
+
});
|
|
346
|
+
it('update existing ISM', async () => {
|
|
347
|
+
// ARRANGE
|
|
348
|
+
const existingIsmAddress = '0x726f757465725f69736d00000000000000000000000000040000000000000000';
|
|
349
|
+
const existingIsm = {
|
|
350
|
+
type: 'messageIdMultisigIsm',
|
|
351
|
+
validators: ['0xe699ceCa237DD38e8f2Fa308D7d1a2BeCFC5493E'],
|
|
352
|
+
threshold: 1,
|
|
353
|
+
address: existingIsmAddress,
|
|
354
|
+
};
|
|
355
|
+
const newIsmAddress = '0x726f757465725f69736d00000000000000000000000000050000000000000000';
|
|
356
|
+
const newIsm = {
|
|
357
|
+
type: 'merkleRootMultisigIsm',
|
|
358
|
+
validators: ['0xe699ceCa237DD38e8f2Fa308D7d1a2BeCFC5493E'],
|
|
359
|
+
threshold: 1,
|
|
360
|
+
};
|
|
361
|
+
readStub.restore();
|
|
362
|
+
Sinon.stub(warpModule, 'read').resolves({
|
|
363
|
+
...actualConfig,
|
|
364
|
+
token: tokenAddress,
|
|
365
|
+
interchainSecurityModule: existingIsm,
|
|
366
|
+
});
|
|
367
|
+
const expectedConfig = {
|
|
368
|
+
...actualConfig,
|
|
369
|
+
interchainSecurityModule: newIsm,
|
|
370
|
+
};
|
|
371
|
+
// Stub ISM reading methods
|
|
372
|
+
Sinon.stub(signer, 'getIsmType').resolves('messageIdMultisigIsm');
|
|
373
|
+
Sinon.stub(signer, 'getMessageIdMultisigIsm').resolves({
|
|
374
|
+
address: existingIsmAddress,
|
|
375
|
+
validators: existingIsm.validators,
|
|
376
|
+
threshold: existingIsm.threshold,
|
|
377
|
+
});
|
|
378
|
+
const createIsm = Sinon.stub(signer, 'createMerkleRootMultisigIsm').resolves({
|
|
379
|
+
ismAddress: newIsmAddress,
|
|
380
|
+
});
|
|
381
|
+
const updateIsm = Sinon.stub(signer, 'getSetTokenIsmTransaction').resolves();
|
|
382
|
+
// ACT
|
|
383
|
+
const updateTransactions = await warpModule.update(expectedConfig);
|
|
384
|
+
// ASSERT
|
|
385
|
+
expect(updateTransactions).to.have.lengthOf(1);
|
|
386
|
+
expect(updateTransactions[0].annotation).to.include('Setting ISM for Warp Route to');
|
|
387
|
+
// Check createIsm was called once
|
|
388
|
+
expect(createIsm.callCount).to.equal(1);
|
|
389
|
+
const createIsmCall = createIsm.getCall(0);
|
|
390
|
+
expect(createIsmCall.args[0].threshold).to.equal(newIsm.threshold);
|
|
391
|
+
expect(createIsmCall.args[0].validators.length).to.equal(newIsm.validators.length);
|
|
392
|
+
expect(createIsmCall.args[0].validators[0].toLowerCase()).to.equal(newIsm.validators[0].toLowerCase());
|
|
393
|
+
// Check updateIsm was called once
|
|
394
|
+
expect(updateIsm.callCount).to.equal(1);
|
|
395
|
+
const updateIsmCall = updateIsm.getCall(0);
|
|
396
|
+
expect(updateIsmCall.args[0]).to.deep.equal({
|
|
397
|
+
signer: actualConfig.owner,
|
|
398
|
+
tokenAddress,
|
|
399
|
+
ismAddress: newIsmAddress,
|
|
400
|
+
});
|
|
401
|
+
});
|
|
402
|
+
});
|
|
403
|
+
//# sourceMappingURL=AltVMWarpModule.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AltVMWarpModule.test.js","sourceRoot":"","sources":["../src/AltVMWarpModule.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAS,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,EAEL,SAAS,GAEV,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,aAAa,GAAG;IACpB,KAAK,EAAE,OAAO;CACN,CAAC;AAEX,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AACzB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAE3B;;;;;;;;;;;;;;;;EAgBE;AAEF,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,IAAI,MAA6C,CAAC;IAClD,IAAI,UAA2B,CAAC;IAChC,IAAI,WAAwB,CAAC;IAE7B,MAAM,YAAY,GAChB,oEAAoE,CAAC;IAEvE,MAAM,YAAY,GAAe;QAC/B,IAAI,EAAE,SAAS,CAAC,UAAU;QAC1B,KAAK,EAAE,4CAA4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,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACxC,MAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC3C,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;YAC1C,MAAM,EAAE,YAAY,CAAC,KAAK;YAC1B,YAAY;YACZ,UAAU,EAAE,aAAa;SAC1B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AltVM } from '@hyperlane-xyz/provider-sdk';
|
|
2
|
+
import { ChainLookup } from '@hyperlane-xyz/provider-sdk/chain';
|
|
3
|
+
import { HypReader } from '@hyperlane-xyz/provider-sdk/module';
|
|
4
|
+
import { DerivedWarpConfig, DestinationGas, RemoteRouters, TokenRouterModuleType, TokenType } from '@hyperlane-xyz/provider-sdk/warp';
|
|
5
|
+
import { Address, rootLogger } from '@hyperlane-xyz/utils';
|
|
6
|
+
import { AltVMHookReader } from './AltVMHookReader.js';
|
|
7
|
+
import { AltVMIsmReader } from './AltVMIsmReader.js';
|
|
8
|
+
export declare class AltVMWarpRouteReader implements HypReader<TokenRouterModuleType> {
|
|
9
|
+
protected readonly provider: AltVM.IProvider;
|
|
10
|
+
protected readonly logger: ReturnType<typeof rootLogger.child>;
|
|
11
|
+
hookReader: AltVMHookReader;
|
|
12
|
+
ismReader: AltVMIsmReader;
|
|
13
|
+
constructor(chainLookup: ChainLookup, provider: AltVM.IProvider);
|
|
14
|
+
/**
|
|
15
|
+
* Reads the configuration for a Warp Route at the given address.
|
|
16
|
+
* Implements the HypReader interface.
|
|
17
|
+
*
|
|
18
|
+
* @param address - The address of the Warp Route contract.
|
|
19
|
+
* @returns The derived Warp Route configuration.
|
|
20
|
+
*/
|
|
21
|
+
read(address: string): Promise<DerivedWarpConfig>;
|
|
22
|
+
/**
|
|
23
|
+
* Derives the configuration for a Hyperlane ERC20 router contract at the given address.
|
|
24
|
+
*
|
|
25
|
+
* @param warpRouteAddress - The address of the Hyperlane ERC20 router contract.
|
|
26
|
+
* @returns The configuration for the Hyperlane ERC20 router.
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
deriveWarpRouteConfig(warpRouteAddress: Address): Promise<DerivedWarpConfig>;
|
|
30
|
+
/**
|
|
31
|
+
* Derives the token type for a given Warp Route address using specific methods
|
|
32
|
+
*
|
|
33
|
+
* @param warpRouteAddress - The Warp Route address to derive the token type for.
|
|
34
|
+
* @returns The derived TokenType, which can be either 'collateral' or 'synthetic'.
|
|
35
|
+
* @throws Error if the token type is not supported (i.e., not collateral or synthetic).
|
|
36
|
+
*/
|
|
37
|
+
deriveTokenType(warpRouteAddress: Address): Promise<TokenType>;
|
|
38
|
+
/**
|
|
39
|
+
* Fetches the base metadata for a Warp Route contract.
|
|
40
|
+
*
|
|
41
|
+
* @param routerAddress - The address of the Warp Route contract.
|
|
42
|
+
* @returns The base metadata for the Warp Route contract, including the mailbox, owner, hook, and ism.
|
|
43
|
+
*/
|
|
44
|
+
fetchMailboxClientConfig(routerAddress: Address): Promise<{
|
|
45
|
+
mailbox: string;
|
|
46
|
+
owner: string;
|
|
47
|
+
interchainSecurityModule?: any;
|
|
48
|
+
}>;
|
|
49
|
+
fetchRemoteRouters(warpRouteAddress: Address): Promise<RemoteRouters>;
|
|
50
|
+
fetchDestinationGas(warpRouteAddress: Address): Promise<DestinationGas>;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=AltVMWarpRouteReader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AltVMWarpRouteReader.d.ts","sourceRoot":"","sources":["../src/AltVMWarpRouteReader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,WAAW,EA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E,OAAO,GACxB,OAAO,CAAC,cAAc,CAAC;CAY3B"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { AltVM } from '@hyperlane-xyz/provider-sdk';
|
|
2
|
+
import { TokenType, } from '@hyperlane-xyz/provider-sdk/warp';
|
|
3
|
+
import { ensure0x, rootLogger } from '@hyperlane-xyz/utils';
|
|
4
|
+
import { AltVMHookReader } from './AltVMHookReader.js';
|
|
5
|
+
import { AltVMIsmReader } from './AltVMIsmReader.js';
|
|
6
|
+
export class AltVMWarpRouteReader {
|
|
7
|
+
provider;
|
|
8
|
+
logger;
|
|
9
|
+
hookReader;
|
|
10
|
+
ismReader;
|
|
11
|
+
constructor(chainLookup, provider) {
|
|
12
|
+
this.provider = provider;
|
|
13
|
+
this.hookReader = new AltVMHookReader(chainLookup.getChainMetadata, provider);
|
|
14
|
+
this.ismReader = new AltVMIsmReader(chainLookup.getChainName, provider);
|
|
15
|
+
this.logger = rootLogger.child({
|
|
16
|
+
module: AltVMWarpRouteReader.name,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Reads the configuration for a Warp Route at the given address.
|
|
21
|
+
* Implements the HypReader interface.
|
|
22
|
+
*
|
|
23
|
+
* @param address - The address of the Warp Route contract.
|
|
24
|
+
* @returns The derived Warp Route configuration.
|
|
25
|
+
*/
|
|
26
|
+
async read(address) {
|
|
27
|
+
return this.deriveWarpRouteConfig(address);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Derives the configuration for a Hyperlane ERC20 router contract at the given address.
|
|
31
|
+
*
|
|
32
|
+
* @param warpRouteAddress - The address of the Hyperlane ERC20 router contract.
|
|
33
|
+
* @returns The configuration for the Hyperlane ERC20 router.
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
async deriveWarpRouteConfig(warpRouteAddress) {
|
|
37
|
+
// Fetch token info once - this gives us type, metadata, owner, mailbox, ISM, etc.
|
|
38
|
+
const token = await this.provider.getToken({
|
|
39
|
+
tokenAddress: warpRouteAddress,
|
|
40
|
+
});
|
|
41
|
+
const remoteRouters = await this.fetchRemoteRouters(warpRouteAddress);
|
|
42
|
+
const destinationGas = await this.fetchDestinationGas(warpRouteAddress);
|
|
43
|
+
// Derive ISM config if present, otherwise use zero address
|
|
44
|
+
const interchainSecurityModule = token.ismAddress
|
|
45
|
+
? await this.ismReader.deriveIsmConfig(token.ismAddress)
|
|
46
|
+
: // TODO: replace with protocol-specific zero address
|
|
47
|
+
'0x0000000000000000000000000000000000000000';
|
|
48
|
+
// Hook address is not exposed by providers yet, use zero address as placeholder
|
|
49
|
+
// TODO: replace with protocol-specific zero address
|
|
50
|
+
const hook = '0x0000000000000000000000000000000000000000';
|
|
51
|
+
const baseConfig = {
|
|
52
|
+
owner: token.owner,
|
|
53
|
+
mailbox: token.mailboxAddress,
|
|
54
|
+
interchainSecurityModule,
|
|
55
|
+
hook,
|
|
56
|
+
remoteRouters,
|
|
57
|
+
destinationGas,
|
|
58
|
+
name: token.name ?? undefined,
|
|
59
|
+
symbol: token.symbol ?? undefined,
|
|
60
|
+
decimals: token.decimals ?? undefined,
|
|
61
|
+
};
|
|
62
|
+
// Return discriminated union based on type
|
|
63
|
+
switch (token.tokenType) {
|
|
64
|
+
case AltVM.TokenType.collateral: {
|
|
65
|
+
const collateralConfig = {
|
|
66
|
+
...baseConfig,
|
|
67
|
+
type: TokenType.collateral,
|
|
68
|
+
token: token.denom, // The underlying collateral denom
|
|
69
|
+
};
|
|
70
|
+
return collateralConfig;
|
|
71
|
+
}
|
|
72
|
+
case AltVM.TokenType.synthetic: {
|
|
73
|
+
const syntheticConfig = {
|
|
74
|
+
...baseConfig,
|
|
75
|
+
type: TokenType.synthetic,
|
|
76
|
+
};
|
|
77
|
+
return syntheticConfig;
|
|
78
|
+
}
|
|
79
|
+
default:
|
|
80
|
+
throw new Error(`Failed to determine token type for address ${warpRouteAddress}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Derives the token type for a given Warp Route address using specific methods
|
|
85
|
+
*
|
|
86
|
+
* @param warpRouteAddress - The Warp Route address to derive the token type for.
|
|
87
|
+
* @returns The derived TokenType, which can be either 'collateral' or 'synthetic'.
|
|
88
|
+
* @throws Error if the token type is not supported (i.e., not collateral or synthetic).
|
|
89
|
+
*/
|
|
90
|
+
async deriveTokenType(warpRouteAddress) {
|
|
91
|
+
const token = await this.provider.getToken({
|
|
92
|
+
tokenAddress: warpRouteAddress,
|
|
93
|
+
});
|
|
94
|
+
switch (token.tokenType) {
|
|
95
|
+
case AltVM.TokenType.collateral:
|
|
96
|
+
return TokenType.collateral;
|
|
97
|
+
case AltVM.TokenType.synthetic:
|
|
98
|
+
return TokenType.synthetic;
|
|
99
|
+
default:
|
|
100
|
+
throw new Error(`Failed to determine token type for address ${warpRouteAddress}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Fetches the base metadata for a Warp Route contract.
|
|
105
|
+
*
|
|
106
|
+
* @param routerAddress - The address of the Warp Route contract.
|
|
107
|
+
* @returns The base metadata for the Warp Route contract, including the mailbox, owner, hook, and ism.
|
|
108
|
+
*/
|
|
109
|
+
async fetchMailboxClientConfig(routerAddress) {
|
|
110
|
+
const token = await this.provider.getToken({
|
|
111
|
+
tokenAddress: routerAddress,
|
|
112
|
+
});
|
|
113
|
+
const config = {
|
|
114
|
+
mailbox: token.mailboxAddress,
|
|
115
|
+
owner: token.owner,
|
|
116
|
+
};
|
|
117
|
+
if (token.ismAddress) {
|
|
118
|
+
const derivedIsm = await this.ismReader.deriveIsmConfig(token.ismAddress);
|
|
119
|
+
config.interchainSecurityModule = derivedIsm;
|
|
120
|
+
}
|
|
121
|
+
return config;
|
|
122
|
+
}
|
|
123
|
+
async fetchRemoteRouters(warpRouteAddress) {
|
|
124
|
+
const { remoteRouters } = await this.provider.getRemoteRouters({
|
|
125
|
+
tokenAddress: warpRouteAddress,
|
|
126
|
+
});
|
|
127
|
+
const routers = {};
|
|
128
|
+
for (const router of remoteRouters) {
|
|
129
|
+
routers[router.receiverDomainId] = {
|
|
130
|
+
address: ensure0x(router.receiverAddress),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
return routers;
|
|
134
|
+
}
|
|
135
|
+
async fetchDestinationGas(warpRouteAddress) {
|
|
136
|
+
const { remoteRouters } = await this.provider.getRemoteRouters({
|
|
137
|
+
tokenAddress: warpRouteAddress,
|
|
138
|
+
});
|
|
139
|
+
return Object.fromEntries(remoteRouters.map((routerConfig) => [
|
|
140
|
+
routerConfig.receiverDomainId,
|
|
141
|
+
routerConfig.gas,
|
|
142
|
+
]));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=AltVMWarpRouteReader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AltVMWarpRouteReader.js","sourceRoot":"","sources":["../src/AltVMWarpRouteReader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAGpD,OAAO,EAOL,SAAS,GACV,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAW,QAAQ,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,OAAO,oBAAoB;IAOV;IANF,MAAM,CAAsC;IAC/D,UAAU,CAAkB;IAC5B,SAAS,CAAiB;IAE1B,YACE,WAAwB,EACL,QAAyB;QAAzB,aAAQ,GAAR,QAAQ,CAAiB;QAE5C,IAAI,CAAC,UAAU,GAAG,IAAI,eAAe,CACnC,WAAW,CAAC,gBAAgB,EAC5B,QAAQ,CACT,CAAC;QACF,IAAI,CAAC,SAAS,GAAG,IAAI,cAAc,CAAC,WAAW,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QAExE,IAAI,C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K;SACnB,CAAC;QAEF,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;YACrB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAC1E,MAAM,CAAC,wBAAwB,GAAG,UAAU,CAAC;QAC/C,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,gBAAyB;QAChD,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;YAC7D,YAAY,EAAE,gBAAgB;SAC/B,CAAC,CAAC;QAEH,MAAM,OAAO,GAAwC,EAAE,CAAC;QACxD,KAAK,MAAM,MAAM,IAAI,aAAa,EAAE,CAAC;YACnC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG;gBACjC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC;aAC1C,CAAC;QACJ,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,mBAAmB,CACvB,gBAAyB;QAEzB,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;YAC7D,YAAY,EAAE,gBAAgB;SAC/B,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,WAAW,CACvB,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC;YAClC,YAAY,CAAC,gBAAgB;YAC7B,YAAY,CAAC,GAAG;SACjB,CAAC,CACH,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ChainLookup } from '@hyperlane-xyz/provider-sdk/chain';
|
|
2
|
+
import { CoreModuleType } from '@hyperlane-xyz/provider-sdk/core';
|
|
3
|
+
import { ModuleProvider } from '@hyperlane-xyz/provider-sdk/module';
|
|
4
|
+
export declare function coreModuleProvider(chainLookup: ChainLookup, chainName: string): ModuleProvider<CoreModuleType>;
|
|
5
|
+
//# sourceMappingURL=core-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-module.d.ts","sourceRoot":"","sources":["../src/core-module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAc,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAKL,cAAc,EAEf,MAAM,oCAAoC,CAAC;AAmC5C,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,GAChB,cAAc,CAAC,cAAc,CAAC,CAEhC"}
|