wasm-ast-types 0.23.0 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- package/main/context/context.js +49 -5
- package/main/context/imports.js +42 -7
- package/main/index.js +13 -0
- package/main/provider/index.js +18 -0
- package/main/provider/provider.js +98 -0
- package/main/provider/provider.spec.js +63 -0
- package/main/utils/constants.js +9 -2
- package/main/utils/index.js +8 -1
- package/module/context/context.js +38 -4
- package/module/context/imports.js +35 -5
- package/module/index.js +2 -1
- package/module/provider/index.js +1 -0
- package/module/provider/provider.js +53 -0
- package/module/provider/provider.spec.js +58 -0
- package/module/utils/constants.js +7 -1
- package/module/utils/index.js +2 -1
- package/package.json +2 -2
- package/src/context/context.ts +59 -4
- package/src/context/imports.ts +84 -49
- package/src/index.ts +1 -0
- package/src/provider/__snapshots__/provider.spec.ts.snap +49 -0
- package/src/provider/index.ts +1 -0
- package/src/provider/provider.spec.ts +81 -0
- package/src/provider/provider.ts +237 -0
- package/src/react-query/react-query.ts +3 -3
- package/src/utils/constants.ts +7 -0
- package/src/utils/index.ts +1 -0
- package/types/client/client.d.ts +1 -3
- package/types/context/context.d.ts +34 -4
- package/types/context/imports.d.ts +3 -1
- package/types/index.d.ts +1 -0
- package/types/msg-builder/msg-builder.d.ts +3 -3
- package/types/provider/index.d.ts +1 -0
- package/types/provider/provider.d.ts +18 -0
- package/types/utils/babel.d.ts +1 -6
- package/types/utils/constants.d.ts +11 -0
- package/types/utils/index.d.ts +3 -0
- package/types/utils/types.d.ts +2 -7
@@ -0,0 +1,58 @@
|
|
1
|
+
import { createGettingProviders, createIContractsContext, createProvider } from "./provider";
|
2
|
+
import { expectCode } from "../../test-utils";
|
3
|
+
import { PROVIDER_TYPES } from "../utils/constants";
|
4
|
+
it("execute class", () => {
|
5
|
+
let info = {};
|
6
|
+
info[PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = {
|
7
|
+
classname: "WhitelistClient"
|
8
|
+
};
|
9
|
+
info[PROVIDER_TYPES.QUERY_CLIENT_TYPE] = {
|
10
|
+
classname: "WhitelistQueryClient"
|
11
|
+
};
|
12
|
+
info[PROVIDER_TYPES.MESSAGE_COMPOSER_TYPE] = {
|
13
|
+
classname: "WhitelistMessageComposer"
|
14
|
+
};
|
15
|
+
expectCode(createProvider("Whitelist", info));
|
16
|
+
});
|
17
|
+
it("execute class without message composer", () => {
|
18
|
+
let info = {};
|
19
|
+
info[PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = {
|
20
|
+
classname: "WhitelistClient"
|
21
|
+
};
|
22
|
+
info[PROVIDER_TYPES.QUERY_CLIENT_TYPE] = {
|
23
|
+
classname: "WhitelistQueryClient"
|
24
|
+
};
|
25
|
+
expectCode(createProvider("Whitelist", info));
|
26
|
+
});
|
27
|
+
it("create IContractsContext", () => {
|
28
|
+
let info = {
|
29
|
+
Whitelist: {},
|
30
|
+
Marketplace: {}
|
31
|
+
};
|
32
|
+
info["Whitelist"][PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = {
|
33
|
+
classname: "WhitelistClient"
|
34
|
+
};
|
35
|
+
info["Whitelist"][PROVIDER_TYPES.QUERY_CLIENT_TYPE] = {
|
36
|
+
classname: "WhitelistQueryClient"
|
37
|
+
};
|
38
|
+
info["Marketplace"][PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = {
|
39
|
+
classname: "MarketplaceClient"
|
40
|
+
};
|
41
|
+
expectCode(createIContractsContext(info));
|
42
|
+
});
|
43
|
+
it("create getProviders", () => {
|
44
|
+
let info = {
|
45
|
+
Whitelist: {},
|
46
|
+
Marketplace: {}
|
47
|
+
};
|
48
|
+
info["Whitelist"][PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = {
|
49
|
+
classname: "WhitelistClient"
|
50
|
+
};
|
51
|
+
info["Whitelist"][PROVIDER_TYPES.QUERY_CLIENT_TYPE] = {
|
52
|
+
classname: "WhitelistQueryClient"
|
53
|
+
};
|
54
|
+
info["Marketplace"][PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = {
|
55
|
+
classname: "MarketplaceClient"
|
56
|
+
};
|
57
|
+
expectCode(createGettingProviders(info));
|
58
|
+
});
|
@@ -3,4 +3,10 @@ import * as t from '@babel/types';
|
|
3
3
|
export const OPTIONAL_FUNDS_PARAM = identifier('_funds', t.tsTypeAnnotation(t.tsArrayType(t.tsTypeReference(t.identifier('Coin')))), true);
|
4
4
|
export const OPTIONAL_FEE_PARAM = identifier('fee', t.tsTypeAnnotation(t.tsUnionType([t.tsNumberKeyword(), t.tsTypeReference(t.identifier('StdFee')), t.tsLiteralType(t.stringLiteral('auto'))])), true);
|
5
5
|
export const OPTIONAL_MEMO_PARAM = identifier('memo', t.tsTypeAnnotation(t.tsStringKeyword()), true);
|
6
|
-
export const FIXED_EXECUTE_PARAMS = [OPTIONAL_FEE_PARAM, OPTIONAL_MEMO_PARAM, OPTIONAL_FUNDS_PARAM];
|
6
|
+
export const FIXED_EXECUTE_PARAMS = [OPTIONAL_FEE_PARAM, OPTIONAL_MEMO_PARAM, OPTIONAL_FUNDS_PARAM];
|
7
|
+
export const PROVIDER_TYPES = {
|
8
|
+
SIGNING_CLIENT_TYPE: "client",
|
9
|
+
QUERY_CLIENT_TYPE: "queryClient",
|
10
|
+
MESSAGE_COMPOSER_TYPE: 'message-composer',
|
11
|
+
PROVIDER_TYPE: 'provider'
|
12
|
+
};
|
package/module/utils/index.js
CHANGED
@@ -2,4 +2,5 @@ export * from './babel';
|
|
2
2
|
export * from './types';
|
3
3
|
export * from './ref';
|
4
4
|
export { OPTIONAL_FUNDS_PARAM } from './constants';
|
5
|
-
export { FIXED_EXECUTE_PARAMS } from './constants';
|
5
|
+
export { FIXED_EXECUTE_PARAMS } from './constants';
|
6
|
+
export { PROVIDER_TYPES } from './constants';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wasm-ast-types",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.24.0",
|
4
4
|
"description": "CosmWasm TypeScript AST generation",
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
6
6
|
"homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme",
|
@@ -88,5 +88,5 @@
|
|
88
88
|
"case": "1.6.3",
|
89
89
|
"deepmerge": "4.2.2"
|
90
90
|
},
|
91
|
-
"gitHead": "
|
91
|
+
"gitHead": "4553eb80cd89969583df6164d1c764ab5b289c63"
|
92
92
|
}
|
package/src/context/context.ts
CHANGED
@@ -2,6 +2,7 @@ import { JSONSchema } from "../types";
|
|
2
2
|
import { refLookup } from "../utils";
|
3
3
|
import { convertUtilsToImportList, getImportStatements, UtilMapping } from "./imports";
|
4
4
|
import deepmerge from "deepmerge";
|
5
|
+
import { basename, extname } from 'path'
|
5
6
|
|
6
7
|
/// Plugin Types
|
7
8
|
export interface ReactQueryOptions {
|
@@ -67,16 +68,28 @@ export interface RenderOptions {
|
|
67
68
|
reactQuery?: ReactQueryOptions;
|
68
69
|
}
|
69
70
|
|
71
|
+
export interface ProviderInfo{
|
72
|
+
classname: string,
|
73
|
+
filename: string,
|
74
|
+
basename: string,
|
75
|
+
}
|
70
76
|
|
71
77
|
export interface IContext {
|
72
78
|
refLookup($ref: string);
|
73
79
|
addUtil(util: string);
|
74
|
-
getImports(registeredUtils?: UtilMapping);
|
80
|
+
getImports(registeredUtils?: UtilMapping, filepath?: string);
|
75
81
|
}
|
76
82
|
|
77
83
|
export interface IRenderContext<TOpt = RenderOptions> extends IContext {
|
78
84
|
contract: ContractInfo;
|
79
85
|
options: TOpt;
|
86
|
+
|
87
|
+
addProviderInfo(contractName:string, type: string, classname: string, filename: string): void;
|
88
|
+
getProviderInfos(): {
|
89
|
+
[key: string]: {
|
90
|
+
[key: string]: ProviderInfo;
|
91
|
+
};
|
92
|
+
};
|
80
93
|
}
|
81
94
|
|
82
95
|
export const defaultOptions: RenderOptions = {
|
@@ -127,23 +140,54 @@ export const getDefinitionSchema = (schemas: JSONSchema[]): JSONSchema => {
|
|
127
140
|
return aggregateSchema;
|
128
141
|
};
|
129
142
|
|
143
|
+
export class BuilderContext{
|
144
|
+
providers:{
|
145
|
+
[key: string]: {
|
146
|
+
[key: string]: ProviderInfo;
|
147
|
+
};
|
148
|
+
} = {};
|
149
|
+
|
150
|
+
addProviderInfo(contractName:string, type: string, classname: string, filename: string): void {
|
151
|
+
if(!this.providers[contractName]){
|
152
|
+
this.providers[contractName] = {}
|
153
|
+
}
|
154
|
+
|
155
|
+
this.providers[contractName][type] = {
|
156
|
+
classname,
|
157
|
+
filename,
|
158
|
+
basename: basename(filename, extname(filename))
|
159
|
+
};
|
160
|
+
}
|
161
|
+
getProviderInfos(): {
|
162
|
+
[key: string]: {
|
163
|
+
[key: string]: ProviderInfo;
|
164
|
+
};
|
165
|
+
}{
|
166
|
+
return this.providers;
|
167
|
+
}
|
168
|
+
}
|
169
|
+
|
130
170
|
/**
|
131
171
|
* context object for generating code.
|
132
172
|
* only mergeDefaultOpt needs to implementing for combine options and default options.
|
133
173
|
* @param TOpt option type
|
134
174
|
*/
|
135
175
|
export abstract class RenderContextBase<TOpt = RenderOptions> implements IRenderContext<TOpt> {
|
176
|
+
builderContext: BuilderContext;
|
136
177
|
contract: ContractInfo;
|
137
178
|
utils: string[] = [];
|
138
179
|
schema: JSONSchema;
|
139
180
|
options: TOpt;
|
181
|
+
|
140
182
|
constructor(
|
141
183
|
contract: ContractInfo,
|
142
|
-
options?: TOpt
|
184
|
+
options?: TOpt,
|
185
|
+
builderContext?: BuilderContext
|
143
186
|
) {
|
144
187
|
this.contract = contract;
|
145
188
|
this.schema = getDefinitionSchema(contract.schemas);
|
146
189
|
this.options = this.mergeDefaultOpt(options);
|
190
|
+
this.builderContext = builderContext;
|
147
191
|
}
|
148
192
|
/**
|
149
193
|
* merge options and default options
|
@@ -156,13 +200,24 @@ export abstract class RenderContextBase<TOpt = RenderOptions> implements IRender
|
|
156
200
|
addUtil(util: string) {
|
157
201
|
this.utils[util] = true;
|
158
202
|
}
|
159
|
-
|
203
|
+
addProviderInfo(contractName:string, type: string, classname: string, filename: string): void {
|
204
|
+
this.builderContext.addProviderInfo(contractName, type, classname, filename);
|
205
|
+
}
|
206
|
+
getProviderInfos(): {
|
207
|
+
[key: string]: {
|
208
|
+
[key: string]: ProviderInfo;
|
209
|
+
};
|
210
|
+
} {
|
211
|
+
return this.builderContext.providers;
|
212
|
+
}
|
213
|
+
getImports(registeredUtils?: UtilMapping, filepath?: string) {
|
160
214
|
return getImportStatements(
|
161
215
|
convertUtilsToImportList(
|
162
216
|
this,
|
163
217
|
Object.keys(this.utils),
|
164
218
|
registeredUtils,
|
165
|
-
)
|
219
|
+
),
|
220
|
+
filepath
|
166
221
|
);
|
167
222
|
}
|
168
223
|
}
|
package/src/context/imports.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import * as t from '@babel/types';
|
2
2
|
import { importAs, importStmt } from "../utils";
|
3
3
|
import { RenderContext } from './context';
|
4
|
+
import { relative, dirname, extname } from 'path';
|
4
5
|
|
5
6
|
|
6
7
|
export interface ImportObj {
|
@@ -57,6 +58,10 @@ export const UTILS = {
|
|
57
58
|
|
58
59
|
};
|
59
60
|
|
61
|
+
export const UTIL_HELPERS = [
|
62
|
+
'__contractContextBase__',
|
63
|
+
];
|
64
|
+
|
60
65
|
export const convertUtilsToImportList = (
|
61
66
|
context: RenderContext,
|
62
67
|
utils: string[],
|
@@ -102,59 +107,89 @@ export const convertUtil = (
|
|
102
107
|
}
|
103
108
|
};
|
104
109
|
|
105
|
-
export const getImportStatements = (list: ImportObj[]) => {
|
106
|
-
const imports = list.reduce((m, obj) => {
|
107
|
-
m[obj.path] = m[obj.path] || [];
|
108
|
-
const exists = m[obj.path].find(el => el.type === obj.type && el.path === obj.path && el.name === obj.name);
|
109
110
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
111
|
+
// __helpers__
|
112
|
+
export const getImportStatements = (
|
113
|
+
list: ImportObj[],
|
114
|
+
filepath?: string
|
115
|
+
) => {
|
116
|
+
|
117
|
+
// swap helpers with helpers file...
|
118
|
+
const modifiedImports = list.map(imp => {
|
119
|
+
if (filepath && UTIL_HELPERS.includes(imp.path)) {
|
120
|
+
const name = imp.path.replace(/__/g, '');
|
121
|
+
return {
|
122
|
+
...imp,
|
123
|
+
path: getRelativePath(filepath, `./${name}`)
|
124
|
+
}
|
125
|
+
}
|
126
|
+
return imp;
|
127
|
+
});
|
114
128
|
|
115
|
-
|
116
|
-
|
129
|
+
const imports = modifiedImports.reduce((m, obj) => {
|
130
|
+
m[obj.path] = m[obj.path] || [];
|
131
|
+
const exists = m[obj.path].find(el =>
|
132
|
+
el.type === obj.type && el.path === obj.path && el.name === obj.name);
|
133
|
+
|
134
|
+
// MARKED AS NOT DRY [google.protobuf names]
|
135
|
+
// TODO some have google.protobuf.Any shows up... figure out the better way to handle this
|
136
|
+
if (/\./.test(obj.name)) {
|
137
|
+
obj.name = obj.name.split('.')[obj.name.split('.').length - 1];
|
138
|
+
}
|
139
|
+
|
140
|
+
if (!exists) {
|
141
|
+
m[obj.path].push(obj);
|
142
|
+
}
|
143
|
+
return m;
|
117
144
|
}, {})
|
118
145
|
|
146
|
+
|
119
147
|
return Object.entries(imports)
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
148
|
+
.reduce((m, [importPath, imports]: [string, ImportObj[]]) => {
|
149
|
+
const defaultImports = imports.filter(a => a.type === 'default');
|
150
|
+
if (defaultImports.length) {
|
151
|
+
if (defaultImports.length > 1) throw new Error('more than one default name NOT allowed.')
|
152
|
+
m.push(
|
153
|
+
t.importDeclaration(
|
154
|
+
[
|
155
|
+
t.importDefaultSpecifier(
|
156
|
+
t.identifier(defaultImports[0].name)
|
157
|
+
)
|
158
|
+
],
|
159
|
+
t.stringLiteral(defaultImports[0].path)
|
160
|
+
)
|
129
161
|
)
|
130
|
-
|
131
|
-
|
132
|
-
)
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
162
|
+
}
|
163
|
+
const namedImports = imports.filter(a => a.type === 'import' && (!a.importAs || (a.name === a.importAs)));
|
164
|
+
if (namedImports.length) {
|
165
|
+
m.push(importStmt(namedImports.map(i => i.name), namedImports[0].path));
|
166
|
+
}
|
167
|
+
const aliasNamedImports = imports.filter(a => a.type === 'import' && (a.importAs && (a.name !== a.importAs)));
|
168
|
+
aliasNamedImports.forEach(imp => {
|
169
|
+
m.push(importAs(imp.name, imp.importAs, imp.path));
|
170
|
+
});
|
171
|
+
|
172
|
+
const namespaced = imports.filter(a => a.type === 'namespace');
|
173
|
+
if (namespaced.length) {
|
174
|
+
if (namespaced.length > 1) throw new Error('more than one namespaced name NOT allowed.')
|
175
|
+
m.push(
|
176
|
+
t.importDeclaration(
|
177
|
+
[
|
178
|
+
t.importNamespaceSpecifier(
|
179
|
+
t.identifier(namespaced[0].name)
|
180
|
+
)
|
181
|
+
],
|
182
|
+
t.stringLiteral(namespaced[0].path)
|
183
|
+
)
|
152
184
|
)
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
185
|
+
}
|
186
|
+
return m;
|
187
|
+
}, [])
|
188
|
+
};
|
189
|
+
|
190
|
+
export const getRelativePath = (f1: string, f2: string) => {
|
191
|
+
const rel = relative(dirname(f1), f2);
|
192
|
+
let importPath = rel.replace(extname(rel), '');
|
193
|
+
if (!/^\./.test(importPath)) importPath = `./${importPath}`;
|
194
|
+
return importPath;
|
195
|
+
}
|
package/src/index.ts
CHANGED
@@ -0,0 +1,49 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`create IContractsContext 1`] = `
|
4
|
+
"export interface IContractsContext {
|
5
|
+
whitelist: ISigningClientProvider<WhitelistClient> & IQueryClientProvider<WhitelistQueryClient>;
|
6
|
+
marketplace: ISigningClientProvider<MarketplaceClient>;
|
7
|
+
}"
|
8
|
+
`;
|
9
|
+
|
10
|
+
exports[`create getProviders 1`] = `
|
11
|
+
"export const getProviders = (address?: string, cosmWasmClient?: CosmWasmClient, signingCosmWasmClient?: SigningCosmWasmClient) => ({
|
12
|
+
whitelist: new Whitelist({
|
13
|
+
address,
|
14
|
+
cosmWasmClient,
|
15
|
+
signingCosmWasmClient
|
16
|
+
}),
|
17
|
+
marketplace: new Marketplace({
|
18
|
+
address,
|
19
|
+
cosmWasmClient,
|
20
|
+
signingCosmWasmClient
|
21
|
+
})
|
22
|
+
});"
|
23
|
+
`;
|
24
|
+
|
25
|
+
exports[`execute class 1`] = `
|
26
|
+
"export class Whitelist extends ContractBase<WhitelistClient, WhitelistQueryClient, WhitelistMessageComposer> {
|
27
|
+
constructor({
|
28
|
+
address,
|
29
|
+
cosmWasmClient,
|
30
|
+
signingCosmWasmClient
|
31
|
+
}: IContractConstructor) {
|
32
|
+
super(address, cosmWasmClient, signingCosmWasmClient, WhitelistClient, WhitelistQueryClient, WhitelistMessageComposer);
|
33
|
+
}
|
34
|
+
|
35
|
+
}"
|
36
|
+
`;
|
37
|
+
|
38
|
+
exports[`execute class without message composer 1`] = `
|
39
|
+
"export class Whitelist extends ContractBase<WhitelistClient, WhitelistQueryClient, IEmptyClient> {
|
40
|
+
constructor({
|
41
|
+
address,
|
42
|
+
cosmWasmClient,
|
43
|
+
signingCosmWasmClient
|
44
|
+
}: IContractConstructor) {
|
45
|
+
super(address, cosmWasmClient, signingCosmWasmClient, WhitelistClient, WhitelistQueryClient, undefined);
|
46
|
+
}
|
47
|
+
|
48
|
+
}"
|
49
|
+
`;
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './provider';
|
@@ -0,0 +1,81 @@
|
|
1
|
+
import execute_msg from "../../../../__fixtures__/basic/execute_msg_for__empty.json";
|
2
|
+
import query_msg from "../../../../__fixtures__/basic/query_msg.json";
|
3
|
+
import ownership from "../../../../__fixtures__/basic/ownership.json";
|
4
|
+
import { createGettingProviders, createIContractsContext, createProvider } from "./provider";
|
5
|
+
|
6
|
+
import { expectCode, makeContext } from "../../test-utils";
|
7
|
+
import { PROVIDER_TYPES } from "../utils/constants";
|
8
|
+
|
9
|
+
it("execute class", () => {
|
10
|
+
let info = {};
|
11
|
+
|
12
|
+
info[PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = {
|
13
|
+
classname: "WhitelistClient",
|
14
|
+
};
|
15
|
+
|
16
|
+
info[PROVIDER_TYPES.QUERY_CLIENT_TYPE] = {
|
17
|
+
classname: "WhitelistQueryClient",
|
18
|
+
};
|
19
|
+
|
20
|
+
info[PROVIDER_TYPES.MESSAGE_COMPOSER_TYPE] = {
|
21
|
+
classname: "WhitelistMessageComposer",
|
22
|
+
};
|
23
|
+
|
24
|
+
expectCode(createProvider("Whitelist", info));
|
25
|
+
});
|
26
|
+
|
27
|
+
it("execute class without message composer", () => {
|
28
|
+
let info = {};
|
29
|
+
|
30
|
+
info[PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = {
|
31
|
+
classname: "WhitelistClient",
|
32
|
+
};
|
33
|
+
|
34
|
+
info[PROVIDER_TYPES.QUERY_CLIENT_TYPE] = {
|
35
|
+
classname: "WhitelistQueryClient",
|
36
|
+
};
|
37
|
+
|
38
|
+
expectCode(createProvider("Whitelist", info));
|
39
|
+
});
|
40
|
+
|
41
|
+
it("create IContractsContext", () => {
|
42
|
+
let info = {
|
43
|
+
Whitelist: {},
|
44
|
+
Marketplace: {},
|
45
|
+
};
|
46
|
+
|
47
|
+
info["Whitelist"][PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = {
|
48
|
+
classname: "WhitelistClient",
|
49
|
+
};
|
50
|
+
|
51
|
+
info["Whitelist"][PROVIDER_TYPES.QUERY_CLIENT_TYPE] = {
|
52
|
+
classname: "WhitelistQueryClient",
|
53
|
+
};
|
54
|
+
|
55
|
+
info["Marketplace"][PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = {
|
56
|
+
classname: "MarketplaceClient",
|
57
|
+
};
|
58
|
+
|
59
|
+
expectCode(createIContractsContext(info));
|
60
|
+
});
|
61
|
+
|
62
|
+
it("create getProviders", () => {
|
63
|
+
let info = {
|
64
|
+
Whitelist: {},
|
65
|
+
Marketplace: {},
|
66
|
+
};
|
67
|
+
|
68
|
+
info["Whitelist"][PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = {
|
69
|
+
classname: "WhitelistClient",
|
70
|
+
};
|
71
|
+
|
72
|
+
info["Whitelist"][PROVIDER_TYPES.QUERY_CLIENT_TYPE] = {
|
73
|
+
classname: "WhitelistQueryClient",
|
74
|
+
};
|
75
|
+
|
76
|
+
info["Marketplace"][PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = {
|
77
|
+
classname: "MarketplaceClient",
|
78
|
+
};
|
79
|
+
|
80
|
+
expectCode(createGettingProviders(info));
|
81
|
+
});
|