File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
libs/remix-lib/src/helpers Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11'use strict'
22import { bytesToHex } from '@ethereumjs/util'
33import { isHexString } from 'ethjs-util'
4+ import { BN } from 'bn.js'
5+ import { isBigInt } from 'web3-validator'
46
57function 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 ,
You can’t perform that action at this time.
0 commit comments