@ -530,6 +530,7 @@ export class Blockchain extends Plugin {
if ( this . transactionContextAPI . getAddress ) {
if ( this . transactionContextAPI . getAddress ) {
return this . transactionContextAPI . getAddress ( function ( err , address ) {
return this . transactionContextAPI . getAddress ( function ( err , address ) {
if ( err ) return reject ( err )
if ( err ) return reject ( err )
if ( ! address ) return reject ( '"from" is not defined. Please make sure an account is selected. If you are using a public node, it is likely that no account will be provided. In that case, add the public node to your injected provider (type Metamask) and use injected provider in Remix.' )
return resolve ( address )
return resolve ( address )
} )
} )
}
}
@ -548,9 +549,18 @@ export class Blockchain extends Plugin {
const runTransaction = async ( ) => {
const runTransaction = async ( ) => {
// eslint-disable-next-line no-async-promise-executor
// eslint-disable-next-line no-async-promise-executor
return new Promise ( async ( resolve , reject ) => {
return new Promise ( async ( resolve , reject ) => {
const fromAddress = await getAccount ( )
let fromAddress
const value = await queryValue ( )
let value
const gasLimit = await getGasLimit ( )
let gasLimit
try {
fromAddress = await getAccount ( )
value = await queryValue ( )
gasLimit = await getGasLimit ( )
} catch ( e ) {
reject ( e )
return
}
const tx = { to : args . to , data : args . data . dataHex , useCall : args . useCall , from : fromAddress , value : value , gasLimit : gasLimit , timestamp : args . data . timestamp }
const tx = { to : args . to , data : args . data . dataHex , useCall : args . useCall , from : fromAddress , value : value , gasLimit : gasLimit , timestamp : args . data . timestamp }
const payLoad = { funAbi : args . data . funAbi , funArgs : args . data . funArgs , contractBytecode : args . data . contractBytecode , contractName : args . data . contractName , contractABI : args . data . contractABI , linkReferences : args . data . linkReferences }
const payLoad = { funAbi : args . data . funAbi , funArgs : args . data . funArgs , contractBytecode : args . data . contractBytecode , contractName : args . data . contractName , contractABI : args . data . contractABI , linkReferences : args . data . linkReferences }