Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function call fixed #2577

Merged
merged 3 commits into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/app/ui/sendTxCallbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ const typeConversion = remixLib.execution.typeConversion
const Web3 = require('web3')

module.exports = {
getCallBacksWithContext: (udapp, executionContext) => {
getCallBacksWithContext: (udappUI, executionContext) => {
let callbacks = {}
callbacks.confirmationCb = confirmationCb
callbacks.continueCb = continueCb
callbacks.promptCb = promptCb
callbacks.udapp = udapp
callbacks.udappUI = udappUI
callbacks.executionContext = executionContext
return callbacks
}
}

const continueCb = (error, continueTxExecution, cancelCb) => {
const continueCb = function (error, continueTxExecution, cancelCb) {
if (error) {
const msg = typeof error !== 'string' ? error.message : error
modalDialog(
Expand All @@ -41,17 +41,17 @@ const continueCb = (error, continueTxExecution, cancelCb) => {
}
}

const promptCb = (okCb, cancelCb) => {
const promptCb = function (okCb, cancelCb) {
modalCustom.promptPassphrase('Passphrase requested', 'Personal mode is enabled. Please provide passphrase of account', '', okCb, cancelCb)
}

const confirmationCb = (network, tx, gasEstimation, continueTxExecution, cancelCb) => {
const confirmationCb = function (network, tx, gasEstimation, continueTxExecution, cancelCb) {
let self = this
if (network.name !== 'Main') {
return continueTxExecution(null)
}
var amount = Web3.utils.fromWei(typeConversion.toInt(tx.value), 'ether')
var content = confirmDialog(tx, amount, gasEstimation, self.udapp,
var content = confirmDialog(tx, amount, gasEstimation, self.udappUI,
(gasPrice, cb) => {
let txFeeText, priceStatus
// TODO: this try catch feels like an anti pattern, can/should be
Expand Down Expand Up @@ -86,7 +86,7 @@ const confirmationCb = (network, tx, gasEstimation, continueTxExecution, cancelC
content,
{ label: 'Confirm',
fn: () => {
self.udapp.config.setUnpersistedProperty(
self.udappUI.udapp.config.setUnpersistedProperty(
'doNotShowTransactionConfirmationAgain',
content.querySelector('input#confirmsetting').checked
)
Expand Down
4 changes: 2 additions & 2 deletions src/app/ui/universal-dapp-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ UniversalDAppUI.prototype.runTransaction = function (lookupOnly, args, valArr, i
self.logCallback(`${logMsg}`)
}
if (args.funABI.type === 'fallback') data.dataHex = value
self.udapp.callFunction(args.address, data, args.funABI, callbacksInContext.confirmationCb, callbacksInContext.continueCb, callbacksInContext.promptCb, (error, txResult) => {
self.udapp.callFunction(args.address, data, args.funABI, callbacksInContext.confirmationCb.bind(callbacksInContext), callbacksInContext.continueCb.bind(callbacksInContext), callbacksInContext.promptCb.bind(callbacksInContext), (error, txResult) => {
if (!error) {
var isVM = self.executionContext.isVM()
if (isVM) {
Expand All @@ -278,7 +278,7 @@ UniversalDAppUI.prototype.runTransaction = function (lookupOnly, args, valArr, i
self.logCallback(msg)
}, (data, runTxCallback) => {
// called for libraries deployment
self.udapp.runTx(data, callbacksInContext.confirmationCb, runTxCallback)
self.udapp.runTx(data, callbacksInContext.confirmationCb.bind(callbacksInContext), runTxCallback)
})
}

Expand Down