Strip hex prefix for bytes inputs (#1811)
This commit is contained in:
parent
5c01fb12c7
commit
352473ac9f
|
@ -1,5 +1,5 @@
|
|||
import abi from 'ethereumjs-abi';
|
||||
import { toChecksumAddress, addHexPrefix } from 'ethereumjs-util';
|
||||
import { toChecksumAddress, addHexPrefix, stripHexPrefix } from 'ethereumjs-util';
|
||||
import BN from 'bn.js';
|
||||
import {
|
||||
FuncParams,
|
||||
|
@ -97,7 +97,7 @@ export default class AbiFunction {
|
|||
|
||||
private parsePreEncodedValue = (type: string, value: any) => {
|
||||
if (type === 'bytes') {
|
||||
return Buffer.from(value, 'hex');
|
||||
return Buffer.from(stripHexPrefix(value), 'hex');
|
||||
}
|
||||
return BN.isBN(value) ? value.toString() : value;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue