mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-25 17:25:25 +00:00
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 abi from 'ethereumjs-abi';
|
||||||
import { toChecksumAddress, addHexPrefix } from 'ethereumjs-util';
|
import { toChecksumAddress, addHexPrefix, stripHexPrefix } from 'ethereumjs-util';
|
||||||
import BN from 'bn.js';
|
import BN from 'bn.js';
|
||||||
import {
|
import {
|
||||||
FuncParams,
|
FuncParams,
|
||||||
@ -97,7 +97,7 @@ export default class AbiFunction {
|
|||||||
|
|
||||||
private parsePreEncodedValue = (type: string, value: any) => {
|
private parsePreEncodedValue = (type: string, value: any) => {
|
||||||
if (type === 'bytes') {
|
if (type === 'bytes') {
|
||||||
return Buffer.from(value, 'hex');
|
return Buffer.from(stripHexPrefix(value), 'hex');
|
||||||
}
|
}
|
||||||
return BN.isBN(value) ? value.toString() : value;
|
return BN.isBN(value) ? value.toString() : value;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user