@recoillink/deploy-sdk 0.0.0-stage → 11.0.1
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/LICENSE.md +193 -0
- package/dist/AltVMFileSubmitter.d.ts +12 -0
- package/dist/AltVMFileSubmitter.d.ts.map +1 -0
- package/dist/AltVMFileSubmitter.js +35 -0
- package/dist/AltVMFileSubmitter.js.map +1 -0
- package/dist/AltVMFileSubmitter.test.d.ts +2 -0
- package/dist/AltVMFileSubmitter.test.d.ts.map +1 -0
- package/dist/AltVMFileSubmitter.test.js +46 -0
- package/dist/AltVMFileSubmitter.test.js.map +1 -0
- package/dist/AltVMJsonRpcSubmitter.d.ts +2 -0
- package/dist/AltVMJsonRpcSubmitter.d.ts.map +1 -0
- package/dist/AltVMJsonRpcSubmitter.js +2 -0
- package/dist/AltVMJsonRpcSubmitter.js.map +1 -0
- package/dist/core/core-artifact-reader.d.ts +67 -0
- package/dist/core/core-artifact-reader.d.ts.map +1 -0
- package/dist/core/core-artifact-reader.js +118 -0
- package/dist/core/core-artifact-reader.js.map +1 -0
- package/dist/core/core-artifact-reader.test.d.ts +2 -0
- package/dist/core/core-artifact-reader.test.d.ts.map +1 -0
- package/dist/core/core-artifact-reader.test.js +310 -0
- package/dist/core/core-artifact-reader.test.js.map +1 -0
- package/dist/core/core-writer.d.ts +43 -0
- package/dist/core/core-writer.d.ts.map +1 -0
- package/dist/core/core-writer.js +238 -0
- package/dist/core/core-writer.js.map +1 -0
- package/dist/core/core-writer.test.d.ts +2 -0
- package/dist/core/core-writer.test.d.ts.map +1 -0
- package/dist/core/core-writer.test.js +1315 -0
- package/dist/core/core-writer.test.js.map +1 -0
- package/dist/fee/fee-reader.d.ts +25 -0
- package/dist/fee/fee-reader.d.ts.map +1 -0
- package/dist/fee/fee-reader.js +35 -0
- package/dist/fee/fee-reader.js.map +1 -0
- package/dist/fee/fee-writer.d.ts +31 -0
- package/dist/fee/fee-writer.d.ts.map +1 -0
- package/dist/fee/fee-writer.js +45 -0
- package/dist/fee/fee-writer.js.map +1 -0
- package/dist/hook/hook-reader.d.ts +41 -0
- package/dist/hook/hook-reader.d.ts.map +1 -0
- package/dist/hook/hook-reader.js +52 -0
- package/dist/hook/hook-reader.js.map +1 -0
- package/dist/hook/hook-writer.d.ts +101 -0
- package/dist/hook/hook-writer.d.ts.map +1 -0
- package/dist/hook/hook-writer.js +140 -0
- package/dist/hook/hook-writer.js.map +1 -0
- package/dist/hook/hook-writer.test.d.ts +2 -0
- package/dist/hook/hook-writer.test.d.ts.map +1 -0
- package/dist/hook/hook-writer.test.js +70 -0
- package/dist/hook/hook-writer.test.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/ism/generic-ism-context.test.d.ts +2 -0
- package/dist/ism/generic-ism-context.test.d.ts.map +1 -0
- package/dist/ism/generic-ism-context.test.js +112 -0
- package/dist/ism/generic-ism-context.test.js.map +1 -0
- package/dist/ism/generic-ism-writer.d.ts +62 -0
- package/dist/ism/generic-ism-writer.d.ts.map +1 -0
- package/dist/ism/generic-ism-writer.js +100 -0
- package/dist/ism/generic-ism-writer.js.map +1 -0
- package/dist/ism/generic-ism.d.ts +43 -0
- package/dist/ism/generic-ism.d.ts.map +1 -0
- package/dist/ism/generic-ism.js +105 -0
- package/dist/ism/generic-ism.js.map +1 -0
- package/dist/ism/generic-ism.test.d.ts +2 -0
- package/dist/ism/generic-ism.test.d.ts.map +1 -0
- package/dist/ism/generic-ism.test.js +145 -0
- package/dist/ism/generic-ism.test.js.map +1 -0
- package/dist/ism/routing-ism.d.ts +21 -0
- package/dist/ism/routing-ism.d.ts.map +1 -0
- package/dist/ism/routing-ism.js +149 -0
- package/dist/ism/routing-ism.js.map +1 -0
- package/dist/protocol.d.ts +3 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +38 -0
- package/dist/protocol.js.map +1 -0
- package/dist/protocol.test.d.ts +2 -0
- package/dist/protocol.test.d.ts.map +1 -0
- package/dist/protocol.test.js +14 -0
- package/dist/protocol.test.js.map +1 -0
- package/dist/utils/validation.d.ts +46 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +132 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/utils/validation.test.d.ts +2 -0
- package/dist/utils/validation.test.d.ts.map +1 -0
- package/dist/utils/validation.test.js +160 -0
- package/dist/utils/validation.test.js.map +1 -0
- package/dist/warp/warp-reader.d.ts +57 -0
- package/dist/warp/warp-reader.d.ts.map +1 -0
- package/dist/warp/warp-reader.js +135 -0
- package/dist/warp/warp-reader.js.map +1 -0
- package/dist/warp/warp-writer.d.ts +67 -0
- package/dist/warp/warp-writer.d.ts.map +1 -0
- package/dist/warp/warp-writer.js +381 -0
- package/dist/warp/warp-writer.js.map +1 -0
- package/dist/warp/warp-writer.test.d.ts +2 -0
- package/dist/warp/warp-writer.test.d.ts.map +1 -0
- package/dist/warp/warp-writer.test.js +1855 -0
- package/dist/warp/warp-writer.test.js.map +1 -0
- package/package.json +54 -3
- package/README.md +0 -3
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { ProtocolType } from '@recoillink/provider-sdk';
|
|
3
|
+
import { ArtifactState } from '@recoillink/provider-sdk/artifact';
|
|
4
|
+
import { ismArtifactToDerivedConfig, ismConfigToArtifact, } from '@recoillink/provider-sdk/ism';
|
|
5
|
+
import { assert } from '@recoillink/utils';
|
|
6
|
+
import { IsmReader } from './generic-ism.js';
|
|
7
|
+
const chainLookup = {
|
|
8
|
+
getChainMetadata: () => ({
|
|
9
|
+
name: 'ethereum',
|
|
10
|
+
chainId: 1,
|
|
11
|
+
domainId: 1,
|
|
12
|
+
protocol: ProtocolType.Ethereum,
|
|
13
|
+
}),
|
|
14
|
+
getChainName: (domain) => (domain === 1 ? 'ethereum' : null),
|
|
15
|
+
getDomainId: (chain) => (chain === 'ethereum' ? 1 : null),
|
|
16
|
+
getKnownChainNames: () => ['ethereum'],
|
|
17
|
+
getKnownDomainIds: () => new Set([1]),
|
|
18
|
+
};
|
|
19
|
+
const reference = (address) => ({
|
|
20
|
+
artifactState: ArtifactState.UNDERIVED,
|
|
21
|
+
deployed: { address },
|
|
22
|
+
});
|
|
23
|
+
function fixture() {
|
|
24
|
+
const artifacts = {
|
|
25
|
+
aggregation: {
|
|
26
|
+
artifactState: ArtifactState.DEPLOYED,
|
|
27
|
+
deployed: { address: 'aggregation' },
|
|
28
|
+
config: {
|
|
29
|
+
type: 'staticAggregationIsm',
|
|
30
|
+
threshold: 2,
|
|
31
|
+
modules: [reference('routing'), reference('pausable')],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
routing: {
|
|
35
|
+
artifactState: ArtifactState.DEPLOYED,
|
|
36
|
+
deployed: { address: 'routing' },
|
|
37
|
+
config: {
|
|
38
|
+
type: 'domainRoutingIsm',
|
|
39
|
+
owner: 'router-owner',
|
|
40
|
+
domains: { 1: reference('multisig') },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
multisig: {
|
|
44
|
+
artifactState: ArtifactState.DEPLOYED,
|
|
45
|
+
deployed: { address: 'multisig' },
|
|
46
|
+
config: {
|
|
47
|
+
type: 'messageIdMultisigIsm',
|
|
48
|
+
threshold: 2,
|
|
49
|
+
validators: ['validator1', 'validator2', 'validator3'],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
pausable: {
|
|
53
|
+
artifactState: ArtifactState.DEPLOYED,
|
|
54
|
+
deployed: { address: 'pausable' },
|
|
55
|
+
config: { type: 'pausableIsm', owner: 'pauser', paused: false },
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
const reads = [];
|
|
59
|
+
const manager = {
|
|
60
|
+
readIsm: async (address) => {
|
|
61
|
+
reads.push(address);
|
|
62
|
+
const artifact = artifacts[address];
|
|
63
|
+
assert(artifact, `Unsupported ISM ${address}`);
|
|
64
|
+
return artifact;
|
|
65
|
+
},
|
|
66
|
+
createReader: () => {
|
|
67
|
+
throw new Error('Unexpected typed reader');
|
|
68
|
+
},
|
|
69
|
+
createWriter: () => {
|
|
70
|
+
throw new Error('Unexpected writer');
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
return { artifacts, reads, reader: new IsmReader(manager, chainLookup) };
|
|
74
|
+
}
|
|
75
|
+
describe('IsmReader aggregation', () => {
|
|
76
|
+
it('expands the Starknet aggregation → routing → multisig and pausable tree', async () => {
|
|
77
|
+
const { reader, reads } = fixture();
|
|
78
|
+
expect(await reader.deriveIsmConfig('aggregation')).to.deep.equal({
|
|
79
|
+
type: 'staticAggregationIsm',
|
|
80
|
+
address: 'aggregation',
|
|
81
|
+
threshold: 2,
|
|
82
|
+
modules: [
|
|
83
|
+
{
|
|
84
|
+
type: 'domainRoutingIsm',
|
|
85
|
+
address: 'routing',
|
|
86
|
+
owner: 'router-owner',
|
|
87
|
+
domains: {
|
|
88
|
+
ethereum: {
|
|
89
|
+
type: 'messageIdMultisigIsm',
|
|
90
|
+
address: 'multisig',
|
|
91
|
+
threshold: 2,
|
|
92
|
+
validators: ['validator1', 'validator2', 'validator3'],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
type: 'pausableIsm',
|
|
98
|
+
address: 'pausable',
|
|
99
|
+
owner: 'pauser',
|
|
100
|
+
paused: false,
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
});
|
|
104
|
+
expect(reads).to.deep.equal([
|
|
105
|
+
'aggregation',
|
|
106
|
+
'routing',
|
|
107
|
+
'multisig',
|
|
108
|
+
'pausable',
|
|
109
|
+
]);
|
|
110
|
+
});
|
|
111
|
+
it('propagates unsupported children instead of partially reporting a tree', async () => {
|
|
112
|
+
const { reader, artifacts } = fixture();
|
|
113
|
+
delete artifacts['pausable'];
|
|
114
|
+
const result = await reader
|
|
115
|
+
.read('aggregation')
|
|
116
|
+
.catch((error) => error);
|
|
117
|
+
expect(String(result)).to.match(/Unsupported ISM pausable/);
|
|
118
|
+
});
|
|
119
|
+
it('converts nested aggregation config references without losing their addresses', () => {
|
|
120
|
+
const config = {
|
|
121
|
+
type: 'staticAggregationIsm',
|
|
122
|
+
threshold: 1,
|
|
123
|
+
modules: ['existing-module'],
|
|
124
|
+
};
|
|
125
|
+
const artifact = ismConfigToArtifact(config, chainLookup);
|
|
126
|
+
expect(ismArtifactToDerivedConfig({
|
|
127
|
+
...artifact,
|
|
128
|
+
artifactState: ArtifactState.DEPLOYED,
|
|
129
|
+
deployed: { address: 'root' },
|
|
130
|
+
}, chainLookup)).to.deep.equal({ ...config, address: 'root' });
|
|
131
|
+
});
|
|
132
|
+
it('rejects a NEW aggregation child when deriving deployed configuration', () => {
|
|
133
|
+
const artifact = ismConfigToArtifact({
|
|
134
|
+
type: 'staticAggregationIsm',
|
|
135
|
+
threshold: 1,
|
|
136
|
+
modules: [{ type: 'testIsm' }],
|
|
137
|
+
}, chainLookup);
|
|
138
|
+
expect(() => ismArtifactToDerivedConfig({
|
|
139
|
+
...artifact,
|
|
140
|
+
artifactState: ArtifactState.DEPLOYED,
|
|
141
|
+
deployed: { address: 'root' },
|
|
142
|
+
}, chainLookup)).to.throw(/nested ISM is NEW/);
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
//# sourceMappingURL=generic-ism.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generic-ism.test.js","sourceRoot":"","sources":["../../src/ism/generic-ism.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,OAAO,EAIL,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,MA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oillink/provider-sdk/altvm';
|
|
2
|
+
import { ArtifactDeployed, ArtifactNew, ArtifactWriter } from '@recoillink/provider-sdk/artifact';
|
|
3
|
+
import { ChainLookup } from '@recoillink/provider-sdk/chain';
|
|
4
|
+
import { DeployedIsmAddress, IRawIsmArtifactManager, RoutingIsmArtifactConfig } from '@recoillink/provider-sdk/ism';
|
|
5
|
+
import { AnnotatedTx, TxReceipt } from '@recoillink/provider-sdk/module';
|
|
6
|
+
import { Logger } from '@recoillink/utils';
|
|
7
|
+
type DeployedRoutingIsmArtifact = ArtifactDeployed<RoutingIsmArtifactConfig, DeployedIsmAddress>;
|
|
8
|
+
export declare class RoutingIsmWriter implements ArtifactWriter<RoutingIsmArtifactConfig, DeployedIsmAddress> {
|
|
9
|
+
protected readonly artifactManager: IRawIsmArtifactManager;
|
|
10
|
+
protected readonly chainLookup: ChainLookup;
|
|
11
|
+
private readonly signer;
|
|
12
|
+
protected readonly logger: Logger;
|
|
13
|
+
private readonly ismReader;
|
|
14
|
+
constructor(artifactManager: IRawIsmArtifactManager, chainLookup: ChainLookup, signer: ISigner<AnnotatedTx, TxReceipt>);
|
|
15
|
+
read(address: string): Promise<DeployedRoutingIsmArtifact>;
|
|
16
|
+
create(artifact: ArtifactNew<RoutingIsmArtifactConfig>): Promise<[DeployedRoutingIsmArtifact, TxReceipt[]]>;
|
|
17
|
+
update(artifact: DeployedRoutingIsmArtifact): Promise<AnnotatedTx[]>;
|
|
18
|
+
private deployDomainIsm;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=routing-ism.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routing-ism.d.ts","sourceRoot":"","sources":["../../src/ism/routing-ism.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAEL,gBAAgB,EAChB,WAAW,EAGX,cAAc,EAIf,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EACL,kBAAkB,EAElB,sBAAsB,EAGtB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,MAAM,EAAsB,MAAM,mBAAmB,CAAC;AAI/D,KAAK,0BAA0B,GAAG,gBAAgB,CAChD,wBAAwB,EACxB,kBAAkB,CACnB,CAAC;AAEF,qBAAa,gBAAiB,YAAW,cAAc,CACrD,wBAAwB,EACxB,kBAAkB,CACnB;IAQG,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,sBAAsB;IAC1D,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM;IATzB,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAE9B;IAEH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IAEtC,YACqB,eAAe,EAAE,sBAAsB,EACvC,WAAW,EAAE,WAAW,EAC1B,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,EAGzD;IAEK,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAQ/D;IAEK,MAAM,CACV,QAAQ,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAC9C,OAAO,CAAC,CAAC,0BAA0B,EAAE,SAAS,EAAE,CAAC,CAAC,CA6DpD;IAEK,MAAM,CAAC,QAAQ,EAAE,0BAA0B,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAuFzE;YAEa,eAAe;CAuB9B"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { AltVM } from '@recoillink/provider-sdk';
|
|
2
|
+
import { ArtifactState, isArtifactDeployed, isArtifactNew, isArtifactUnderived, } from '@recoillink/provider-sdk/artifact';
|
|
3
|
+
import { assert, rootLogger } from '@recoillink/utils';
|
|
4
|
+
import { IsmReader } from './generic-ism.js';
|
|
5
|
+
export class RoutingIsmWriter {
|
|
6
|
+
artifactManager;
|
|
7
|
+
chainLookup;
|
|
8
|
+
signer;
|
|
9
|
+
logger = rootLogger.child({
|
|
10
|
+
module: RoutingIsmWriter.name,
|
|
11
|
+
});
|
|
12
|
+
ismReader;
|
|
13
|
+
constructor(artifactManager, chainLookup, signer) {
|
|
14
|
+
this.artifactManager = artifactManager;
|
|
15
|
+
this.chainLookup = chainLookup;
|
|
16
|
+
this.signer = signer;
|
|
17
|
+
this.ismReader = new IsmReader(artifactManager, chainLookup);
|
|
18
|
+
}
|
|
19
|
+
async read(address) {
|
|
20
|
+
const artifact = await this.ismReader.read(address);
|
|
21
|
+
if (artifact.config.type !== AltVM.IsmType.ROUTING) {
|
|
22
|
+
throw new Error(`Expected ROUTING ISM at ${address}, got ${artifact.config.type}`);
|
|
23
|
+
}
|
|
24
|
+
return artifact;
|
|
25
|
+
}
|
|
26
|
+
async create(artifact) {
|
|
27
|
+
const { config } = artifact;
|
|
28
|
+
const allReceipts = [];
|
|
29
|
+
const deployedDomainIsms = {};
|
|
30
|
+
for (const [domainId, nestedArtifact] of Object.entries(config.domains)) {
|
|
31
|
+
const domain = parseInt(domainId);
|
|
32
|
+
if (isArtifactDeployed(nestedArtifact)) {
|
|
33
|
+
deployedDomainIsms[domain] = nestedArtifact;
|
|
34
|
+
}
|
|
35
|
+
else if (isArtifactUnderived(nestedArtifact)) {
|
|
36
|
+
// UNDERIVED means predeployed ISM - just pass through without reading
|
|
37
|
+
deployedDomainIsms[domain] = nestedArtifact;
|
|
38
|
+
}
|
|
39
|
+
else if (isArtifactNew(nestedArtifact)) {
|
|
40
|
+
const [deployedNested, receipts] = await this.deployDomainIsm(nestedArtifact);
|
|
41
|
+
deployedDomainIsms[domain] = deployedNested;
|
|
42
|
+
allReceipts.push(...receipts);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
// This should never happen - all artifact states are handled above
|
|
46
|
+
const _exhaustiveCheck = nestedArtifact;
|
|
47
|
+
this.logger.error(`Unexpected artifact state ${_exhaustiveCheck.artifactState} for domain ${domainId}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const rawRoutingIsmWriter = this.artifactManager.createWriter(AltVM.IsmType.ROUTING, this.signer);
|
|
51
|
+
const rawRoutingConfig = {
|
|
52
|
+
config: {
|
|
53
|
+
type: config.type,
|
|
54
|
+
owner: config.owner,
|
|
55
|
+
domains: deployedDomainIsms,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
const [deployedRoutingIsm, routingIsmReceipts] = await rawRoutingIsmWriter.create(rawRoutingConfig);
|
|
59
|
+
allReceipts.push(...routingIsmReceipts);
|
|
60
|
+
const deployedRoutingIsmConfig = {
|
|
61
|
+
artifactState: deployedRoutingIsm.artifactState,
|
|
62
|
+
config: {
|
|
63
|
+
type: deployedRoutingIsm.config.type,
|
|
64
|
+
owner: deployedRoutingIsm.config.owner,
|
|
65
|
+
domains: deployedDomainIsms,
|
|
66
|
+
},
|
|
67
|
+
deployed: deployedRoutingIsm.deployed,
|
|
68
|
+
};
|
|
69
|
+
return [deployedRoutingIsmConfig, allReceipts];
|
|
70
|
+
}
|
|
71
|
+
async update(artifact) {
|
|
72
|
+
const { config, deployed } = artifact;
|
|
73
|
+
const updateTxs = [];
|
|
74
|
+
const deployedDomains = {};
|
|
75
|
+
for (const [domainId, domainIsmConfig] of Object.entries(config.domains)) {
|
|
76
|
+
if (!this.chainLookup.getChainName(parseInt(domainId))) {
|
|
77
|
+
this.logger.warn(`Skipping update of unknown ${AltVM.IsmType.ROUTING} domain ${domainId}`);
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
const domain = parseInt(domainId);
|
|
81
|
+
if (isArtifactDeployed(domainIsmConfig)) {
|
|
82
|
+
const { artifactState, config, deployed } = domainIsmConfig;
|
|
83
|
+
assert(config.type !== AltVM.IsmType.AGGREGATION &&
|
|
84
|
+
config.type !== AltVM.IsmType.PAUSABLE, 'Aggregation and pausable ISM artifacts currently support reading only');
|
|
85
|
+
const domainIsmWriter = this.artifactManager.createWriter(domainIsmConfig.config.type, this.signer);
|
|
86
|
+
let domainIsmUpdateTxs;
|
|
87
|
+
if (config.type === AltVM.IsmType.ROUTING) {
|
|
88
|
+
domainIsmUpdateTxs = await this.update({
|
|
89
|
+
artifactState,
|
|
90
|
+
config,
|
|
91
|
+
deployed,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
domainIsmUpdateTxs = await domainIsmWriter.update({
|
|
96
|
+
artifactState,
|
|
97
|
+
config,
|
|
98
|
+
deployed,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
updateTxs.push(...domainIsmUpdateTxs);
|
|
102
|
+
deployedDomains[domain] = domainIsmConfig;
|
|
103
|
+
}
|
|
104
|
+
else if (isArtifactUnderived(domainIsmConfig)) {
|
|
105
|
+
// UNDERIVED means predeployed ISM - just pass through without reading
|
|
106
|
+
deployedDomains[domain] = domainIsmConfig;
|
|
107
|
+
// Note: We don't generate update transactions for UNDERIVED artifacts
|
|
108
|
+
// since they represent existing ISMs that we're just referencing
|
|
109
|
+
}
|
|
110
|
+
else if (isArtifactNew(domainIsmConfig)) {
|
|
111
|
+
[deployedDomains[domain]] = await this.deployDomainIsm(domainIsmConfig);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
// This should never happen - all artifact states are handled above
|
|
115
|
+
const _exhaustiveCheck = domainIsmConfig;
|
|
116
|
+
this.logger.error(`Unexpected artifact state ${_exhaustiveCheck.artifactState} for domain ${domainId}`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const rawRoutingWriter = this.artifactManager.createWriter(AltVM.IsmType.ROUTING, this.signer);
|
|
120
|
+
const rawRoutingArtifact = {
|
|
121
|
+
artifactState: ArtifactState.DEPLOYED,
|
|
122
|
+
config: {
|
|
123
|
+
type: config.type,
|
|
124
|
+
owner: config.owner,
|
|
125
|
+
domains: deployedDomains,
|
|
126
|
+
},
|
|
127
|
+
deployed: deployed,
|
|
128
|
+
};
|
|
129
|
+
const routingUpdateTxs = await rawRoutingWriter.update(rawRoutingArtifact);
|
|
130
|
+
return [...updateTxs, ...routingUpdateTxs];
|
|
131
|
+
}
|
|
132
|
+
async deployDomainIsm(artifact) {
|
|
133
|
+
const { config, artifactState } = artifact;
|
|
134
|
+
assert(config.type !== AltVM.IsmType.AGGREGATION &&
|
|
135
|
+
config.type !== AltVM.IsmType.PAUSABLE, 'Aggregation and pausable ISM artifacts currently support reading only');
|
|
136
|
+
if (config.type === AltVM.IsmType.ROUTING) {
|
|
137
|
+
return this.create({
|
|
138
|
+
config,
|
|
139
|
+
artifactState,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
const writer = this.artifactManager.createWriter(config.type, this.signer);
|
|
143
|
+
return writer.create({
|
|
144
|
+
config,
|
|
145
|
+
artifactState,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=routing-ism.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routing-ism.js","sourceRoot":"","sources":["../../src/ism/routing-ism.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,OAAO,EAKL,aAAa,EAEb,kBAAkB,EAClB,aAAa,EACb,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAW3C,OAAO,EAAU,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAO7C,MAAM,OAAO,gBAAgB;IAWN,eAAe;IACf,WAAW;IACb,MAAM;IATN,MAAM,GAAW,UAAU,CAAC,KAAK,CAAC;QACnD,MAAM,EAAE,gBAAgB,CAAC,IAAI;KAC9B,CAAC,CAAC;IAEc,SAAS,CA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C;QAExC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,QAAQ,CAAC;QAC3C,MAAM,CACJ,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,CAAC,WAAW;YACvC,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,CAAC,QAAQ,EACxC,uEAAuE,CACxE,CAAC;QACF,IAAI,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YAC1C,OAAO,IAAI,CAAC,MAAM,CAAC;gBACjB,MAAM;gBACN,aAAa;aACd,CAAC,CAAC;QACL,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAE3E,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,MAAM;YACN,aAAa;SACd,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,0BAA0B,CAAC;AAGlC,wBAAsB,qBAAqB,CACzC,eAAe,EAAE,GAAG,CAAC,YAAY,CAAC,iBAsCnC"}
|
package/dist/protocol.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ProtocolType, hasProtocol, registerProtocol, } from '@recoillink/provider-sdk';
|
|
2
|
+
import { rootLogger } from '@recoillink/utils';
|
|
3
|
+
export async function loadProtocolProviders(neededProtocols) {
|
|
4
|
+
for (const protocol of neededProtocols) {
|
|
5
|
+
if (hasProtocol(protocol)) {
|
|
6
|
+
rootLogger.debug(`${protocol} already loaded`);
|
|
7
|
+
continue;
|
|
8
|
+
}
|
|
9
|
+
switch (protocol) {
|
|
10
|
+
case ProtocolType.CosmosNative: {
|
|
11
|
+
const { CosmosNativeProtocolProvider } = await import('@recoillink/cosmos-sdk');
|
|
12
|
+
registerProtocol(protocol, () => new CosmosNativeProtocolProvider());
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
case ProtocolType.Radix: {
|
|
16
|
+
const { RadixProtocolProvider } = await import('@recoillink/radix-sdk');
|
|
17
|
+
registerProtocol(protocol, () => new RadixProtocolProvider());
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
case ProtocolType.Aleo: {
|
|
21
|
+
const { AleoProtocolProvider } = await import('@recoillink/aleo-sdk');
|
|
22
|
+
registerProtocol(protocol, () => new AleoProtocolProvider());
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
case ProtocolType.Sealevel: {
|
|
26
|
+
const { SealevelProtocolProvider } = await import('@recoillink/sealevel-sdk');
|
|
27
|
+
registerProtocol(protocol, () => new SealevelProtocolProvider());
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
case ProtocolType.Starknet: {
|
|
31
|
+
const { StarknetProtocolProvider } = await import('@recoillink/starknet-sdk/runtime');
|
|
32
|
+
registerProtocol(protocol, () => new StarknetProtocolProvider());
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,eAAkC;IAElC,KAAK,MAAM,QAAQ,IAAI,eAAe,EAAE,CAAC;QACvC,IAAI,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC1B,UAAU,CAAC,KAAK,CAAC,GAAG,QAAQ,iBAAiB,C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ACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.test.d.ts","sourceRoot":"","sources":["../src/protocol.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { ProtocolType, getProtocolProvider, hasProtocol, } from '@recoillink/provider-sdk';
|
|
3
|
+
import { loadProtocolProviders } from './protocol.js';
|
|
4
|
+
describe('loadProtocolProviders', () => {
|
|
5
|
+
it('registers Starknet provider implementation', async () => {
|
|
6
|
+
await loadProtocolProviders(new Set([ProtocolType.Starknet]));
|
|
7
|
+
expect(hasProtocol(ProtocolType.Starknet)).to.equal(true);
|
|
8
|
+
const provider = getProtocolProvider(ProtocolType.Starknet);
|
|
9
|
+
expect(provider).to.have.property('createProvider');
|
|
10
|
+
expect(provider).to.have.property('createSigner');
|
|
11
|
+
expect(provider).to.have.property('createIsmArtifactManager');
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=protocol.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.test.js","sourceRoot":"","sources":["../src/protocol.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,WAAW,GACZ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,4CAA4C,EAAE,KAAK,IAAI,EAAE;QAC1D,MAAM,qBAAqB,CAAC,IAAI,GAAG,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAE9D,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAE1D,MAAM,QAAQ,GAAG,mBAAmB,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC5D,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QACpD,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAClD,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,0BAA0B,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation utilities for Alt-VM ISM configurations.
|
|
3
|
+
*
|
|
4
|
+
* The provider-sdk has a limited subset of ISM types compared to the full SDK.
|
|
5
|
+
* These utilities validate ISM configs and provide clear error messages for unsupported types.
|
|
6
|
+
*/
|
|
7
|
+
import { ProtocolType } from '@recoillink/provider-sdk';
|
|
8
|
+
import { IsmConfig } from '@recoillink/provider-sdk/ism';
|
|
9
|
+
/**
|
|
10
|
+
* Validates that an ISM type is supported by provider-sdk for the given protocol.
|
|
11
|
+
*
|
|
12
|
+
* @param ismType - The ISM type string to validate
|
|
13
|
+
* @param chain - Chain name for error messages
|
|
14
|
+
* @param context - Context string for error messages (e.g., "warp route", "core")
|
|
15
|
+
* @param protocol - Protocol of the chain being validated. `protocol` is
|
|
16
|
+
* optional only so pre-existing callers (validating one of the
|
|
17
|
+
* always-cross-protocol types below) keep compiling — it does NOT loosen
|
|
18
|
+
* validation for a protocol-gated type like compositeIsm. At the point
|
|
19
|
+
* compositeIsm was introduced it was never accepted without a matching
|
|
20
|
+
* protocol, so omitting `protocol` for it still fails, just with a
|
|
21
|
+
* clearer "protocol required" reason instead of a generic type mismatch.
|
|
22
|
+
* @throws UnsupportedIsmTypeError if ISM type is not supported
|
|
23
|
+
*/
|
|
24
|
+
export declare function validateIsmType(ismType: string, chain: string, context?: string, protocol?: ProtocolType): void;
|
|
25
|
+
/**
|
|
26
|
+
* Validates that an ISM configuration is supported by provider-sdk for the given protocol.
|
|
27
|
+
*
|
|
28
|
+
* @param config - ISM configuration (can be string address or config object)
|
|
29
|
+
* @param chain - Chain name for error messages
|
|
30
|
+
* @param context - Context string for error messages (e.g., "warp route", "core")
|
|
31
|
+
* @param protocol - Protocol of the chain being validated. See validateIsmType.
|
|
32
|
+
* @throws UnsupportedIsmTypeError if ISM type is not supported
|
|
33
|
+
*/
|
|
34
|
+
export declare function validateIsmConfig(config: IsmConfig | string, chain: string, context?: string, protocol?: ProtocolType): void;
|
|
35
|
+
/**
|
|
36
|
+
* Custom error class for unsupported ISM types.
|
|
37
|
+
* Provides concise error messages.
|
|
38
|
+
*/
|
|
39
|
+
export declare class UnsupportedIsmTypeError extends Error {
|
|
40
|
+
readonly ismType: string;
|
|
41
|
+
readonly chain: string;
|
|
42
|
+
readonly context: string;
|
|
43
|
+
readonly supportedTypes: string;
|
|
44
|
+
constructor(ismType: string, chain: string, context: string, supportedTypes: string);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EACL,SAAS,EAGV,MAAM,8BAA8B,CAAC;AAuCtC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,MAAwB,EACjC,QAAQ,CAAC,EAAE,YAAY,GACtB,IAAI,CAmDN;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,GAAG,MAAM,EAC1B,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,MAAwB,EACjC,QAAQ,CAAC,EAAE,YAAY,GACtB,IAAI,CA8BN;AAED;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;aAE9B,OAAO,EAAE,MAAM;aACf,KAAK,EAAE,MAAM;aACb,OAAO,EAAE,MAAM;aACf,cAAc,EAAE,MAAM;IAJxC,YACkB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,EAOvC;CACF"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation utilities for Alt-VM ISM configurations.
|
|
3
|
+
*
|
|
4
|
+
* The provider-sdk has a limited subset of ISM types compared to the full SDK.
|
|
5
|
+
* These utilities validate ISM configs and provide clear error messages for unsupported types.
|
|
6
|
+
*/
|
|
7
|
+
import { ProtocolType } from '@recoillink/provider-sdk';
|
|
8
|
+
import { IsmType, assertValidDomainRoutingMultisig, } from '@recoillink/provider-sdk/ism';
|
|
9
|
+
/**
|
|
10
|
+
* ISM types supported by provider-sdk for Alt-VM chains.
|
|
11
|
+
* These correspond to the types defined in provider-sdk/src/ism.ts
|
|
12
|
+
*
|
|
13
|
+
* Typed as `ReadonlySet<string>` rather than `ReadonlySet<IsmType>`
|
|
14
|
+
* deliberately: `validateIsmType`'s `ismType` parameter is arbitrary,
|
|
15
|
+
* not-yet-validated input (a raw config field, possibly from an untrusted
|
|
16
|
+
* registry entry), so `.has()` is called with a plain `string`. Narrowing
|
|
17
|
+
* the set to `ReadonlySet<IsmType>` would just push an unsafe cast to
|
|
18
|
+
* every call site instead of removing it.
|
|
19
|
+
*/
|
|
20
|
+
const SUPPORTED_ISM_TYPES = new Set([
|
|
21
|
+
IsmType.ROUTING,
|
|
22
|
+
IsmType.MERKLE_ROOT_MULTISIG,
|
|
23
|
+
IsmType.MESSAGE_ID_MULTISIG,
|
|
24
|
+
IsmType.TEST_ISM,
|
|
25
|
+
IsmType.COMPOSITE,
|
|
26
|
+
IsmType.ROUTING_MESSAGE_ID_MULTISIG,
|
|
27
|
+
]);
|
|
28
|
+
/** ISM types restricted to a single Alt-VM protocol (Sealevel program, no cross-VM equivalent). */
|
|
29
|
+
const PROTOCOL_SPECIFIC_ISM_TYPES = {
|
|
30
|
+
[IsmType.COMPOSITE]: ProtocolType.Sealevel,
|
|
31
|
+
[IsmType.ROUTING_MESSAGE_ID_MULTISIG]: ProtocolType.Sealevel,
|
|
32
|
+
};
|
|
33
|
+
/** ISM types otherwise supported but rejected on a specific protocol, with the type to use instead. */
|
|
34
|
+
const PROTOCOL_UNSUPPORTED_ISM_TYPES = {
|
|
35
|
+
[ProtocolType.Sealevel]: {
|
|
36
|
+
[IsmType.MESSAGE_ID_MULTISIG]: IsmType.ROUTING_MESSAGE_ID_MULTISIG,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Validates that an ISM type is supported by provider-sdk for the given protocol.
|
|
41
|
+
*
|
|
42
|
+
* @param ismType - The ISM type string to validate
|
|
43
|
+
* @param chain - Chain name for error messages
|
|
44
|
+
* @param context - Context string for error messages (e.g., "warp route", "core")
|
|
45
|
+
* @param protocol - Protocol of the chain being validated. `protocol` is
|
|
46
|
+
* optional only so pre-existing callers (validating one of the
|
|
47
|
+
* always-cross-protocol types below) keep compiling — it does NOT loosen
|
|
48
|
+
* validation for a protocol-gated type like compositeIsm. At the point
|
|
49
|
+
* compositeIsm was introduced it was never accepted without a matching
|
|
50
|
+
* protocol, so omitting `protocol` for it still fails, just with a
|
|
51
|
+
* clearer "protocol required" reason instead of a generic type mismatch.
|
|
52
|
+
* @throws UnsupportedIsmTypeError if ISM type is not supported
|
|
53
|
+
*/
|
|
54
|
+
export function validateIsmType(ismType, chain, context = 'configuration', protocol) {
|
|
55
|
+
const requiredProtocol = PROTOCOL_SPECIFIC_ISM_TYPES[ismType];
|
|
56
|
+
const protocolUnsupported = protocol === undefined
|
|
57
|
+
? {}
|
|
58
|
+
: (PROTOCOL_UNSUPPORTED_ISM_TYPES[protocol] ?? {});
|
|
59
|
+
const supported = SUPPORTED_ISM_TYPES.has(ismType) &&
|
|
60
|
+
(requiredProtocol === undefined || requiredProtocol === protocol) &&
|
|
61
|
+
!Object.prototype.hasOwnProperty.call(protocolUnsupported, ismType);
|
|
62
|
+
if (!supported) {
|
|
63
|
+
const supportedTypes = Array.from(SUPPORTED_ISM_TYPES)
|
|
64
|
+
.filter((type) => {
|
|
65
|
+
const required = PROTOCOL_SPECIFIC_ISM_TYPES[type];
|
|
66
|
+
return ((required === undefined || required === protocol) &&
|
|
67
|
+
!Object.prototype.hasOwnProperty.call(protocolUnsupported, type));
|
|
68
|
+
})
|
|
69
|
+
.join(', ');
|
|
70
|
+
const replacement = Object.prototype.hasOwnProperty.call(protocolUnsupported, ismType)
|
|
71
|
+
? protocolUnsupported[ismType]
|
|
72
|
+
: undefined;
|
|
73
|
+
if (replacement !== undefined) {
|
|
74
|
+
throw new UnsupportedIsmTypeError(ismType, chain, context, `${supportedTypes} (${ismType} is unsupported on ${protocol}, use ${replacement} instead)`);
|
|
75
|
+
}
|
|
76
|
+
if (SUPPORTED_ISM_TYPES.has(ismType) &&
|
|
77
|
+
requiredProtocol !== undefined &&
|
|
78
|
+
protocol === undefined) {
|
|
79
|
+
throw new UnsupportedIsmTypeError(ismType, chain, context, `${supportedTypes} (ismType '${ismType}' requires the chain's protocol to be passed explicitly to validateIsmType/validateIsmConfig)`);
|
|
80
|
+
}
|
|
81
|
+
throw new UnsupportedIsmTypeError(ismType, chain, context, supportedTypes);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Validates that an ISM configuration is supported by provider-sdk for the given protocol.
|
|
86
|
+
*
|
|
87
|
+
* @param config - ISM configuration (can be string address or config object)
|
|
88
|
+
* @param chain - Chain name for error messages
|
|
89
|
+
* @param context - Context string for error messages (e.g., "warp route", "core")
|
|
90
|
+
* @param protocol - Protocol of the chain being validated. See validateIsmType.
|
|
91
|
+
* @throws UnsupportedIsmTypeError if ISM type is not supported
|
|
92
|
+
*/
|
|
93
|
+
export function validateIsmConfig(config, chain, context = 'configuration', protocol) {
|
|
94
|
+
// If it's a string address, it's valid (pre-deployed ISM)
|
|
95
|
+
if (typeof config === 'string') {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
// Validate the ISM type
|
|
99
|
+
validateIsmType(config.type, chain, context, protocol);
|
|
100
|
+
// Recursively validate nested ISMs in routing configs
|
|
101
|
+
if (config.type === IsmType.ROUTING) {
|
|
102
|
+
for (const [domain, domainConfig] of Object.entries(config.domains)) {
|
|
103
|
+
validateIsmConfig(domainConfig, chain, `${context} (domain routing for ${domain})`, protocol);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// Fail before any deployment transaction is sent.
|
|
107
|
+
if (config.type === IsmType.ROUTING_MESSAGE_ID_MULTISIG) {
|
|
108
|
+
for (const [domain, domainConfig] of Object.entries(config.domains)) {
|
|
109
|
+
assertValidDomainRoutingMultisig(domainConfig, `${IsmType.ROUTING_MESSAGE_ID_MULTISIG} domain '${domain}' on ${chain} in ${context}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Custom error class for unsupported ISM types.
|
|
115
|
+
* Provides concise error messages.
|
|
116
|
+
*/
|
|
117
|
+
export class UnsupportedIsmTypeError extends Error {
|
|
118
|
+
ismType;
|
|
119
|
+
chain;
|
|
120
|
+
context;
|
|
121
|
+
supportedTypes;
|
|
122
|
+
constructor(ismType, chain, context, supportedTypes) {
|
|
123
|
+
super(`Unsupported ISM type '${ismType}' for Alt-VM chain '${chain}' in ${context}. ` +
|
|
124
|
+
`Supported types: ${supportedTypes}`);
|
|
125
|
+
this.ismType = ismType;
|
|
126
|
+
this.chain = chain;
|
|
127
|
+
this.context = context;
|
|
128
|
+
this.supportedTypes = supportedTypes;
|
|
129
|
+
this.name = 'UnsupportedIsmTypeError';
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAEL,OAAO,EACP,gCAAgC,GACjC,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAAU;IAChE,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,oBAAoB;IAC5B,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,2BAA2B;CACpC,CAAC,CAAC;AAEH,mGAAmG;AACnG,MAAM,2BAA2B,GAE7B;IACF,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC,QAAQ;IAC1C,CAAC,OAAO,CAAC,2BAA2B,CAAC,EAAE,YAAY,CAAC,QAAQ;CAC7D,CAAC;AAEF,uGAAuG;AACvG,MAAM,8BAA8B,GAEhC;IACF,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE;QACvB,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC,2BAA2B;KACnE;CACF,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAe,EACf,KAAa,EACb,OAAO,GAAW,eAAe,EACjC,QAAuB;IAEvB,MAAM,gBAAgB,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAC9D,MAAM,mBAAmB,GACvB,QAAQ,KAAK,SAAS;QACpB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,CAAC,8BAA8B,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACv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