File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed
apps/remix-ide/src/blockchain
libs/remix-lib/src/execution Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ class Blockchain {
2323 detectNetwork : ( cb ) => {
2424 this . executionContext . detectNetwork ( cb )
2525 } ,
26+ isVM : ( ) => { return this . executionContext . isVM ( ) } ,
2627 personalMode : ( ) => {
2728 return this . getProvider ( ) === 'web3' ? this . config . get ( 'settings/personal-mode' ) : false
2829 }
@@ -322,6 +323,7 @@ class Blockchain {
322323 detectNetwork : ( cb ) => {
323324 this . executionContext . detectNetwork ( cb )
324325 } ,
326+ isVM : ( ) => { return this . executionContext . isVM ( ) } ,
325327 personalMode : ( ) => {
326328 return this . getProvider ( ) === 'web3' ? this . config . get ( 'settings/personal-mode' ) : false
327329 }
Original file line number Diff line number Diff line change @@ -73,23 +73,13 @@ export class TxRunnerWeb3 {
7373
7474 if ( useCall ) {
7575 tx [ 'gas' ] = gasLimit
76- tx [ 'timestamp' ] = timestamp
77- return this . _api . detectNetwork ( ( err , network ) => {
78- if ( err ) {
79- console . log ( err )
80- return
81- // Remove `timestamp` from tx if network is Kovan
82- // It shows: 'Error: Returned error: Invalid params: unknown field `timestamp`'
83- // See: https://github.com/ethereum/remix-project/issues/1282
84- } else if ( network && network . name === 'Kovan' ) delete tx [ 'timestamp' ]
85-
76+ if ( this . _api && this . _api . isVM ( ) ) tx [ 'timestamp' ] = timestamp
8677 return this . getWeb3 ( ) . eth . call ( tx , function ( error , result : any ) {
8778 if ( error ) return callback ( error )
8879 callback ( null , {
8980 result : result
9081 } )
9182 } )
92- } )
9383 }
9484 this . getWeb3 ( ) . eth . estimateGas ( tx , ( err , gasEstimation ) => {
9585 if ( err && err . message . indexOf ( 'Invalid JSON RPC response' ) !== - 1 ) {
You can’t perform that action at this time.
0 commit comments