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

Commit

Permalink
Merge pull request #241 from PolymathNetwork/fix/delegate-details
Browse files Browse the repository at this point in the history
fix: 🐛 Delegate details return type
  • Loading branch information
VictorVicente committed Nov 7, 2019
2 parents 96dcfc6 + 6668d85 commit 0ec067e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Expand Up @@ -123,7 +123,7 @@ describe('GeneralPermissionManagerWrapper', () => {
// Stub the method
when(mockedContract.delegateDetails).thenReturn(instance(mockedMethod));
// Stub the request
when(mockedMethod.callAsync(params.delegate)).thenResolve(expectedResult);
when(mockedMethod.callAsync(params.delegate)).thenResolve(stringToBytes32(expectedResult));

// Real call
const result = await target.delegateDetails(params);
Expand Down
Expand Up @@ -137,7 +137,7 @@ describe('GeneralPermissionManagerWrapper', () => {
// Stub the method
when(mockedContract.delegateDetails).thenReturn(instance(mockedMethod));
// Stub the request
when(mockedMethod.callAsync(params.delegate)).thenResolve(expectedResult);
when(mockedMethod.callAsync(params.delegate)).thenResolve(stringToBytes32(expectedResult));

// Real call
const result = await target.delegateDetails(params);
Expand Down
Expand Up @@ -31,6 +31,7 @@ import {
stringToBytes32,
stringArrayToBytes32Array,
parsePermBytes32Value,
bytes32ToString,
} from '../../../../utils/convert';
import ContractWrapper from '../../../contract_wrapper';

Expand Down Expand Up @@ -223,7 +224,8 @@ export default abstract class GeneralPermissionManagerCommon extends ModuleCommo
*/
public delegateDetails = async (params: DelegateParams): Promise<string> => {
assert.isETHAddressHex('delegate', params.delegate);
return (await this.contract).delegateDetails.callAsync(params.delegate);
const delegateDetails = await (await this.contract).delegateDetails.callAsync(params.delegate);
return bytes32ToString(delegateDetails);
};

/**
Expand Down

0 comments on commit 0ec067e

Please sign in to comment.