mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-09 10:41:56 +00:00
Strip hex prefix for bytes inputs (#1811)
This commit is contained in:
parent
54f3adb86e
commit
d5013b8810
@ -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…
x
Reference in New Issue
Block a user