@@ -228,63 +228,13 @@ contract STGetter is OZStorage, SecurityTokenStorage {
228
228
229
229
/**
230
230
* @notice Return all partitions
231
- * @param _tokenHolder Whom balance need to queried
232
231
* @return List of partitions
233
232
*/
234
- function partitionsOf (address _tokenHolder ) external view returns (bytes32 [] memory ) {
235
- address [] memory tms = modules[TRANSFER_KEY];
236
- /* uint256 count; */
237
- bytes32 [] memory partitions;
238
- bytes32 [] memory tmPartitions;
239
- // First determine the total number of non-distinct partitions
240
- for (uint256 i = 0 ; i < tms.length ; i++ ) {
241
- tmPartitions = ITransferManager (tms[i]).getPartitions (_tokenHolder);
242
- for (uint256 j = 0 ; j < tmPartitions.length ; j++ ) {
243
- partitions = _appendPartition (partitions, tmPartitions[j]);
244
- }
245
- }
246
- partitions = _appendPartition (partitions, "DEFAULT " );
247
- /* bytes32[] memory partitions = new bytes32[](count + 1);
248
- count = 0;
249
- for (uint256 i = 0; i < tms.length; i++) {
250
- tmPartitions = ITransferManager(tms[i]).getPartitions(_tokenHolder);
251
- for (uint256 j = 0; j < tmPartitions.length; j++) {
252
- partitions[count + j] = tmPartitions[j];
253
- }
254
- count += tmPartitions.length;
255
- }
256
- partitions[count] = "DEFAULT";
257
- uint256[] memory index = new uint256[](count);
258
- count = 0;
259
- for (uint256 i = 0; i < partitions.length; i++) {
260
- for (uint256 j = 0; j < partitions.length; j++) {
261
- if (partitions[i] == partitions[j]) {
262
- index[i] = j;
263
- }
264
- }
265
- }
266
- // Create distinct list
267
- bytes32[] memory result */
268
- return partitions;
269
- }
270
-
271
- function _appendPartition (bytes32 [] memory partitions , bytes32 partition ) internal pure returns (bytes32 [] memory ) {
272
- bool duplicate = false ;
273
- for (uint256 i = 0 ; i < partitions.length ; i++ ) {
274
- if (partition == partitions[i]) {
275
- duplicate = true ;
276
- break ;
277
- }
278
- }
279
- if (duplicate) {
280
- bytes32 [] memory result = new bytes32 [](1 + partitions.length );
281
- for (uint256 i = 0 ; i < partitions.length ; i++ ) {
282
- result[i] = partitions[i];
283
- }
284
- result[partitions.length ] = partition;
285
- return result;
286
- }
287
- return partitions;
233
+ function partitionsOf (address /*_tokenHolder*/ ) external view returns (bytes32 [] memory ) {
234
+ bytes32 [] memory result = new bytes32 [](2 );
235
+ result[0 ] = UNLOCKED;
236
+ result[1 ] = LOCKED;
237
+ return result;
288
238
}
289
239
290
240
/**
@@ -307,9 +257,9 @@ contract STGetter is OZStorage, SecurityTokenStorage {
307
257
*/
308
258
function getDocument (bytes32 _name ) external view returns (string memory , bytes32 , uint256 ) {
309
259
return (
310
- _documents[_name].uri,
311
- _documents[_name].docHash,
312
- _documents[_name].lastModified
260
+ _documents[_name].uri,
261
+ _documents[_name].docHash,
262
+ _documents[_name].lastModified
313
263
);
314
264
}
315
265
0 commit comments