@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.
- package/chunk-GC2KSB5D.js +226 -0
- package/chunk-GC2KSB5D.js.map +1 -0
- package/chunk-T4SGVAIL.js +604 -0
- package/chunk-T4SGVAIL.js.map +1 -0
- package/example/test-generation/example-contract-0.jest-demo.ts +78 -0
- package/example/test-generation/example-contract-1.jest-demo.ts +196 -0
- package/example/test-generation/example-contract-10.jest-demo.ts +47 -0
- package/example/test-generation/example-contract-11.jest-demo.ts +48 -0
- package/example/test-generation/example-contract-2.jest-demo.ts +277 -0
- package/example/test-generation/example-contract-4.jest-demo.ts +203 -0
- package/example/test-generation/example-contract-5.jest-demo.ts +235 -0
- package/example/test-generation/example-contract-6.jest-demo.ts +277 -0
- package/example/test-generation/example-contract-7.jest-demo.ts +170 -0
- package/example/test-generation/example-contract-8.jest-demo.ts +227 -0
- package/example/test-generation/example-contract-9.jest-demo.ts +42 -0
- package/example/types-file/example-contract-10.types.ts +2 -2
- package/example/types-file/example-contract-11.types.ts +2 -2
- package/example/types-file/type-aliases.ts +4 -0
- package/index.cjs +920 -0
- package/index.cjs.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +78 -882
- package/index.js.map +1 -1
- package/index.ts +1 -0
- package/package.json +27 -12
- package/src/cli-process.cjs +848 -0
- package/src/cli-process.cjs.map +1 -0
- package/src/cli-process.d.ts +9 -0
- package/src/cli-process.js +8 -0
- package/src/cli-process.js.map +1 -0
- package/src/generator/process.ts +37 -13
- package/src/generator/testing-code-generator-jest-demo.ts +75 -0
- package/src/generator/testing-code-generator.cjs +613 -0
- package/src/generator/testing-code-generator.cjs.map +1 -0
- package/src/generator/testing-code-generator.d.ts +79 -0
- package/src/generator/testing-code-generator.js +131 -0
- package/src/generator/testing-code-generator.js.map +1 -0
- package/src/generator/testing-code-generator.ts +282 -0
- package/src/generator/typescript-output.ts +136 -14
- package/src/type-aliases.ts +1 -0
- package/tsconfig.json +4 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
|
@@ -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 { ExampleContract2ContractType as ContractType } from '../types-file/example-contract-2.types';
|
|
6
|
+
import { ExampleContract2Code as ContractCode } from '../types-file/example-contract-2.code';
|
|
7
|
+
|
|
8
|
+
describe('example-contract-2', () => {
|
|
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,203 @@
|
|
|
1
|
+
|
|
2
|
+
import { TezosToolkit } from '@taquito/taquito';
|
|
3
|
+
import { char2Bytes } from '@taquito/utils';
|
|
4
|
+
import { tas } from '../types-file/type-aliases';
|
|
5
|
+
import { ExampleContract4ContractType as ContractType } from '../types-file/example-contract-4.types';
|
|
6
|
+
import { ExampleContract4Code as ContractCode } from '../types-file/example-contract-4.code';
|
|
7
|
+
|
|
8
|
+
describe('example-contract-4', () => {
|
|
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
|
+
pauseable_admin: {
|
|
17
|
+
admin: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
|
|
18
|
+
paused: true,
|
|
19
|
+
pending_admin: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
|
|
20
|
+
},
|
|
21
|
+
current_id: tas.nat('42'),
|
|
22
|
+
max_auction_time: tas.nat('42'),
|
|
23
|
+
max_config_to_start_time: tas.nat('42'),
|
|
24
|
+
bid_currency: {
|
|
25
|
+
fa2_address: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
|
|
26
|
+
token_id: tas.nat('42'),
|
|
27
|
+
},
|
|
28
|
+
auctions: tas.bigMap([{
|
|
29
|
+
key: tas.nat('42'),
|
|
30
|
+
value: {
|
|
31
|
+
seller: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
|
|
32
|
+
current_bid: tas.nat('42'),
|
|
33
|
+
start_time: tas.timestamp(new Date()),
|
|
34
|
+
last_bid_time: tas.timestamp(new Date()),
|
|
35
|
+
round_time: tas.int('42'),
|
|
36
|
+
extend_time: tas.int('42'),
|
|
37
|
+
asset: [{
|
|
38
|
+
fa2_address: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
|
|
39
|
+
fa2_batch: [{
|
|
40
|
+
token_id: tas.nat('42'),
|
|
41
|
+
amount: tas.nat('42'),
|
|
42
|
+
}],
|
|
43
|
+
}],
|
|
44
|
+
min_raise_percent: tas.nat('42'),
|
|
45
|
+
min_raise: tas.nat('42'),
|
|
46
|
+
end_time: tas.timestamp(new Date()),
|
|
47
|
+
highest_bidder: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
|
|
48
|
+
},
|
|
49
|
+
}]),
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
const newContractResult = await newContractOrigination.contract();
|
|
53
|
+
const newContractAddress = newContractResult.address;
|
|
54
|
+
contract = await Tezos.contract.at<ContractType>(newContractAddress);
|
|
55
|
+
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
it('should call confirm_admin', async () => {
|
|
60
|
+
|
|
61
|
+
const getStorageValue = async () => {
|
|
62
|
+
const storage = await contract.storage();
|
|
63
|
+
const value = storage;
|
|
64
|
+
return value;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const storageValueBefore = await getStorageValue();
|
|
68
|
+
|
|
69
|
+
const confirm_adminRequest = await contract.methodsObject.confirm_admin().send();
|
|
70
|
+
await confirm_adminRequest.confirmation(3);
|
|
71
|
+
|
|
72
|
+
const storageValueAfter = await getStorageValue();
|
|
73
|
+
|
|
74
|
+
expect(storageValueAfter).toBe('');
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('should call pause', async () => {
|
|
78
|
+
|
|
79
|
+
const getStorageValue = async () => {
|
|
80
|
+
const storage = await contract.storage();
|
|
81
|
+
const value = storage;
|
|
82
|
+
return value;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const storageValueBefore = await getStorageValue();
|
|
86
|
+
|
|
87
|
+
const pauseRequest = await contract.methodsObject.pause(true).send();
|
|
88
|
+
await pauseRequest.confirmation(3);
|
|
89
|
+
|
|
90
|
+
const storageValueAfter = await getStorageValue();
|
|
91
|
+
|
|
92
|
+
expect(storageValueAfter).toBe('');
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('should call set_admin', async () => {
|
|
96
|
+
|
|
97
|
+
const getStorageValue = async () => {
|
|
98
|
+
const storage = await contract.storage();
|
|
99
|
+
const value = storage;
|
|
100
|
+
return value;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const storageValueBefore = await getStorageValue();
|
|
104
|
+
|
|
105
|
+
const set_adminRequest = await contract.methodsObject.set_admin(tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456')).send();
|
|
106
|
+
await set_adminRequest.confirmation(3);
|
|
107
|
+
|
|
108
|
+
const storageValueAfter = await getStorageValue();
|
|
109
|
+
|
|
110
|
+
expect(storageValueAfter).toBe('');
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('should call bid', async () => {
|
|
114
|
+
|
|
115
|
+
const getStorageValue = async () => {
|
|
116
|
+
const storage = await contract.storage();
|
|
117
|
+
const value = storage;
|
|
118
|
+
return value;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const storageValueBefore = await getStorageValue();
|
|
122
|
+
|
|
123
|
+
const bidRequest = await contract.methodsObject.bid({
|
|
124
|
+
asset_id: tas.nat('42'),
|
|
125
|
+
bid_amount: tas.nat('42'),
|
|
126
|
+
}).send();
|
|
127
|
+
await bidRequest.confirmation(3);
|
|
128
|
+
|
|
129
|
+
const storageValueAfter = await getStorageValue();
|
|
130
|
+
|
|
131
|
+
expect(storageValueAfter).toBe('');
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('should call cancel', async () => {
|
|
135
|
+
|
|
136
|
+
const getStorageValue = async () => {
|
|
137
|
+
const storage = await contract.storage();
|
|
138
|
+
const value = storage;
|
|
139
|
+
return value;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const storageValueBefore = await getStorageValue();
|
|
143
|
+
|
|
144
|
+
const cancelRequest = await contract.methodsObject.cancel(tas.nat('42')).send();
|
|
145
|
+
await cancelRequest.confirmation(3);
|
|
146
|
+
|
|
147
|
+
const storageValueAfter = await getStorageValue();
|
|
148
|
+
|
|
149
|
+
expect(storageValueAfter).toBe('');
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it('should call configure', async () => {
|
|
153
|
+
|
|
154
|
+
const getStorageValue = async () => {
|
|
155
|
+
const storage = await contract.storage();
|
|
156
|
+
const value = storage;
|
|
157
|
+
return value;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const storageValueBefore = await getStorageValue();
|
|
161
|
+
|
|
162
|
+
const configureRequest = await contract.methodsObject.configure({
|
|
163
|
+
opening_price: tas.nat('42'),
|
|
164
|
+
min_raise_percent: tas.nat('42'),
|
|
165
|
+
min_raise: tas.nat('42'),
|
|
166
|
+
round_time: tas.nat('42'),
|
|
167
|
+
extend_time: tas.nat('42'),
|
|
168
|
+
asset: [{
|
|
169
|
+
fa2_address: tas.address('tz1ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'),
|
|
170
|
+
fa2_batch: [{
|
|
171
|
+
token_id: tas.nat('42'),
|
|
172
|
+
amount: tas.nat('42'),
|
|
173
|
+
}],
|
|
174
|
+
}],
|
|
175
|
+
start_time: tas.timestamp(new Date()),
|
|
176
|
+
end_time: tas.timestamp(new Date()),
|
|
177
|
+
}).send();
|
|
178
|
+
await configureRequest.confirmation(3);
|
|
179
|
+
|
|
180
|
+
const storageValueAfter = await getStorageValue();
|
|
181
|
+
|
|
182
|
+
expect(storageValueAfter).toBe('');
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it('should call resolve', async () => {
|
|
186
|
+
|
|
187
|
+
const getStorageValue = async () => {
|
|
188
|
+
const storage = await contract.storage();
|
|
189
|
+
const value = storage;
|
|
190
|
+
return value;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
const storageValueBefore = await getStorageValue();
|
|
194
|
+
|
|
195
|
+
const resolveRequest = await contract.methodsObject.resolve(tas.nat('42')).send();
|
|
196
|
+
await resolveRequest.confirmation(3);
|
|
197
|
+
|
|
198
|
+
const storageValueAfter = await getStorageValue();
|
|
199
|
+
|
|
200
|
+
expect(storageValueAfter).toBe('');
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
});
|