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
477430e6
Commit
477430e6
authored
Jun 03, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move BN define to the proper place in udapp
parent
3e0cd141
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
universal-dapp.js
src/universal-dapp.js
+3
-3
No files found.
src/universal-dapp.js
View file @
477430e6
...
@@ -4,6 +4,7 @@ var ethJSUtil = require('ethereumjs-util');
...
@@ -4,6 +4,7 @@ var ethJSUtil = require('ethereumjs-util');
var
EthJSTX
=
require
(
'ethereumjs-tx'
);
var
EthJSTX
=
require
(
'ethereumjs-tx'
);
var
ethJSABI
=
require
(
'ethereumjs-abi'
);
var
ethJSABI
=
require
(
'ethereumjs-abi'
);
var
EthJSBlock
=
require
(
'ethereumjs-block'
);
var
EthJSBlock
=
require
(
'ethereumjs-block'
);
var
BN
=
ethJSUtil
.
BN
;
function
UniversalDApp
(
contracts
,
options
)
{
function
UniversalDApp
(
contracts
,
options
)
{
this
.
options
=
options
||
{};
this
.
options
=
options
||
{};
...
@@ -22,7 +23,6 @@ function UniversalDApp (contracts, options) {
...
@@ -22,7 +23,6 @@ function UniversalDApp (contracts, options) {
this
.
accounts
=
{};
this
.
accounts
=
{};
this
.
BN
=
ethJSUtil
.
BN
;
this
.
vm
=
new
EthJSVM
(
null
,
null
,
{
activatePrecompiles
:
true
});
this
.
vm
=
new
EthJSVM
(
null
,
null
,
{
activatePrecompiles
:
true
});
this
.
addAccount
(
'3cd7232cd6f3fc66a57a6bedc1a8ed6c228fff0a327e169c2bcc5e869ed49511'
);
this
.
addAccount
(
'3cd7232cd6f3fc66a57a6bedc1a8ed6c228fff0a327e169c2bcc5e869ed49511'
);
...
@@ -76,7 +76,7 @@ UniversalDApp.prototype.getBalance = function (address, cb) {
...
@@ -76,7 +76,7 @@ UniversalDApp.prototype.getBalance = function (address, cb) {
if
(
err
)
{
if
(
err
)
{
cb
(
'Account not found'
);
cb
(
'Account not found'
);
}
else
{
}
else
{
cb
(
null
,
new
ethJSUtil
.
BN
(
res
).
toString
(
10
));
cb
(
null
,
new
BN
(
res
).
toString
(
10
));
}
}
});
});
}
}
...
@@ -637,7 +637,7 @@ UniversalDApp.prototype.runTx = function (data, args, cb) {
...
@@ -637,7 +637,7 @@ UniversalDApp.prototype.runTx = function (data, args, cb) {
gasPrice
:
1
,
gasPrice
:
1
,
gasLimit
:
3000000000
,
// plenty
gasLimit
:
3000000000
,
// plenty
to
:
to
,
to
:
to
,
value
:
new
this
.
BN
(
value
,
10
),
value
:
new
BN
(
value
,
10
),
data
:
new
Buffer
(
data
.
slice
(
2
),
'hex'
)
data
:
new
Buffer
(
data
.
slice
(
2
),
'hex'
)
});
});
tx
.
sign
(
account
.
privateKey
);
tx
.
sign
(
account
.
privateKey
);
...
...
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