wowok 1.0.3 → 1.0.5

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,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.change_owner = exports.remove_admin = exports.add_admin = exports.set_description = exports.remove_entity = exports.remove_index = exports.add_or_modify = exports.set_guard = exports.add_entity = exports.launch = exports.permission = exports.PermissionIndex = exports.MAX_PERMISSION_INDEX_COUNT = exports.MAX_ENTITY_COUNT = exports.MAX_ADMIN_COUNT = void 0;
3
+ exports.change_owner = exports.remove_admin = exports.add_admin = exports.set_description = exports.remove_entity = exports.remove_index = exports.set_guard = exports.add_entity = exports.destroy = exports.launch = exports.permission = exports.IsValidPermissionIndex = exports.IsValidUserDefinedIndex = exports.PermissionIndex = exports.MAX_PERMISSION_INDEX_COUNT = exports.MAX_ENTITY_COUNT = exports.MAX_ADMIN_COUNT = void 0;
4
4
  const bcs_1 = require("@mysten/bcs");
5
5
  const protocol_1 = require("./protocol");
6
6
  const util_1 = require("./util");
7
7
  exports.MAX_ADMIN_COUNT = 64;
8
- exports.MAX_ENTITY_COUNT = 1024;
9
- exports.MAX_PERMISSION_INDEX_COUNT = 512;
8
+ exports.MAX_ENTITY_COUNT = 2000;
9
+ exports.MAX_PERMISSION_INDEX_COUNT = 200;
10
10
  var PermissionIndex;
11
11
  (function (PermissionIndex) {
12
12
  PermissionIndex[PermissionIndex["repository"] = 100] = "repository";
@@ -84,134 +84,202 @@ var PermissionIndex;
84
84
  PermissionIndex[PermissionIndex["progress_bind_task"] = 652] = "progress_bind_task";
85
85
  PermissionIndex[PermissionIndex["progress_set_context_repository"] = 653] = "progress_set_context_repository";
86
86
  PermissionIndex[PermissionIndex["progress_unhold"] = 654] = "progress_unhold";
87
+ PermissionIndex[PermissionIndex["user_defined_start"] = 10000] = "user_defined_start";
87
88
  })(PermissionIndex || (exports.PermissionIndex = PermissionIndex = {}));
89
+ const IsValidUserDefinedIndex = (index) => {
90
+ return index >= PermissionIndex.user_defined_start && (0, protocol_1.IsValidUint)(index);
91
+ };
92
+ exports.IsValidUserDefinedIndex = IsValidUserDefinedIndex;
93
+ const IsValidPermissionIndex = (index) => {
94
+ //console.log(index)
95
+ if (Object.values(PermissionIndex).includes(index)) {
96
+ return true;
97
+ }
98
+ //console.log(Object.keys(PermissionIndex))
99
+ return (0, exports.IsValidUserDefinedIndex)(index);
100
+ };
101
+ exports.IsValidPermissionIndex = IsValidPermissionIndex;
88
102
  function permission(txb, description) {
103
+ if (!(0, protocol_1.IsValidDesription)(description))
104
+ return false;
89
105
  return txb.moveCall({
90
106
  target: protocol_1.PROTOCOL.PermissionFn('new'),
91
- arguments: [txb.pure((0, protocol_1.description_data)(description))]
107
+ arguments: [txb.pure(description)]
92
108
  });
93
109
  }
94
110
  exports.permission = permission;
95
111
  function launch(txb, permission) {
112
+ if (!(0, protocol_1.IsValidObjects)([permission]))
113
+ return false;
96
114
  return txb.moveCall({
97
115
  target: protocol_1.PROTOCOL.PermissionFn('create'),
98
- arguments: [permission]
116
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, permission)]
99
117
  });
100
118
  }
101
119
  exports.launch = launch;
120
+ function destroy(txb, permission) {
121
+ if (!(0, protocol_1.IsValidObjects)([permission]))
122
+ return false;
123
+ txb.moveCall({
124
+ target: protocol_1.PROTOCOL.PermissionFn('destroy'),
125
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, permission)],
126
+ });
127
+ return true;
128
+ }
129
+ exports.destroy = destroy;
102
130
  function add_entity(txb, permission, entities) {
131
+ if (!(0, protocol_1.IsValidObjects)([permission]))
132
+ return false;
133
+ if (!entities)
134
+ return false;
135
+ let bValid = true;
136
+ let e = entities.forEach((v) => {
137
+ if (!(0, protocol_1.IsValidAddress)(v.entity_address))
138
+ bValid = false;
139
+ v.permissions.forEach((p) => {
140
+ if (!(0, exports.IsValidPermissionIndex)(p.index))
141
+ bValid = false;
142
+ if (p?.guard && !(0, protocol_1.IsValidObjects)([p.guard]))
143
+ bValid = false;
144
+ });
145
+ });
146
+ if (!bValid)
147
+ return false;
103
148
  let guards = [];
104
149
  for (let i = 0; i < entities.length; i++) {
105
150
  let entity = entities[i];
106
151
  let indexes = [];
107
152
  for (let j = 0; j < entity.permissions.length; j++) {
108
153
  let index = entity.permissions[j];
109
- if (index?.guard) {
110
- guards.push({ who: entity.who, index: index.index, guard: index.guard });
154
+ if (!(0, exports.IsValidPermissionIndex)(index.index)) {
155
+ continue;
111
156
  }
112
157
  if (!indexes.includes(index.index)) {
113
158
  indexes.push(index.index);
159
+ if (index?.guard) {
160
+ guards.push({ entity_address: entity.entity_address, index: index.index, guard: index.guard });
161
+ }
114
162
  }
115
163
  }
116
164
  if (indexes.length > 0) {
117
165
  txb.moveCall({
118
166
  target: protocol_1.PROTOCOL.PermissionFn('add_batch'),
119
- arguments: [permission, txb.pure(entity.who, bcs_1.BCS.ADDRESS), txb.pure(indexes, 'vector<u64>')]
167
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, permission), txb.pure(entity.entity_address, bcs_1.BCS.ADDRESS), txb.pure(indexes, 'vector<u64>')]
120
168
  });
121
169
  }
122
170
  }
123
171
  // set guards
124
- guards.forEach(({ who, index, guard }) => {
172
+ guards.forEach(({ entity_address, index, guard }) => {
125
173
  txb.moveCall({
126
174
  target: protocol_1.PROTOCOL.PermissionFn('guard_set'),
127
- arguments: [permission, txb.pure(who, bcs_1.BCS.ADDRESS), txb.pure(index, bcs_1.BCS.U64), (0, protocol_1.TXB_OBJECT)(txb, guard)]
175
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, permission), txb.pure(entity_address, bcs_1.BCS.ADDRESS), txb.pure(index, bcs_1.BCS.U64), (0, protocol_1.TXB_OBJECT)(txb, guard)]
128
176
  });
129
177
  });
178
+ return true;
130
179
  }
131
180
  exports.add_entity = add_entity;
132
181
  // guard: undefine to set none
133
- function set_guard(txb, permission, who, index, guard) {
182
+ function set_guard(txb, permission, entity_address, index, guard) {
183
+ if (!(0, protocol_1.IsValidObjects)([permission]))
184
+ return false;
185
+ if (!(0, protocol_1.IsValidAddress)(entity_address) || !(0, exports.IsValidPermissionIndex)(index))
186
+ return false;
134
187
  if (guard) {
135
188
  txb.moveCall({
136
189
  target: protocol_1.PROTOCOL.PermissionFn('guard_set'),
137
- arguments: [permission, txb.pure(who, bcs_1.BCS.ADDRESS), txb.pure(index, bcs_1.BCS.U64), (0, protocol_1.TXB_OBJECT)(txb, guard)]
190
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, permission), txb.pure(entity_address, bcs_1.BCS.ADDRESS), txb.pure(index, bcs_1.BCS.U64), (0, protocol_1.TXB_OBJECT)(txb, guard)]
138
191
  });
139
192
  }
140
193
  else {
141
194
  txb.moveCall({
142
195
  target: protocol_1.PROTOCOL.PermissionFn('guard_none'),
143
- arguments: [permission, txb.pure(who, bcs_1.BCS.ADDRESS), txb.pure(index, bcs_1.BCS.U64)]
196
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, permission), txb.pure(entity_address, bcs_1.BCS.ADDRESS), txb.pure(index, bcs_1.BCS.U64)]
144
197
  });
145
198
  }
199
+ return true;
146
200
  }
147
201
  exports.set_guard = set_guard;
148
- function add_or_modify(txb, permission, who, index, modifyIfOldExist, guard) {
149
- if (guard) {
150
- txb.moveCall({
151
- target: protocol_1.PROTOCOL.PermissionFn('add_or_modify'),
152
- arguments: [permission, txb.pure(who, bcs_1.BCS.ADDRESS), txb.pure(index, bcs_1.BCS.U64), (0, protocol_1.TXB_OBJECT)(txb, guard), txb.pure(modifyIfOldExist, bcs_1.BCS.BOOL)]
153
- });
154
- }
155
- else {
156
- txb.moveCall({
157
- target: protocol_1.PROTOCOL.PermissionFn('add_or_modify'),
158
- arguments: [permission, txb.pure(who, bcs_1.BCS.ADDRESS), txb.pure(index, bcs_1.BCS.U64), txb.pure([], bcs_1.BCS.U8), txb.pure(modifyIfOldExist, bcs_1.BCS.BOOL)]
159
- });
160
- }
161
- }
162
- exports.add_or_modify = add_or_modify;
163
- function remove_index(txb, permission, who, index) {
164
- if (index) {
165
- txb.moveCall({
166
- target: protocol_1.PROTOCOL.PermissionFn('remove_index'),
167
- arguments: [permission, txb.pure(who, bcs_1.BCS.ADDRESS), txb.pure(index, 'vector<u64>')]
168
- });
169
- }
202
+ function remove_index(txb, permission, entity_address, index) {
203
+ if (!(0, protocol_1.IsValidObjects)([permission]))
204
+ return false;
205
+ if (!(0, protocol_1.IsValidAddress)(entity_address))
206
+ return false;
207
+ if (!index || !((0, protocol_1.IsValidArray)(index, exports.IsValidPermissionIndex)))
208
+ return false;
209
+ txb.moveCall({
210
+ target: protocol_1.PROTOCOL.PermissionFn('remove_index'),
211
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, permission), txb.pure(entity_address, bcs_1.BCS.ADDRESS), txb.pure((0, util_1.array_unique)(index), 'vector<u64>')]
212
+ });
213
+ return true;
170
214
  }
171
215
  exports.remove_index = remove_index;
172
- function remove_entity(txb, permission, who) {
173
- if (who) {
174
- txb.moveCall({
175
- target: protocol_1.PROTOCOL.PermissionFn('remove'),
176
- arguments: [permission, txb.pure(who, 'vector<address>')]
177
- });
178
- }
216
+ function remove_entity(txb, permission, entity_address) {
217
+ if (!(0, protocol_1.IsValidObjects)([permission]))
218
+ return false;
219
+ if (!entity_address || !(0, protocol_1.IsValidArray)(entity_address, protocol_1.IsValidAddress))
220
+ return false;
221
+ txb.moveCall({
222
+ target: protocol_1.PROTOCOL.PermissionFn('remove'),
223
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, permission), txb.pure((0, util_1.array_unique)(entity_address), 'vector<address>')]
224
+ });
225
+ return true;
179
226
  }
180
227
  exports.remove_entity = remove_entity;
181
228
  function set_description(txb, permission, description) {
229
+ if (!(0, protocol_1.IsValidObjects)([permission]))
230
+ return false;
231
+ if (!(0, protocol_1.IsValidDesription)(description))
232
+ return false;
182
233
  txb.moveCall({
183
234
  target: protocol_1.PROTOCOL.PermissionFn('description_set'),
184
- arguments: [permission, txb.pure((0, protocol_1.description_data)(description))]
235
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, permission), txb.pure(description)]
185
236
  });
237
+ return true;
186
238
  }
187
239
  exports.set_description = set_description;
188
240
  function add_admin(txb, permission, admin) {
189
- let n = (0, util_1.array_unique)(admin);
241
+ if (!(0, protocol_1.IsValidObjects)([permission]))
242
+ return false;
243
+ if (!admin || !(0, protocol_1.IsValidArray)(admin, protocol_1.IsValidAddress))
244
+ return false;
190
245
  txb.moveCall({
191
246
  target: protocol_1.PROTOCOL.PermissionFn('admin_add_batch'),
192
- arguments: [permission, txb.pure(n, 'vector<address>')]
247
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, permission), txb.pure((0, util_1.array_unique)(admin), 'vector<address>')]
193
248
  });
249
+ return true;
194
250
  }
195
251
  exports.add_admin = add_admin;
196
252
  function remove_admin(txb, permission, admin, removeall) {
253
+ if (!(0, protocol_1.IsValidObjects)([permission]))
254
+ return false;
255
+ if (!removeall && !admin)
256
+ return false;
257
+ if (!(0, protocol_1.IsValidArray)(admin, protocol_1.IsValidAddress))
258
+ return false;
197
259
  if (removeall) {
198
260
  txb.moveCall({
199
261
  target: protocol_1.PROTOCOL.PermissionFn('admins_clear'),
200
- arguments: [permission]
262
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, permission)]
201
263
  });
202
264
  }
203
- else {
265
+ else if (admin) {
204
266
  txb.moveCall({
205
267
  target: protocol_1.PROTOCOL.PermissionFn('admin_remove_batch'),
206
- arguments: [permission, txb.pure(admin, 'vector<address>')]
268
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, permission), txb.pure((0, util_1.array_unique)(admin), 'vector<address>')]
207
269
  });
208
270
  }
271
+ return true;
209
272
  }
210
273
  exports.remove_admin = remove_admin;
211
274
  function change_owner(txb, permission, new_owner) {
275
+ if (!(0, protocol_1.IsValidObjects)([permission]))
276
+ return false;
277
+ if (!(0, protocol_1.IsValidAddress)(new_owner))
278
+ return false;
212
279
  txb.moveCall({
213
280
  target: protocol_1.PROTOCOL.PermissionFn('builder_set'),
214
- arguments: [permission, txb.pure(new_owner, bcs_1.BCS.ADDRESS)]
281
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, permission), txb.pure(new_owner, bcs_1.BCS.ADDRESS)]
215
282
  });
283
+ return true;
216
284
  }
217
285
  exports.change_owner = change_owner;
package/dist/progress.js CHANGED
@@ -3,89 +3,115 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hold = exports.next = exports.progress_unhold = exports.progress_set_context_repository = exports.progress_bind_task = exports.progress_set_namedOperator = exports.destroy = exports.launch_as_child = exports.launch = exports.progress = exports.MAX_NAMED_OPERATOR_COUNT = void 0;
4
4
  const bcs_1 = require("@mysten/bcs");
5
5
  const protocol_1 = require("./protocol");
6
- exports.MAX_NAMED_OPERATOR_COUNT = 64;
6
+ const util_1 = require("./util");
7
+ exports.MAX_NAMED_OPERATOR_COUNT = 100;
7
8
  function progress(txb, machine, permission, passport) {
9
+ if (!(0, protocol_1.IsValidObjects)([machine, permission]))
10
+ return false;
8
11
  if (passport) {
9
12
  return txb.moveCall({
10
13
  target: protocol_1.PROTOCOL.ProgressFn('new_with_passport'),
11
- arguments: [passport, machine, permission],
14
+ arguments: [passport, (0, protocol_1.TXB_OBJECT)(txb, machine), (0, protocol_1.TXB_OBJECT)(txb, permission)],
12
15
  });
13
16
  }
14
17
  else {
15
18
  return txb.moveCall({
16
19
  target: protocol_1.PROTOCOL.ProgressFn('new'),
17
- arguments: [machine, permission],
20
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, machine), (0, protocol_1.TXB_OBJECT)(txb, permission)],
18
21
  });
19
22
  }
20
23
  }
21
24
  exports.progress = progress;
22
25
  function launch(txb, progress) {
26
+ if (!(0, protocol_1.IsValidObjects)([progress]))
27
+ return false;
23
28
  return txb.moveCall({
24
29
  target: protocol_1.PROTOCOL.ProgressFn('create'),
25
- arguments: [progress],
30
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, progress)],
26
31
  });
27
32
  }
28
33
  exports.launch = launch;
29
34
  function launch_as_child(txb, progress, parent, parent_next) {
35
+ if (!(0, protocol_1.IsValidObjects)([progress, parent]))
36
+ return false;
37
+ if (!IsValidProgressNext(parent_next))
38
+ return false;
30
39
  return txb.moveCall({
31
40
  target: protocol_1.PROTOCOL.ProgressFn('create_as_child'),
32
- arguments: [progress, parent, txb.pure(parent_next.next_node_name), txb.pure((0, protocol_1.name_data)(parent_next.forward))],
41
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, progress), (0, protocol_1.TXB_OBJECT)(txb, parent), txb.pure(parent_next.next_node_name), txb.pure(parent_next.forward)],
33
42
  });
34
43
  }
35
44
  exports.launch_as_child = launch_as_child;
36
45
  function destroy(txb, progress) {
37
- return txb.moveCall({
46
+ if (!(0, protocol_1.IsValidObjects)([progress]))
47
+ return false;
48
+ txb.moveCall({
38
49
  target: protocol_1.PROTOCOL.ProgressFn('destroy'),
39
- arguments: [progress],
50
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, progress)],
40
51
  });
52
+ return true;
41
53
  }
42
54
  exports.destroy = destroy;
43
55
  function progress_set_namedOperator(txb, machine, permission, progress, name, addresses, passport) {
44
- if (addresses.length == 0 || name.length == 0 || addresses.length > exports.MAX_NAMED_OPERATOR_COUNT)
45
- return undefined;
56
+ if (!(0, protocol_1.IsValidObjects)([machine, permission, progress]))
57
+ return false;
58
+ if (!(0, protocol_1.IsValidName)(name))
59
+ return false;
60
+ if (!addresses || addresses.length > exports.MAX_NAMED_OPERATOR_COUNT)
61
+ return false;
62
+ if (!(0, protocol_1.IsValidArray)(addresses, protocol_1.IsValidAddress))
63
+ return false;
46
64
  if (passport) {
47
65
  txb.moveCall({
48
66
  target: protocol_1.PROTOCOL.ProgressFn('namedOperator_set_with_passport'),
49
- arguments: [passport, progress, txb.pure((0, protocol_1.name_data)(name)), txb.pure(addresses, 'vector<address>'),
50
- machine, permission],
67
+ arguments: [passport, (0, protocol_1.TXB_OBJECT)(txb, progress), txb.pure(name), txb.pure((0, util_1.array_unique)(addresses), 'vector<address>'),
68
+ (0, protocol_1.TXB_OBJECT)(txb, machine), (0, protocol_1.TXB_OBJECT)(txb, permission)],
51
69
  });
52
70
  }
53
71
  else {
54
72
  txb.moveCall({
55
73
  target: protocol_1.PROTOCOL.ProgressFn('namedOperator_set'),
56
- arguments: [progress, txb.pure((0, protocol_1.name_data)(name)), txb.pure(addresses, 'vector<address>'),
57
- machine, permission],
74
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, progress), txb.pure(name), txb.pure((0, util_1.array_unique)(addresses), 'vector<address>'),
75
+ (0, protocol_1.TXB_OBJECT)(txb, machine), (0, protocol_1.TXB_OBJECT)(txb, permission)],
58
76
  });
59
77
  }
78
+ return true;
60
79
  }
61
80
  exports.progress_set_namedOperator = progress_set_namedOperator;
62
81
  function progress_bind_task(txb, machine, permission, progress, task_address, passport) {
82
+ if (!(0, protocol_1.IsValidObjects)([machine, permission, progress]))
83
+ return false;
84
+ if (!(0, protocol_1.IsValidAddress)(task_address))
85
+ return false;
63
86
  if (passport) {
64
87
  txb.moveCall({
65
88
  target: protocol_1.PROTOCOL.ProgressFn('task_set_with_passport'),
66
- arguments: [passport, progress, txb.pure(task_address, bcs_1.BCS.ADDRESS), machine, permission],
89
+ arguments: [passport, (0, protocol_1.TXB_OBJECT)(txb, progress), txb.pure(task_address, bcs_1.BCS.ADDRESS), (0, protocol_1.TXB_OBJECT)(txb, machine), (0, protocol_1.TXB_OBJECT)(txb, permission)],
67
90
  });
68
91
  }
69
92
  else {
70
93
  txb.moveCall({
71
94
  target: protocol_1.PROTOCOL.ProgressFn('task_set'),
72
- arguments: [progress, txb.pure(task_address, bcs_1.BCS.ADDRESS), machine, permission],
95
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, progress), txb.pure(task_address, bcs_1.BCS.ADDRESS), (0, protocol_1.TXB_OBJECT)(txb, machine), (0, protocol_1.TXB_OBJECT)(txb, permission)],
73
96
  });
74
97
  }
98
+ return true;
75
99
  }
76
100
  exports.progress_bind_task = progress_bind_task;
77
101
  function progress_set_context_repository(txb, machine, permission, progress, repository, passport) {
102
+ if (!(0, protocol_1.IsValidObjects)([machine, permission, progress]))
103
+ return false;
78
104
  if (passport) {
79
105
  if (repository) {
80
106
  txb.moveCall({
81
107
  target: protocol_1.PROTOCOL.ProgressFn('context_repository_set_with_passport'),
82
- arguments: [passport, progress, repository, machine, permission],
108
+ arguments: [passport, (0, protocol_1.TXB_OBJECT)(txb, progress), (0, protocol_1.TXB_OBJECT)(txb, repository), (0, protocol_1.TXB_OBJECT)(txb, machine), (0, protocol_1.TXB_OBJECT)(txb, permission)],
83
109
  });
84
110
  }
85
111
  else {
86
112
  txb.moveCall({
87
113
  target: protocol_1.PROTOCOL.ProgressFn('context_repository_none_with_passport'),
88
- arguments: [passport, progress, machine, permission],
114
+ arguments: [passport, (0, protocol_1.TXB_OBJECT)(txb, progress), (0, protocol_1.TXB_OBJECT)(txb, machine), (0, protocol_1.TXB_OBJECT)(txb, permission)],
89
115
  });
90
116
  }
91
117
  }
@@ -93,51 +119,69 @@ function progress_set_context_repository(txb, machine, permission, progress, rep
93
119
  if (repository) {
94
120
  txb.moveCall({
95
121
  target: protocol_1.PROTOCOL.ProgressFn('context_repository_set'),
96
- arguments: [progress, repository, machine, permission],
122
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, progress), (0, protocol_1.TXB_OBJECT)(txb, repository), (0, protocol_1.TXB_OBJECT)(txb, machine), (0, protocol_1.TXB_OBJECT)(txb, permission)],
97
123
  });
98
124
  }
99
125
  else {
100
126
  txb.moveCall({
101
127
  target: protocol_1.PROTOCOL.ProgressFn('context_repository_none'),
102
- arguments: [progress, machine, permission],
128
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, progress), (0, protocol_1.TXB_OBJECT)(txb, machine), (0, protocol_1.TXB_OBJECT)(txb, permission)],
103
129
  });
104
130
  }
105
131
  }
132
+ return true;
106
133
  }
107
134
  exports.progress_set_context_repository = progress_set_context_repository;
108
135
  function progress_unhold(txb, machine, permission, progress, next) {
136
+ if (!(0, protocol_1.IsValidObjects)([machine, permission, progress]))
137
+ return false;
138
+ if (!IsValidProgressNext(next))
139
+ return false;
109
140
  txb.moveCall({
110
141
  target: protocol_1.PROTOCOL.ProgressFn('unhold'),
111
- arguments: [progress, machine, txb.pure(next.next_node_name), txb.pure((0, protocol_1.name_data)(next.forward)), permission],
142
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, progress), (0, protocol_1.TXB_OBJECT)(txb, machine), txb.pure(next.next_node_name), txb.pure(next.forward), (0, protocol_1.TXB_OBJECT)(txb, permission)],
112
143
  });
144
+ return true;
113
145
  }
114
146
  exports.progress_unhold = progress_unhold;
147
+ function IsValidProgressNext(next) {
148
+ return (0, protocol_1.IsValidName)(next.forward) && (0, protocol_1.IsValidName)(next.next_node_name);
149
+ }
115
150
  function next(txb, machine, permission, progress, next, deliverables_address, passport) {
116
- let diliverable = txb.pure([], bcs_1.BCS.U8);
117
- if (deliverables_address) {
118
- diliverable = txb.pure(deliverables_address, bcs_1.BCS.ADDRESS);
119
- }
151
+ if (!(0, protocol_1.IsValidObjects)([machine, permission, progress]))
152
+ return false;
153
+ if (!IsValidProgressNext(next))
154
+ return false;
155
+ if (deliverables_address && !(0, protocol_1.IsValidAddress)(deliverables_address))
156
+ return false;
157
+ let diliverable = deliverables_address ? txb.pure(util_1.BCS_CONVERT.ser_option_address(deliverables_address)) : (0, protocol_1.OptionNone)(txb);
120
158
  if (passport) {
121
159
  txb.moveCall({
122
160
  target: protocol_1.PROTOCOL.ProgressFn('run_with_passport'),
123
- arguments: [passport, progress, machine, txb.pure(next.next_node_name),
124
- txb.pure((0, protocol_1.name_data)(next.forward)), diliverable, permission],
161
+ arguments: [passport, (0, protocol_1.TXB_OBJECT)(txb, progress), (0, protocol_1.TXB_OBJECT)(txb, machine), txb.pure(next.next_node_name),
162
+ txb.pure(next.forward), diliverable, (0, protocol_1.TXB_OBJECT)(txb, permission)],
125
163
  });
126
164
  }
127
165
  else {
128
166
  txb.moveCall({
129
167
  target: protocol_1.PROTOCOL.ProgressFn('run'),
130
- arguments: [progress, machine, txb.pure(next.next_node_name),
131
- txb.pure((0, protocol_1.name_data)(next.forward)), diliverable, permission],
168
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, progress), (0, protocol_1.TXB_OBJECT)(txb, machine), txb.pure(next.next_node_name),
169
+ txb.pure(next.forward), diliverable, (0, protocol_1.TXB_OBJECT)(txb, permission)],
132
170
  });
133
171
  }
172
+ return true;
134
173
  }
135
174
  exports.next = next;
136
175
  function hold(txb, machine, permission, progress, next, hold) {
176
+ if (!(0, protocol_1.IsValidObjects)([machine, permission, progress]))
177
+ return false;
178
+ if (!IsValidProgressNext(next))
179
+ return false;
137
180
  txb.moveCall({
138
181
  target: protocol_1.PROTOCOL.ProgressFn('hold'),
139
- arguments: [progress, machine, txb.pure(next.next_node_name),
140
- txb.pure((0, protocol_1.name_data)(next.forward)), txb.pure(hold, bcs_1.BCS.BOOL), permission],
182
+ arguments: [(0, protocol_1.TXB_OBJECT)(txb, progress), (0, protocol_1.TXB_OBJECT)(txb, machine), txb.pure(next.next_node_name),
183
+ txb.pure(next.forward), txb.pure(hold, bcs_1.BCS.BOOL), (0, protocol_1.TXB_OBJECT)(txb, permission)],
141
184
  });
185
+ return true;
142
186
  }
143
187
  exports.hold = hold;