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
a562a413
Commit
a562a413
authored
Jul 15, 2019
by
Grandschtroumpf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch back to node 10
parent
f0ab3ee9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
config.yml
.circleci/config.yml
+7
-7
universalDapp.js
remix-lib/src/universalDapp.js
+7
-8
No files found.
.circleci/config.yml
View file @
a562a413
...
@@ -6,7 +6,7 @@ version: 2
...
@@ -6,7 +6,7 @@ version: 2
jobs
:
jobs
:
remix-lib
:
remix-lib
:
docker
:
docker
:
-
image
:
circleci/node:1
2
-
image
:
circleci/node:1
0
environment
:
environment
:
working_directory
:
~/repo
working_directory
:
~/repo
steps
:
steps
:
...
@@ -16,7 +16,7 @@ jobs:
...
@@ -16,7 +16,7 @@ jobs:
remix-debug
:
remix-debug
:
docker
:
docker
:
-
image
:
circleci/node:1
2
-
image
:
circleci/node:1
0
environment
:
environment
:
working_directory
:
~/repo
working_directory
:
~/repo
steps
:
steps
:
...
@@ -26,7 +26,7 @@ jobs:
...
@@ -26,7 +26,7 @@ jobs:
remix-analyzer
:
remix-analyzer
:
docker
:
docker
:
-
image
:
circleci/node:1
2
-
image
:
circleci/node:1
0
environment
:
environment
:
working_directory
:
~/repo
working_directory
:
~/repo
steps
:
steps
:
...
@@ -36,7 +36,7 @@ jobs:
...
@@ -36,7 +36,7 @@ jobs:
remix-tests
:
remix-tests
:
docker
:
docker
:
-
image
:
circleci/node:1
2
-
image
:
circleci/node:1
0
environment
:
environment
:
working_directory
:
~/repo
working_directory
:
~/repo
steps
:
steps
:
...
@@ -46,7 +46,7 @@ jobs:
...
@@ -46,7 +46,7 @@ jobs:
remix-astwalker
:
remix-astwalker
:
docker
:
docker
:
-
image
:
circleci/node:1
2
-
image
:
circleci/node:1
0
environment
:
environment
:
working_directory
:
~/repo
working_directory
:
~/repo
steps
:
steps
:
...
@@ -56,7 +56,7 @@ jobs:
...
@@ -56,7 +56,7 @@ jobs:
remix-simulator
:
remix-simulator
:
docker
:
docker
:
-
image
:
circleci/node:1
2
-
image
:
circleci/node:1
0
environment
:
environment
:
working_directory
:
~/repo
working_directory
:
~/repo
steps
:
steps
:
...
@@ -66,7 +66,7 @@ jobs:
...
@@ -66,7 +66,7 @@ jobs:
remix-url-resolver
:
remix-url-resolver
:
docker
:
docker
:
-
image
:
circleci/node:1
2
-
image
:
circleci/node:1
0
environment
:
environment
:
working_directory
:
~/repo
working_directory
:
~/repo
steps
:
steps
:
...
...
remix-lib/src/universalDapp.js
View file @
a562a413
const
async
=
require
(
'async'
)
const
async
=
require
(
'async'
)
const
ethJSUtil
=
require
(
'ethereumjs-util'
)
const
{
BN
,
privateToAddress
,
isValidPrivate
,
stripHexPrefix
}
=
require
(
'ethereumjs-util'
)
const
{
BN
,
privateToAddress
,
isValidPrivate
,
stripHexPrefix
}
=
ethJSUtil
const
crypto
=
require
(
'crypto'
)
const
crypto
=
require
(
'crypto'
)
import
{
EventEmitter
}
from
'events'
;
const
{
EventEmitter
}
=
require
(
'events'
)
;
const
TxRunner
=
require
(
'./execution/txRunner'
)
const
TxRunner
=
require
(
'./execution/txRunner'
)
const
txHelper
=
require
(
'./execution/txHelper'
)
const
txHelper
=
require
(
'./execution/txHelper'
)
...
@@ -81,7 +80,7 @@ module.exports = class UniversalDApp {
...
@@ -81,7 +80,7 @@ module.exports = class UniversalDApp {
}
}
this
.
_addAccount
(
privateKey
,
balance
)
this
.
_addAccount
(
privateKey
,
balance
)
const
privKey
=
Buffer
.
from
(
privateKey
,
'hex'
)
const
privKey
=
Buffer
.
from
(
privateKey
,
'hex'
)
return
'0x'
+
ethJSUtil
.
privateToAddress
(
privKey
).
toString
(
'hex'
)
return
'0x'
+
privateToAddress
(
privKey
).
toString
(
'hex'
)
}
}
newAccount
(
password
,
passwordPromptCb
,
cb
)
{
newAccount
(
password
,
passwordPromptCb
,
cb
)
{
...
@@ -96,9 +95,9 @@ module.exports = class UniversalDApp {
...
@@ -96,9 +95,9 @@ module.exports = class UniversalDApp {
let
privateKey
let
privateKey
do
{
do
{
privateKey
=
crypto
.
randomBytes
(
32
)
privateKey
=
crypto
.
randomBytes
(
32
)
}
while
(
!
ethJSUtil
.
isValidPrivate
(
privateKey
))
}
while
(
!
isValidPrivate
(
privateKey
))
this
.
_addAccount
(
privateKey
,
'0x56BC75E2D63100000'
)
this
.
_addAccount
(
privateKey
,
'0x56BC75E2D63100000'
)
cb
(
null
,
'0x'
+
ethJSUtil
.
privateToAddress
(
privateKey
).
toString
(
'hex'
))
cb
(
null
,
'0x'
+
privateToAddress
(
privateKey
).
toString
(
'hex'
))
}
}
}
}
...
@@ -110,7 +109,7 @@ module.exports = class UniversalDApp {
...
@@ -110,7 +109,7 @@ module.exports = class UniversalDApp {
if
(
this
.
accounts
)
{
if
(
this
.
accounts
)
{
privateKey
=
Buffer
.
from
(
privateKey
,
'hex'
)
privateKey
=
Buffer
.
from
(
privateKey
,
'hex'
)
const
address
=
ethJSUtil
.
privateToAddress
(
privateKey
)
const
address
=
privateToAddress
(
privateKey
)
// FIXME: we don't care about the callback, but we should still make this proper
// FIXME: we don't care about the callback, but we should still make this proper
let
stateManager
=
executionContext
.
vm
().
stateManager
let
stateManager
=
executionContext
.
vm
().
stateManager
...
@@ -170,7 +169,7 @@ module.exports = class UniversalDApp {
...
@@ -170,7 +169,7 @@ module.exports = class UniversalDApp {
/** Get the balance of an address */
/** Get the balance of an address */
getBalance
(
address
,
cb
)
{
getBalance
(
address
,
cb
)
{
address
=
ethJSUtil
.
stripHexPrefix
(
address
)
address
=
stripHexPrefix
(
address
)
if
(
!
executionContext
.
isVM
())
{
if
(
!
executionContext
.
isVM
())
{
executionContext
.
web3
().
eth
.
getBalance
(
address
,
(
err
,
res
)
=>
{
executionContext
.
web3
().
eth
.
getBalance
(
address
,
(
err
,
res
)
=>
{
...
...
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