@taqueria/plugin-contract-types 0.8.4 → 0.10.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.
Files changed (42) hide show
  1. package/chunk-GC2KSB5D.js +226 -0
  2. package/chunk-GC2KSB5D.js.map +1 -0
  3. package/chunk-T4SGVAIL.js +604 -0
  4. package/chunk-T4SGVAIL.js.map +1 -0
  5. package/example/test-generation/example-contract-0.jest-demo.ts +78 -0
  6. package/example/test-generation/example-contract-1.jest-demo.ts +196 -0
  7. package/example/test-generation/example-contract-10.jest-demo.ts +47 -0
  8. package/example/test-generation/example-contract-11.jest-demo.ts +48 -0
  9. package/example/test-generation/example-contract-2.jest-demo.ts +277 -0
  10. package/example/test-generation/example-contract-4.jest-demo.ts +203 -0
  11. package/example/test-generation/example-contract-5.jest-demo.ts +235 -0
  12. package/example/test-generation/example-contract-6.jest-demo.ts +277 -0
  13. package/example/test-generation/example-contract-7.jest-demo.ts +170 -0
  14. package/example/test-generation/example-contract-8.jest-demo.ts +227 -0
  15. package/example/test-generation/example-contract-9.jest-demo.ts +42 -0
  16. package/example/types-file/example-contract-10.types.ts +2 -2
  17. package/example/types-file/example-contract-11.types.ts +2 -2
  18. package/example/types-file/type-aliases.ts +4 -0
  19. package/index.cjs +920 -0
  20. package/index.cjs.map +1 -0
  21. package/index.d.ts +1 -0
  22. package/index.js +78 -882
  23. package/index.js.map +1 -1
  24. package/index.ts +1 -0
  25. package/package.json +27 -12
  26. package/src/cli-process.cjs +848 -0
  27. package/src/cli-process.cjs.map +1 -0
  28. package/src/cli-process.d.ts +9 -0
  29. package/src/cli-process.js +8 -0
  30. package/src/cli-process.js.map +1 -0
  31. package/src/generator/process.ts +37 -13
  32. package/src/generator/testing-code-generator-jest-demo.ts +75 -0
  33. package/src/generator/testing-code-generator.cjs +613 -0
  34. package/src/generator/testing-code-generator.cjs.map +1 -0
  35. package/src/generator/testing-code-generator.d.ts +79 -0
  36. package/src/generator/testing-code-generator.js +131 -0
  37. package/src/generator/testing-code-generator.js.map +1 -0
  38. package/src/generator/testing-code-generator.ts +282 -0
  39. package/src/generator/typescript-output.ts +136 -14
  40. package/src/type-aliases.ts +1 -0
  41. package/tsconfig.json +4 -1
  42. package/lib/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,235 @@
1
+
2
+ import { TezosToolkit } from '@taquito/taquito';
3
+ import { char2Bytes } from '@taquito/utils';
4
+ import { tas } from '../types-file/type-aliases';
5
+ import { ExampleContract5ContractType as ContractType } from '../types-file/example-contract-5.types';
6
+ import { ExampleContract5Code as ContractCode } from '../types-file/example-contract-5.code';
7
+
8
+ describe('example-contract-5', () => {
9
+ const Tezos = new TezosToolkit('RPC_URL');
10
+ let contract: ContractType = undefined as unknown as ContractType;
11
+ beforeAll(async () => {
12
+
13
+ const newContractOrigination = await Tezos.contract.originate<ContractType>({
14
+ code: ContractCode.code,
15
+ storage: {
16
+ transfers: [(
17
+ {
18
+ xtz_transfer_type: {
19
+ amount: tas.mutez('42'),
20
+ recipient: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
21
+ }
22
+ }
23
+ | {
24
+ token_transfer_type: {
25
+ contract_address: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
26
+ transfer_list: [{
27
+ from_: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
28
+ txs: [{
29
+ to_: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
30
+ token_id: tas.nat('42'),
31
+ amount: tas.nat('42'),
32
+ }],
33
+ }],
34
+ }
35
+ }
36
+ )],
37
+ },
38
+ });
39
+ const newContractResult = await newContractOrigination.contract();
40
+ const newContractAddress = newContractResult.address;
41
+ contract = await Tezos.contract.at<ContractType>(newContractAddress);
42
+
43
+ });
44
+
45
+
46
+ it('should call confirm_admin', async () => {
47
+
48
+ const getStorageValue = async () => {
49
+ const storage = await contract.storage();
50
+ const value = storage;
51
+ return value;
52
+ };
53
+
54
+ const storageValueBefore = await getStorageValue();
55
+
56
+ const confirm_adminRequest = await contract.methodsObject.confirm_admin().send();
57
+ await confirm_adminRequest.confirmation(3);
58
+
59
+ const storageValueAfter = await getStorageValue();
60
+
61
+ expect(storageValueAfter).toBe('');
62
+ });
63
+
64
+ it('should call pause', async () => {
65
+
66
+ const getStorageValue = async () => {
67
+ const storage = await contract.storage();
68
+ const value = storage;
69
+ return value;
70
+ };
71
+
72
+ const storageValueBefore = await getStorageValue();
73
+
74
+ const pauseRequest = await contract.methodsObject.pause(true).send();
75
+ await pauseRequest.confirmation(3);
76
+
77
+ const storageValueAfter = await getStorageValue();
78
+
79
+ expect(storageValueAfter).toBe('');
80
+ });
81
+
82
+ it('should call set_admin', async () => {
83
+
84
+ const getStorageValue = async () => {
85
+ const storage = await contract.storage();
86
+ const value = storage;
87
+ return value;
88
+ };
89
+
90
+ const storageValueBefore = await getStorageValue();
91
+
92
+ const set_adminRequest = await contract.methodsObject.set_admin({
93
+ bid: tas.nat('42'),
94
+ transfers: [(
95
+ {
96
+ xtz_transfer_type: {
97
+ amount: tas.mutez('42'),
98
+ recipient: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
99
+ }
100
+ }
101
+ | {
102
+ token_transfer_type: {
103
+ contract_address: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
104
+ transfer_list: [{
105
+ from_: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
106
+ txs: [{
107
+ to_: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
108
+ token_id: tas.nat('42'),
109
+ amount: tas.nat('42'),
110
+ }],
111
+ }],
112
+ }
113
+ }
114
+ )],
115
+ }).send();
116
+ await set_adminRequest.confirmation(3);
117
+
118
+ const storageValueAfter = await getStorageValue();
119
+
120
+ expect(storageValueAfter).toBe('');
121
+ });
122
+
123
+ it('should call bid', async () => {
124
+
125
+ const getStorageValue = async () => {
126
+ const storage = await contract.storage();
127
+ const value = storage;
128
+ return value;
129
+ };
130
+
131
+ const storageValueBefore = await getStorageValue();
132
+
133
+ const bidRequest = await contract.methodsObject.bid(tas.nat('42')).send();
134
+ await bidRequest.confirmation(3);
135
+
136
+ const storageValueAfter = await getStorageValue();
137
+
138
+ expect(storageValueAfter).toBe('');
139
+ });
140
+
141
+ it('should call cancel', async () => {
142
+
143
+ const getStorageValue = async () => {
144
+ const storage = await contract.storage();
145
+ const value = storage;
146
+ return value;
147
+ };
148
+
149
+ const storageValueBefore = await getStorageValue();
150
+
151
+ const cancelRequest = await contract.methodsObject.cancel(tas.nat('42')).send();
152
+ await cancelRequest.confirmation(3);
153
+
154
+ const storageValueAfter = await getStorageValue();
155
+
156
+ expect(storageValueAfter).toBe('');
157
+ });
158
+
159
+ it('should call configure', async () => {
160
+
161
+ const getStorageValue = async () => {
162
+ const storage = await contract.storage();
163
+ const value = storage;
164
+ return value;
165
+ };
166
+
167
+ const storageValueBefore = await getStorageValue();
168
+
169
+ const configureRequest = await contract.methodsObject.configure({
170
+ opening_price: tas.mutez('42'),
171
+ min_raise_percent: tas.nat('42'),
172
+ min_raise: tas.mutez('42'),
173
+ round_time: tas.nat('42'),
174
+ extend_time: tas.nat('42'),
175
+ asset: [{
176
+ fa2_address: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
177
+ fa2_batch: [{
178
+ token_id: tas.nat('42'),
179
+ amount: tas.nat('42'),
180
+ }],
181
+ }],
182
+ start_time: tas.timestamp(new Date()),
183
+ end_time: tas.timestamp(new Date()),
184
+ }).send();
185
+ await configureRequest.confirmation(3);
186
+
187
+ const storageValueAfter = await getStorageValue();
188
+
189
+ expect(storageValueAfter).toBe('');
190
+ });
191
+
192
+ it('should call propose', async () => {
193
+
194
+ const getStorageValue = async () => {
195
+ const storage = await contract.storage();
196
+ const value = storage;
197
+ return value;
198
+ };
199
+
200
+ const storageValueBefore = await getStorageValue();
201
+
202
+ const proposeRequest = await contract.methodsObject.propose({
203
+ frozen_token: tas.nat('42'),
204
+ proposal_metadata: tas.map({
205
+ 'VALUE': [(
206
+ {
207
+ xtz_transfer_type: {
208
+ amount: tas.mutez('42'),
209
+ recipient: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
210
+ }
211
+ }
212
+ | {
213
+ token_transfer_type: {
214
+ contract_address: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
215
+ transfer_list: [{
216
+ from_: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
217
+ txs: [{
218
+ to_: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
219
+ token_id: tas.nat('42'),
220
+ amount: tas.nat('42'),
221
+ }],
222
+ }],
223
+ }
224
+ }
225
+ )],
226
+ }),
227
+ }).send();
228
+ await proposeRequest.confirmation(3);
229
+
230
+ const storageValueAfter = await getStorageValue();
231
+
232
+ expect(storageValueAfter).toBe('');
233
+ });
234
+
235
+ });
@@ -0,0 +1,277 @@
1
+
2
+ import { TezosToolkit } from '@taquito/taquito';
3
+ import { char2Bytes } from '@taquito/utils';
4
+ import { tas } from '../types-file/type-aliases';
5
+ import { ExampleContract6ContractType as ContractType } from '../types-file/example-contract-6.types';
6
+ import { ExampleContract6Code as ContractCode } from '../types-file/example-contract-6.code';
7
+
8
+ describe('example-contract-6', () => {
9
+ const Tezos = new TezosToolkit('RPC_URL');
10
+ let contract: ContractType = undefined as unknown as ContractType;
11
+ beforeAll(async () => {
12
+
13
+ const newContractOrigination = await Tezos.contract.originate<ContractType>({
14
+ code: ContractCode.code,
15
+ storage: {
16
+ admin: {
17
+ admin: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
18
+ paused: true,
19
+ pending_admin: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
20
+ },
21
+ assets: {
22
+ ledger: tas.bigMap([{
23
+ key: {
24
+ 0: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
25
+ 1: tas.nat('42'),
26
+ },
27
+ value: tas.nat('42'),
28
+ }]),
29
+ operators: tas.bigMap([{
30
+ key: {
31
+ 0: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
32
+ 1: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
33
+ 2: tas.nat('42'),
34
+ },
35
+ value: tas.unit(),
36
+ }]),
37
+ token_metadata: tas.bigMap([{
38
+ key: tas.nat('42'),
39
+ value: {
40
+ token_id: tas.nat('42'),
41
+ token_info: tas.map({
42
+ 'VALUE': tas.bytes(char2Bytes('DATA')),
43
+ }),
44
+ },
45
+ }]),
46
+ token_total_supply: tas.bigMap([{
47
+ key: tas.nat('42'),
48
+ value: tas.nat('42'),
49
+ }]),
50
+ },
51
+ metadata: tas.bigMap({
52
+ 'VALUE': tas.bytes(char2Bytes('DATA')),
53
+ }),
54
+ },
55
+ });
56
+ const newContractResult = await newContractOrigination.contract();
57
+ const newContractAddress = newContractResult.address;
58
+ contract = await Tezos.contract.at<ContractType>(newContractAddress);
59
+
60
+ });
61
+
62
+
63
+ it('should call confirm_admin', async () => {
64
+
65
+ const getStorageValue = async () => {
66
+ const storage = await contract.storage();
67
+ const value = storage;
68
+ return value;
69
+ };
70
+
71
+ const storageValueBefore = await getStorageValue();
72
+
73
+ const confirm_adminRequest = await contract.methodsObject.confirm_admin().send();
74
+ await confirm_adminRequest.confirmation(3);
75
+
76
+ const storageValueAfter = await getStorageValue();
77
+
78
+ expect(storageValueAfter).toBe('');
79
+ });
80
+
81
+ it('should call pause', async () => {
82
+
83
+ const getStorageValue = async () => {
84
+ const storage = await contract.storage();
85
+ const value = storage;
86
+ return value;
87
+ };
88
+
89
+ const storageValueBefore = await getStorageValue();
90
+
91
+ const pauseRequest = await contract.methodsObject.pause(true).send();
92
+ await pauseRequest.confirmation(3);
93
+
94
+ const storageValueAfter = await getStorageValue();
95
+
96
+ expect(storageValueAfter).toBe('');
97
+ });
98
+
99
+ it('should call set_admin', async () => {
100
+
101
+ const getStorageValue = async () => {
102
+ const storage = await contract.storage();
103
+ const value = storage;
104
+ return value;
105
+ };
106
+
107
+ const storageValueBefore = await getStorageValue();
108
+
109
+ const set_adminRequest = await contract.methodsObject.set_admin(tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456')).send();
110
+ await set_adminRequest.confirmation(3);
111
+
112
+ const storageValueAfter = await getStorageValue();
113
+
114
+ expect(storageValueAfter).toBe('');
115
+ });
116
+
117
+ it('should call balance_of', async () => {
118
+
119
+ const getStorageValue = async () => {
120
+ const storage = await contract.storage();
121
+ const value = storage;
122
+ return value;
123
+ };
124
+
125
+ const storageValueBefore = await getStorageValue();
126
+
127
+ const balance_ofRequest = await contract.methodsObject.balance_of({
128
+ requests: [{
129
+ owner: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
130
+ token_id: tas.nat('42'),
131
+ }],
132
+ callback: tas.contract('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
133
+ }).send();
134
+ await balance_ofRequest.confirmation(3);
135
+
136
+ const storageValueAfter = await getStorageValue();
137
+
138
+ expect(storageValueAfter).toBe('');
139
+ });
140
+
141
+ it('should call transfer', async () => {
142
+
143
+ const getStorageValue = async () => {
144
+ const storage = await contract.storage();
145
+ const value = storage;
146
+ return value;
147
+ };
148
+
149
+ const storageValueBefore = await getStorageValue();
150
+
151
+ const transferRequest = await contract.methodsObject.transfer([{
152
+ from_: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
153
+ txs: [{
154
+ to_: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
155
+ token_id: tas.nat('42'),
156
+ amount: tas.nat('42'),
157
+ }],
158
+ }]).send();
159
+ await transferRequest.confirmation(3);
160
+
161
+ const storageValueAfter = await getStorageValue();
162
+
163
+ expect(storageValueAfter).toBe('');
164
+ });
165
+
166
+ it('should call add_operator', async () => {
167
+
168
+ const getStorageValue = async () => {
169
+ const storage = await contract.storage();
170
+ const value = storage;
171
+ return value;
172
+ };
173
+
174
+ const storageValueBefore = await getStorageValue();
175
+
176
+ const add_operatorRequest = await contract.methodsObject.add_operator({
177
+ owner: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
178
+ operator: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
179
+ token_id: tas.nat('42'),
180
+ }).send();
181
+ await add_operatorRequest.confirmation(3);
182
+
183
+ const storageValueAfter = await getStorageValue();
184
+
185
+ expect(storageValueAfter).toBe('');
186
+ });
187
+
188
+ it('should call remove_operator', async () => {
189
+
190
+ const getStorageValue = async () => {
191
+ const storage = await contract.storage();
192
+ const value = storage;
193
+ return value;
194
+ };
195
+
196
+ const storageValueBefore = await getStorageValue();
197
+
198
+ const remove_operatorRequest = await contract.methodsObject.remove_operator({
199
+ owner: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
200
+ operator: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
201
+ token_id: tas.nat('42'),
202
+ }).send();
203
+ await remove_operatorRequest.confirmation(3);
204
+
205
+ const storageValueAfter = await getStorageValue();
206
+
207
+ expect(storageValueAfter).toBe('');
208
+ });
209
+
210
+ it('should call burn_tokens', async () => {
211
+
212
+ const getStorageValue = async () => {
213
+ const storage = await contract.storage();
214
+ const value = storage;
215
+ return value;
216
+ };
217
+
218
+ const storageValueBefore = await getStorageValue();
219
+
220
+ const burn_tokensRequest = await contract.methodsObject.burn_tokens([{
221
+ owner: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
222
+ token_id: tas.nat('42'),
223
+ amount: tas.nat('42'),
224
+ }]).send();
225
+ await burn_tokensRequest.confirmation(3);
226
+
227
+ const storageValueAfter = await getStorageValue();
228
+
229
+ expect(storageValueAfter).toBe('');
230
+ });
231
+
232
+ it('should call create_token', async () => {
233
+
234
+ const getStorageValue = async () => {
235
+ const storage = await contract.storage();
236
+ const value = storage;
237
+ return value;
238
+ };
239
+
240
+ const storageValueBefore = await getStorageValue();
241
+
242
+ const create_tokenRequest = await contract.methodsObject.create_token({
243
+ token_id: tas.nat('42'),
244
+ token_info: tas.map({
245
+ 'VALUE': tas.bytes(char2Bytes('DATA')),
246
+ }),
247
+ }).send();
248
+ await create_tokenRequest.confirmation(3);
249
+
250
+ const storageValueAfter = await getStorageValue();
251
+
252
+ expect(storageValueAfter).toBe('');
253
+ });
254
+
255
+ it('should call mint_tokens', async () => {
256
+
257
+ const getStorageValue = async () => {
258
+ const storage = await contract.storage();
259
+ const value = storage;
260
+ return value;
261
+ };
262
+
263
+ const storageValueBefore = await getStorageValue();
264
+
265
+ const mint_tokensRequest = await contract.methodsObject.mint_tokens([{
266
+ owner: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
267
+ token_id: tas.nat('42'),
268
+ amount: tas.nat('42'),
269
+ }]).send();
270
+ await mint_tokensRequest.confirmation(3);
271
+
272
+ const storageValueAfter = await getStorageValue();
273
+
274
+ expect(storageValueAfter).toBe('');
275
+ });
276
+
277
+ });
@@ -0,0 +1,170 @@
1
+
2
+ import { TezosToolkit } from '@taquito/taquito';
3
+ import { char2Bytes } from '@taquito/utils';
4
+ import { tas } from '../types-file/type-aliases';
5
+ import { ExampleContract7ContractType as ContractType } from '../types-file/example-contract-7.types';
6
+ import { ExampleContract7Code as ContractCode } from '../types-file/example-contract-7.code';
7
+
8
+ describe('example-contract-7', () => {
9
+ const Tezos = new TezosToolkit('RPC_URL');
10
+ let contract: ContractType = undefined as unknown as ContractType;
11
+ beforeAll(async () => {
12
+
13
+ const newContractOrigination = await Tezos.contract.originate<ContractType>({
14
+ code: ContractCode.code,
15
+ storage: {
16
+ admin: {
17
+ admin: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
18
+ paused: true,
19
+ pending_admin: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
20
+ },
21
+ sales: tas.bigMap([{
22
+ key: {
23
+ sale_seller: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
24
+ tokens: {
25
+ token_for_sale_address: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
26
+ token_for_sale_token_id: tas.nat('42'),
27
+ money_token_address: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
28
+ money_token_token_id: tas.nat('42'),
29
+ },
30
+ },
31
+ value: tas.nat('42'),
32
+ }]),
33
+ },
34
+ });
35
+ const newContractResult = await newContractOrigination.contract();
36
+ const newContractAddress = newContractResult.address;
37
+ contract = await Tezos.contract.at<ContractType>(newContractAddress);
38
+
39
+ });
40
+
41
+
42
+ it('should call confirm_admin', async () => {
43
+
44
+ const getStorageValue = async () => {
45
+ const storage = await contract.storage();
46
+ const value = storage;
47
+ return value;
48
+ };
49
+
50
+ const storageValueBefore = await getStorageValue();
51
+
52
+ const confirm_adminRequest = await contract.methodsObject.confirm_admin().send();
53
+ await confirm_adminRequest.confirmation(3);
54
+
55
+ const storageValueAfter = await getStorageValue();
56
+
57
+ expect(storageValueAfter).toBe('');
58
+ });
59
+
60
+ it('should call pause', async () => {
61
+
62
+ const getStorageValue = async () => {
63
+ const storage = await contract.storage();
64
+ const value = storage;
65
+ return value;
66
+ };
67
+
68
+ const storageValueBefore = await getStorageValue();
69
+
70
+ const pauseRequest = await contract.methodsObject.pause(true).send();
71
+ await pauseRequest.confirmation(3);
72
+
73
+ const storageValueAfter = await getStorageValue();
74
+
75
+ expect(storageValueAfter).toBe('');
76
+ });
77
+
78
+ it('should call set_admin', async () => {
79
+
80
+ const getStorageValue = async () => {
81
+ const storage = await contract.storage();
82
+ const value = storage;
83
+ return value;
84
+ };
85
+
86
+ const storageValueBefore = await getStorageValue();
87
+
88
+ const set_adminRequest = await contract.methodsObject.set_admin(tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456')).send();
89
+ await set_adminRequest.confirmation(3);
90
+
91
+ const storageValueAfter = await getStorageValue();
92
+
93
+ expect(storageValueAfter).toBe('');
94
+ });
95
+
96
+ it('should call buy', async () => {
97
+
98
+ const getStorageValue = async () => {
99
+ const storage = await contract.storage();
100
+ const value = storage;
101
+ return value;
102
+ };
103
+
104
+ const storageValueBefore = await getStorageValue();
105
+
106
+ const buyRequest = await contract.methodsObject.buy({
107
+ sale_seller: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
108
+ token_for_sale_address: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
109
+ token_for_sale_token_id: tas.nat('42'),
110
+ money_token_address: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
111
+ money_token_token_id: tas.nat('42'),
112
+ }).send();
113
+ await buyRequest.confirmation(3);
114
+
115
+ const storageValueAfter = await getStorageValue();
116
+
117
+ expect(storageValueAfter).toBe('');
118
+ });
119
+
120
+ it('should call mint', async () => {
121
+
122
+ const getStorageValue = async () => {
123
+ const storage = await contract.storage();
124
+ const value = storage;
125
+ return value;
126
+ };
127
+
128
+ const storageValueBefore = await getStorageValue();
129
+
130
+ const mintRequest = await contract.methodsObject.mint([{
131
+ token_metadata: {
132
+ token_id: tas.nat('42'),
133
+ token_info: tas.map({
134
+ 'VALUE': tas.bytes(char2Bytes('DATA')),
135
+ }),
136
+ },
137
+ owner: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
138
+ }]).send();
139
+ await mintRequest.confirmation(3);
140
+
141
+ const storageValueAfter = await getStorageValue();
142
+
143
+ expect(storageValueAfter).toBe('');
144
+ });
145
+
146
+ it('should call sell', async () => {
147
+
148
+ const getStorageValue = async () => {
149
+ const storage = await contract.storage();
150
+ const value = storage;
151
+ return value;
152
+ };
153
+
154
+ const storageValueBefore = await getStorageValue();
155
+
156
+ const sellRequest = await contract.methodsObject.sell({
157
+ sale_price: tas.nat('42'),
158
+ token_for_sale_address: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
159
+ token_for_sale_token_id: tas.nat('42'),
160
+ money_token_address: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
161
+ money_token_token_id: tas.nat('42'),
162
+ }).send();
163
+ await sellRequest.confirmation(3);
164
+
165
+ const storageValueAfter = await getStorageValue();
166
+
167
+ expect(storageValueAfter).toBe('');
168
+ });
169
+
170
+ });