wasm-ast-types 0.2.4 → 0.3.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.
@@ -1,17 +1,18 @@
1
1
  import generate from '@babel/generator';
2
- import query_msg from './__fixtures__/schema/query_msg.json';
3
- import execute_msg from './__fixtures__/schema/execute_msg_for__empty.json';
4
- import approval_response from './__fixtures__/schema/approval_response.json';
5
- import all_nft_info_response from './__fixtures__/schema/all_nft_info_response.json';
6
- import approvals_response from './__fixtures__/schema/approvals_response.json';
7
- import collection_info_response from './__fixtures__/schema/collection_info_response.json';
8
- import contract_info_response from './__fixtures__/schema/contract_info_response.json';
9
- import instantiate_msg from './__fixtures__/schema/instantiate_msg.json';
10
- import nft_info_response from './__fixtures__/schema/nft_info_response.json';
11
- import num_tokens_response from './__fixtures__/schema/num_tokens_response.json';
12
- import operators_response from './__fixtures__/schema/operators_response.json';
13
- import owner_of_response from './__fixtures__/schema/owner_of_response.json';
14
- import tokens_response from './__fixtures__/schema/tokens_response.json';
2
+ import execute_msg_named_groups from './../../../__fixtures__/cw-named-groups/execute_msg.json';
3
+ import query_msg from './../../../__fixtures__/basic/query_msg.json';
4
+ import execute_msg from './../../../__fixtures__/basic/execute_msg_for__empty.json';
5
+ import approval_response from './../../../__fixtures__/basic/approval_response.json';
6
+ import all_nft_info_response from './../../../__fixtures__/basic/all_nft_info_response.json';
7
+ import approvals_response from './../../../__fixtures__/basic/approvals_response.json';
8
+ import collection_info_response from './../../../__fixtures__/basic/collection_info_response.json';
9
+ import contract_info_response from './../../../__fixtures__/basic/contract_info_response.json';
10
+ import instantiate_msg from './../../../__fixtures__/basic/instantiate_msg.json';
11
+ import nft_info_response from './../../../__fixtures__/basic/nft_info_response.json';
12
+ import num_tokens_response from './../../../__fixtures__/basic/num_tokens_response.json';
13
+ import operators_response from './../../../__fixtures__/basic/operators_response.json';
14
+ import owner_of_response from './../../../__fixtures__/basic/owner_of_response.json';
15
+ import tokens_response from './../../../__fixtures__/basic/tokens_response.json';
15
16
  import { createQueryClass, createQueryInterface, createExecuteClass, createExecuteInterface, createTypeInterface } from './wasm';
16
17
 
17
18
  const expectCode = ast => {
@@ -64,6 +65,9 @@ it('execute classes', () => {
64
65
  it('execute classes no extends', () => {
65
66
  expectCode(createExecuteClass('SG721Client', 'SG721Instance', null, execute_msg));
66
67
  });
68
+ it('execute classes array types', () => {
69
+ expectCode(createExecuteClass('SG721Client', 'SG721Instance', null, execute_msg_named_groups));
70
+ });
67
71
  it('execute interfaces no extends', () => {
68
72
  expectCode(createExecuteInterface('SG721Instance', null, execute_msg));
69
73
  });
@@ -0,0 +1,31 @@
1
+ import generate from '@babel/generator';
2
+ import cosmos_msg_for__empty from './../../../__fixtures__/vectis/cosmos_msg_for__empty.json';
3
+ import execute_msg_for__empty from './../../../__fixtures__/vectis/execute_msg_for__empty.json';
4
+ import { createQueryClass, createExecuteClass, createExecuteInterface, createTypeInterface } from './wasm';
5
+
6
+ const expectCode = ast => {
7
+ expect(generate(ast).code).toMatchSnapshot();
8
+ };
9
+
10
+ const printCode = ast => {
11
+ console.log(generate(ast).code);
12
+ };
13
+
14
+ it('cosmos_msg_for__empty', () => {
15
+ expectCode(createTypeInterface(cosmos_msg_for__empty));
16
+ });
17
+ it('execute_msg_for__empty', () => {
18
+ expectCode(createTypeInterface(execute_msg_for__empty));
19
+ });
20
+ it('query classes', () => {
21
+ expectCode(createQueryClass('SG721QueryClient', 'SG721ReadOnlyInstance', cosmos_msg_for__empty));
22
+ });
23
+ it('query classes', () => {
24
+ expectCode(createQueryClass('SG721QueryClient', 'SG721ReadOnlyInstance', execute_msg_for__empty));
25
+ });
26
+ it('execute classes array types', () => {
27
+ expectCode(createExecuteClass('SG721Client', 'SG721Instance', null, execute_msg_for__empty));
28
+ });
29
+ it('execute interfaces no extends', () => {
30
+ expectCode(createExecuteInterface('SG721Instance', null, execute_msg_for__empty));
31
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wasm-ast-types",
3
- "version": "0.2.4",
3
+ "version": "0.3.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",
@@ -85,5 +85,5 @@
85
85
  "ast-stringify": "0.1.0",
86
86
  "case": "1.6.3"
87
87
  },
88
- "gitHead": "c20c918c707e86cb8ebc0ea50764f7e9769f18b9"
88
+ "gitHead": "0e1c21c1c495002883f9511bb1dd693c468af0a6"
89
89
  }