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
ca831ee6
Commit
ca831ee6
authored
Feb 06, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial logical separation between the UI and the logic of the universal-dapp
parent
99c82922
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
universal-dapp.js
src/universal-dapp.js
+8
-8
No files found.
src/universal-dapp.js
View file @
ca831ee6
...
...
@@ -16,7 +16,7 @@ var modalCustom = require('./app/ui/modal-dialog-custom')
/*
trigger debugRequested
*/
function
UniversalDApp
(
opts
=
{})
{
function
UniversalDApp
Model
(
opts
=
{})
{
this
.
event
=
new
EventManager
()
var
self
=
this
...
...
@@ -29,7 +29,7 @@ function UniversalDApp (opts = {}) {
self
.
txRunner
=
new
TxRunner
({},
opts
.
api
)
}
UniversalDApp
.
prototype
.
reset
=
function
(
contracts
,
transactionContextAPI
)
{
UniversalDApp
Model
.
prototype
.
reset
=
function
(
contracts
,
transactionContextAPI
)
{
this
.
contracts
=
contracts
if
(
transactionContextAPI
)
{
this
.
transactionContextAPI
=
transactionContextAPI
...
...
@@ -46,7 +46,7 @@ UniversalDApp.prototype.reset = function (contracts, transactionContextAPI) {
this
.
txRunner
=
new
TxRunner
(
this
.
accounts
,
this
.
_api
)
}
UniversalDApp
.
prototype
.
newAccount
=
function
(
password
,
cb
)
{
UniversalDApp
Model
.
prototype
.
newAccount
=
function
(
password
,
cb
)
{
if
(
!
executionContext
.
isVM
())
{
if
(
!
this
.
_api
.
personalMode
())
{
return
cb
(
'Not running in personal mode'
)
...
...
@@ -68,7 +68,7 @@ UniversalDApp.prototype.newAccount = function (password, cb) {
}
}
UniversalDApp
.
prototype
.
_addAccount
=
function
(
privateKey
,
balance
)
{
UniversalDApp
Model
.
prototype
.
_addAccount
=
function
(
privateKey
,
balance
)
{
var
self
=
this
if
(
!
executionContext
.
isVM
())
{
...
...
@@ -85,7 +85,7 @@ UniversalDApp.prototype._addAccount = function (privateKey, balance) {
}
}
UniversalDApp
.
prototype
.
getAccounts
=
function
(
cb
)
{
UniversalDApp
Model
.
prototype
.
getAccounts
=
function
(
cb
)
{
var
self
=
this
if
(
!
executionContext
.
isVM
())
{
...
...
@@ -105,7 +105,7 @@ UniversalDApp.prototype.getAccounts = function (cb) {
}
}
UniversalDApp
.
prototype
.
getBalance
=
function
(
address
,
cb
)
{
UniversalDApp
Model
.
prototype
.
getBalance
=
function
(
address
,
cb
)
{
var
self
=
this
address
=
ethJSUtil
.
stripHexPrefix
(
address
)
...
...
@@ -211,7 +211,7 @@ function execute (pipeline, env, callback) {
next
(
null
,
env
)
}
UniversalDApp
.
prototype
.
runTx
=
function
(
args
,
cb
)
{
UniversalDApp
Model
.
prototype
.
runTx
=
function
(
args
,
cb
)
{
var
self
=
this
var
tx
=
{
to
:
args
.
to
,
data
:
args
.
data
.
dataHex
,
useCall
:
args
.
useCall
,
from
:
args
.
from
,
value
:
args
.
value
}
var
payLoad
=
{
funAbi
:
args
.
data
.
funAbi
,
funArgs
:
args
.
data
.
funArgs
,
contractBytecode
:
args
.
data
.
contractBytecode
,
contractName
:
args
.
data
.
contractName
}
// contains decoded parameters
...
...
@@ -296,4 +296,4 @@ function runTransaction (env, next) {
})
}
module
.
exports
=
UniversalDApp
module
.
exports
=
UniversalDApp
Model
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