Skip to content
This repository was archived by the owner on Jul 6, 2022. It is now read-only.

Commit 9902efa

Browse files
author
Victor Wiebe
committed
fix: partitionsOf needs to return an array of Partitions
1 parent 3355cc4 commit 9902efa

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/contract_wrappers/tokens/__tests__/security_token_wrapper.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ describe('SecurityTokenWrapper', () => {
148148

149149
describe('partitionsOf', () => {
150150
test('should call to partitionsOf', async () => {
151-
const expectedResult = stringArrayToBytes32Array(['LOCKED', 'UNLOCKED']);
151+
const expectedResult = stringArrayToBytes32Array(['UNDEFINED', 'UNLOCKED']);
152152
const mockedParams = {
153153
partition: 'UNLOCKED',
154154
operator: '0x5555555555555555555555555555555555555555',

src/contract_wrappers/tokens/security_token_wrapper.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,9 @@ interface GetSecurityTokenLogsAsyncParams extends GetLogs {
418418
(params: GetModuleAddedLogsAsyncParams): Promise<LogWithDecodedArgs<SecurityTokenModuleAddedEventArgs>[]>;
419419
(params: GetModuleUpgradedLogsAsyncParams): Promise<LogWithDecodedArgs<SecurityTokenModuleUpgradedEventArgs>[]>;
420420
(params: GetUpdateTokenDetailsLogsAsyncParams): Promise<
421-
LogWithDecodedArgs<SecurityTokenUpdateTokenDetailsEventArgs>[]
422-
>;
423-
(params: GetUpdateTokenNameLogsAsyncParams): Promise<
424-
LogWithDecodedArgs<SecurityTokenUpdateTokenNameEventArgs>[]
425-
>;
421+
LogWithDecodedArgs<SecurityTokenUpdateTokenDetailsEventArgs>[]
422+
>;
423+
(params: GetUpdateTokenNameLogsAsyncParams): Promise<LogWithDecodedArgs<SecurityTokenUpdateTokenNameEventArgs>[]>;
426424
(params: GetGranularityChangedLogsAsyncParams): Promise<
427425
LogWithDecodedArgs<SecurityTokenGranularityChangedEventArgs>[]
428426
>;
@@ -912,9 +910,11 @@ export default class SecurityTokenWrapper extends ERC20TokenWrapper {
912910
);
913911
};
914912

915-
public partitionsOf = async (params: PartitionsOfParams): Promise<string[]> => {
913+
public partitionsOf = async (params: PartitionsOfParams): Promise<Partition[]> => {
916914
const partitions = await (await this.contract).partitionsOf.callAsync(params.tokenHolder);
917-
return bytes32ArrayToStringArray(partitions);
915+
return bytes32ArrayToStringArray(partitions).map(element => {
916+
return element === Partition.Unlocked ? Partition.Unlocked : Partition.Undefined;
917+
});
918918
};
919919

920920
/**

0 commit comments

Comments
 (0)