Skip to content

Commit dd4928b

Browse files
authored
chore: altvm warp module routes (#7188)
1 parent 6c97a30 commit dd4928b

5 files changed

Lines changed: 1099 additions & 147 deletions

File tree

.changeset/nice-ligers-buy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperlane-xyz/sdk": patch
3+
---
4+
5+
chore: refactor altvm warp module and add tests
Lines changed: 265 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,265 @@
1+
import { AltVM } from '@hyperlane-xyz/utils';
2+
3+
type MockTransaction = any;
4+
5+
export class MockProvider implements AltVM.IProvider {
6+
static async connect(): Promise<MockProvider> {
7+
return new MockProvider();
8+
}
9+
10+
// ### QUERY BASE ###
11+
12+
async isHealthy(): Promise<boolean> {
13+
throw new Error(`not implemented`);
14+
}
15+
16+
getRpcUrls(): string[] {
17+
throw new Error(`not implemented`);
18+
}
19+
20+
async getHeight(): Promise<number> {
21+
throw new Error(`not implemented`);
22+
}
23+
24+
async getBalance(_req: AltVM.ReqGetBalance): Promise<bigint> {
25+
throw new Error(`not implemented`);
26+
}
27+
28+
async getTotalSupply(_req: AltVM.ReqGetTotalSupply): Promise<bigint> {
29+
throw new Error(`not implemented`);
30+
}
31+
32+
async estimateTransactionFee(
33+
_req: AltVM.ReqEstimateTransactionFee<MockTransaction>,
34+
): Promise<AltVM.ResEstimateTransactionFee> {
35+
throw new Error(`not implemented`);
36+
}
37+
38+
// ### QUERY CORE ###
39+
40+
async getMailbox(_req: AltVM.ReqGetMailbox): Promise<AltVM.ResGetMailbox> {
41+
throw new Error(`not implemented`);
42+
}
43+
44+
async isMessageDelivered(
45+
_req: AltVM.ReqIsMessageDelivered,
46+
): Promise<boolean> {
47+
throw new Error(`not implemented`);
48+
}
49+
50+
async getIsmType(_req: AltVM.ReqGetIsmType): Promise<AltVM.IsmType> {
51+
throw new Error(`not implemented`);
52+
}
53+
54+
async getMessageIdMultisigIsm(
55+
_req: AltVM.ReqMessageIdMultisigIsm,
56+
): Promise<AltVM.ResMessageIdMultisigIsm> {
57+
throw new Error(`not implemented`);
58+
}
59+
60+
async getMerkleRootMultisigIsm(
61+
_req: AltVM.ReqMerkleRootMultisigIsm,
62+
): Promise<AltVM.ResMerkleRootMultisigIsm> {
63+
throw new Error(`not implemented`);
64+
}
65+
66+
async getRoutingIsm(_req: AltVM.ReqRoutingIsm): Promise<AltVM.ResRoutingIsm> {
67+
throw new Error(`not implemented`);
68+
}
69+
70+
async getNoopIsm(_req: AltVM.ReqNoopIsm): Promise<AltVM.ResNoopIsm> {
71+
throw new Error(`not implemented`);
72+
}
73+
74+
async getHookType(_req: AltVM.ReqGetHookType): Promise<AltVM.HookType> {
75+
throw new Error(`not implemented`);
76+
}
77+
78+
async getInterchainGasPaymasterHook(
79+
_req: AltVM.ReqGetInterchainGasPaymasterHook,
80+
): Promise<AltVM.ResGetInterchainGasPaymasterHook> {
81+
throw new Error(`not implemented`);
82+
}
83+
84+
async getMerkleTreeHook(
85+
_req: AltVM.ReqGetMerkleTreeHook,
86+
): Promise<AltVM.ResGetMerkleTreeHook> {
87+
throw new Error(`not implemented`);
88+
}
89+
90+
// ### QUERY WARP ###
91+
92+
async getToken(_req: AltVM.ReqGetToken): Promise<AltVM.ResGetToken> {
93+
throw new Error(`not implemented`);
94+
}
95+
96+
async getRemoteRouters(
97+
_req: AltVM.ReqGetRemoteRouters,
98+
): Promise<AltVM.ResGetRemoteRouters> {
99+
throw new Error(`not implemented`);
100+
}
101+
102+
async getBridgedSupply(_req: AltVM.ReqGetBridgedSupply): Promise<bigint> {
103+
throw new Error(`not implemented`);
104+
}
105+
106+
async quoteRemoteTransfer(
107+
_req: AltVM.ReqQuoteRemoteTransfer,
108+
): Promise<AltVM.ResQuoteRemoteTransfer> {
109+
throw new Error(`not implemented`);
110+
}
111+
112+
// ### GET CORE TXS ###
113+
114+
async getCreateMailboxTransaction(
115+
_req: AltVM.ReqCreateMailbox,
116+
): Promise<MockTransaction> {
117+
throw new Error(`not implemented`);
118+
}
119+
120+
async getSetDefaultIsmTransaction(
121+
_req: AltVM.ReqSetDefaultIsm,
122+
): Promise<MockTransaction> {
123+
throw new Error(`not implemented`);
124+
}
125+
126+
async getSetDefaultHookTransaction(
127+
_req: AltVM.ReqSetDefaultHook,
128+
): Promise<MockTransaction> {
129+
throw new Error(`not implemented`);
130+
}
131+
132+
async getSetRequiredHookTransaction(
133+
_req: AltVM.ReqSetRequiredHook,
134+
): Promise<MockTransaction> {
135+
throw new Error(`not implemented`);
136+
}
137+
138+
async getSetMailboxOwnerTransaction(
139+
_req: AltVM.ReqSetMailboxOwner,
140+
): Promise<MockTransaction> {
141+
throw new Error(`not implemented`);
142+
}
143+
144+
async getCreateMerkleRootMultisigIsmTransaction(
145+
_req: AltVM.ReqCreateMerkleRootMultisigIsm,
146+
): Promise<MockTransaction> {
147+
throw new Error(`not implemented`);
148+
}
149+
150+
async getCreateMessageIdMultisigIsmTransaction(
151+
_req: AltVM.ReqCreateMessageIdMultisigIsm,
152+
): Promise<MockTransaction> {
153+
throw new Error(`not implemented`);
154+
}
155+
156+
async getCreateRoutingIsmTransaction(
157+
_req: AltVM.ReqCreateRoutingIsm,
158+
): Promise<MockTransaction> {
159+
throw new Error(`not implemented`);
160+
}
161+
162+
async getSetRoutingIsmRouteTransaction(
163+
_req: AltVM.ReqSetRoutingIsmRoute,
164+
): Promise<MockTransaction> {
165+
throw new Error(`not implemented`);
166+
}
167+
168+
async getRemoveRoutingIsmRouteTransaction(
169+
_req: AltVM.ReqRemoveRoutingIsmRoute,
170+
): Promise<MockTransaction> {
171+
throw new Error(`not implemented`);
172+
}
173+
174+
async getSetRoutingIsmOwnerTransaction(
175+
_req: AltVM.ReqSetRoutingIsmOwner,
176+
): Promise<MockTransaction> {
177+
throw new Error(`not implemented`);
178+
}
179+
180+
async getCreateNoopIsmTransaction(
181+
_req: AltVM.ReqCreateNoopIsm,
182+
): Promise<MockTransaction> {
183+
throw new Error(`not implemented`);
184+
}
185+
186+
async getCreateMerkleTreeHookTransaction(
187+
_req: AltVM.ReqCreateMerkleTreeHook,
188+
): Promise<MockTransaction> {
189+
throw new Error(`not implemented`);
190+
}
191+
192+
async getCreateInterchainGasPaymasterHookTransaction(
193+
_req: AltVM.ReqCreateInterchainGasPaymasterHook,
194+
): Promise<MockTransaction> {
195+
throw new Error(`not implemented`);
196+
}
197+
198+
async getSetInterchainGasPaymasterHookOwnerTransaction(
199+
_req: AltVM.ReqSetInterchainGasPaymasterHookOwner,
200+
): Promise<MockTransaction> {
201+
throw new Error(`not implemented`);
202+
}
203+
204+
async getSetDestinationGasConfigTransaction(
205+
_req: AltVM.ReqSetDestinationGasConfig,
206+
): Promise<MockTransaction> {
207+
throw new Error(`not implemented`);
208+
}
209+
210+
async getCreateValidatorAnnounceTransaction(
211+
_req: AltVM.ReqCreateValidatorAnnounce,
212+
): Promise<MockTransaction> {
213+
throw new Error(`not implemented`);
214+
}
215+
216+
// ### GET WARP TXS ###
217+
218+
async getCreateCollateralTokenTransaction(
219+
_req: AltVM.ReqCreateCollateralToken,
220+
): Promise<MockTransaction> {
221+
throw new Error(`not implemented`);
222+
}
223+
224+
async getCreateSyntheticTokenTransaction(
225+
_req: AltVM.ReqCreateSyntheticToken,
226+
): Promise<MockTransaction> {
227+
throw new Error(`not implemented`);
228+
}
229+
230+
async getSetTokenOwnerTransaction(
231+
_req: AltVM.ReqSetTokenOwner,
232+
): Promise<MockTransaction> {
233+
throw new Error(`not implemented`);
234+
}
235+
236+
async getSetTokenIsmTransaction(
237+
_req: AltVM.ReqSetTokenIsm,
238+
): Promise<MockTransaction> {
239+
throw new Error(`not implemented`);
240+
}
241+
242+
async getEnrollRemoteRouterTransaction(
243+
_req: AltVM.ReqEnrollRemoteRouter,
244+
): Promise<MockTransaction> {
245+
throw new Error(`not implemented`);
246+
}
247+
248+
async getUnenrollRemoteRouterTransaction(
249+
_req: AltVM.ReqUnenrollRemoteRouter,
250+
): Promise<MockTransaction> {
251+
throw new Error(`not implemented`);
252+
}
253+
254+
async getTransferTransaction(
255+
_req: AltVM.ReqTransfer,
256+
): Promise<MockTransaction> {
257+
throw new Error(`not implemented`);
258+
}
259+
260+
async getRemoteTransferTransaction(
261+
_req: AltVM.ReqRemoteTransfer,
262+
): Promise<MockTransaction> {
263+
throw new Error(`not implemented`);
264+
}
265+
}

0 commit comments

Comments
 (0)