Parse bytes types to a hex buffer (#1731)

* Parse bytes types to a hex buffer

* Revert yarn lock changes
This commit is contained in:
HenryNguyen5 2018-05-11 15:07:51 -04:00 committed by Daniel Ternyak
parent 6c84654172
commit fee8d63088

View File

@ -95,8 +95,12 @@ export default class AbiFunction {
return mapppedType ? mapppedType(value) : BN.isBN(value) ? value.toString() : value; return mapppedType ? mapppedType(value) : BN.isBN(value) ? value.toString() : value;
}; };
private parsePreEncodedValue = (_: string, value: any) => private parsePreEncodedValue = (type: string, value: any) => {
BN.isBN(value) ? value.toString() : value; if (type === 'bytes') {
return Buffer.from(value, 'hex');
}
return BN.isBN(value) ? value.toString() : value;
};
private makeFuncParams = () => private makeFuncParams = () =>
this.inputs.reduce((accumulator, currInput) => { this.inputs.reduce((accumulator, currInput) => {