From a40b7cecb8f259db7261364109bf0662a7c3d7af Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Wed, 22 Jan 2020 17:12:19 +0100 Subject: [PATCH 1/2] added sendRawTransaction --- remix-lib/src/universalDapp.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/remix-lib/src/universalDapp.js b/remix-lib/src/universalDapp.js index 06d0a5a22..17746308a 100644 --- a/remix-lib/src/universalDapp.js +++ b/remix-lib/src/universalDapp.js @@ -241,6 +241,20 @@ module.exports = class UniversalDApp { }) } + /** + * call the current given contract + * + * @param {String} to - address of the contract to call. + * @param {String} data - data to send with the transaction ( return of txFormat.buildData(...) ). + * @param {Function} callback - callback. + */ + callFunction (to, data, confirmationCb, continueCb, promptCb, callback) { + this.runTx({to, data, useCall: null}, confirmationCb, continueCb, promptCb, (error, txResult) => { + // see universaldapp.js line 660 => 700 to check possible values of txResult (error case) + callback(error, txResult) + }) + } + context () { return (this.executionContext.isVM() ? 'memory' : 'blockchain') } From 15b06fc7532abed84aa83884e9eaaa5fa7dc42e0 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Wed, 22 Jan 2020 17:17:56 +0100 Subject: [PATCH 2/2] Update universalDapp.js --- remix-lib/src/universalDapp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remix-lib/src/universalDapp.js b/remix-lib/src/universalDapp.js index 17746308a..9ce969803 100644 --- a/remix-lib/src/universalDapp.js +++ b/remix-lib/src/universalDapp.js @@ -248,8 +248,8 @@ module.exports = class UniversalDApp { * @param {String} data - data to send with the transaction ( return of txFormat.buildData(...) ). * @param {Function} callback - callback. */ - callFunction (to, data, confirmationCb, continueCb, promptCb, callback) { - this.runTx({to, data, useCall: null}, confirmationCb, continueCb, promptCb, (error, txResult) => { + sendRawTransaction (to, data, confirmationCb, continueCb, promptCb, callback) { + this.runTx({to, data, useCall: false}, confirmationCb, continueCb, promptCb, (error, txResult) => { // see universaldapp.js line 660 => 700 to check possible values of txResult (error case) callback(error, txResult) })