Skip to content

Commit 0eb0711

Browse files
committed
fix parsing int
1 parent 498a6db commit 0eb0711

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

libs/remix-lib/src/helpers/txResultHelper.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict'
22
import { bytesToHex } from '@ethereumjs/util'
33
import { isHexString } from 'ethjs-util'
4+
import { BN } from 'bn.js'
5+
import { isBigInt } from 'web3-validator'
46

57
function convertToPrefixedHex (input) {
68
if (input === undefined || input === null || isHexString(input)) {
@@ -9,6 +11,9 @@ function convertToPrefixedHex (input) {
911
if (typeof input === 'number') {
1012
return '0x' + input.toString(16)
1113
}
14+
if ((input.constructor && input.constructor.name === 'BigNumber') || BN.isBN(input) || isBigInt(input)) {
15+
return '0x' + input.toString(16)
16+
}
1217

1318
try {
1419
return bytesToHex(input)
@@ -47,10 +52,9 @@ export function resultToRemixTx (txResult, execResult?) {
4752
errorMessage = execResult.exceptionError
4853
}
4954

50-
console.log('resultToRemixTx', gasUsed, convertToPrefixedHex(gasUsed))
5155
return {
5256
transactionHash,
53-
status,
57+
status: convertToPrefixedHex(status),
5458
gasUsed: convertToPrefixedHex(gasUsed),
5559
error: errorMessage,
5660
return: returnValue ? convertToPrefixedHex(returnValue) : undefined,

0 commit comments

Comments
 (0)