Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
3b1d055b
Commit
3b1d055b
authored
Mar 28, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use txRunner instead of udapp
parent
e969f57f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
13 deletions
+31
-13
txExecution.js
remix-lib/src/execution/txExecution.js
+31
-13
No files found.
remix-lib/src/execution/txExecution.js
View file @
3b1d055b
...
...
@@ -4,30 +4,48 @@ module.exports = {
/**
* deploy the given contract
*
* @param {String} from - sender address
* @param {String} data - data to send with the transaction ( return of txFormat.buildData(...) ).
* @param {Object} udapp - udapp.
* @param {Function} callback - callback.
* @param {String} value - decimal representation of value.
* @param {String} gasLimit - decimal representation of gas limit.
* @param {Object} txRunner - TxRunner.js instance
* @param {Object} callbacks - { confirmationCb, gasEstimationForceSend, promptCb }
* [validate transaction] confirmationCb (network, tx, gasEstimation, continueTxExecution, cancelCb)
* [transaction failed, force send] gasEstimationForceSend (error, continueTxExecution, cancelCb)
* [personal mode enabled, need password to continue] promptCb (okCb, cancelCb)
* @param {Function} finalCallback - last callback.
*/
createContract
:
function
(
data
,
udapp
,
callback
)
{
udapp
.
runTx
({
data
:
data
,
useCall
:
false
},
(
error
,
txResult
)
=>
{
createContract
:
function
(
from
,
data
,
value
,
gasLimit
,
txRunner
,
callbacks
,
finalCallback
)
{
if
(
!
callbacks
.
confirmationCb
||
!
callbacks
.
gasEstimationForceSend
||
!
callbacks
.
promptCb
)
{
return
finalCallback
(
'all the callbacks must have been defined'
)
}
var
tx
=
{
from
:
from
,
to
:
null
,
data
:
data
,
useCall
:
false
,
value
:
value
,
gasLimit
:
gasLimit
}
txRunner
.
rawRun
(
tx
,
callbacks
.
confirmationCb
,
callbacks
.
gasEstimationForceSend
,
callbacks
.
promptCb
,
(
error
,
txResult
)
=>
{
// see universaldapp.js line 660 => 700 to check possible values of txResult (error case)
c
allback
(
error
,
txResult
)
finalC
allback
(
error
,
txResult
)
})
},
/**
* call the current given contract
* call the current given contract
! that will create a transaction !
*
* @param {String} to - address of the contract to call.
* @param {String} from - sender address
* @param {String} to - recipient address
* @param {String} data - data to send with the transaction ( return of txFormat.buildData(...) ).
* @param {Object} funAbi - abi definition of the function to call.
* @param {Object} udapp - udapp.
* @param {Function} callback - callback.
* @param {String} value - decimal representation of value.
* @param {String} gasLimit - decimal representation of gas limit.
* @param {Object} txRunner - TxRunner.js instance
* @param {Object} callbacks - { confirmationCb, gasEstimationForceSend, promptCb }
* [validate transaction] confirmationCb (network, tx, gasEstimation, continueTxExecution, cancelCb)
* [transaction failed, force send] gasEstimationForceSend (error, continueTxExecution, cancelCb)
* [personal mode enabled, need password to continue] promptCb (okCb, cancelCb)
* @param {Function} finalCallback - last callback.
*/
callFunction
:
function
(
to
,
data
,
funAbi
,
udapp
,
callback
)
{
udapp
.
runTx
({
to
:
to
,
data
:
data
,
useCall
:
funAbi
.
constant
},
(
error
,
txResult
)
=>
{
callFunction
:
function
(
from
,
to
,
data
,
value
,
gasLimit
,
funAbi
,
txRunner
,
callbacks
,
finalCallback
)
{
var
tx
=
{
from
:
from
,
to
:
to
,
data
:
data
,
useCall
:
false
,
value
:
value
,
gasLimit
:
gasLimit
}
txRunner
.
rawRun
(
tx
,
callbacks
.
confirmationCb
,
callbacks
.
gasEstimationForceSend
,
callbacks
.
promptCb
,
(
error
,
txResult
)
=>
{
// see universaldapp.js line 660 => 700 to check possible values of txResult (error case)
c
allback
(
error
,
txResult
)
finalC
allback
(
error
,
txResult
)
})
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment