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
fd0bb4cd
Commit
fd0bb4cd
authored
Apr 21, 2021
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linting
parent
62e41049
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
accounts.ts
libs/remix-simulator/src/methods/accounts.ts
+4
-6
No files found.
libs/remix-simulator/src/methods/accounts.ts
View file @
fd0bb4cd
...
...
@@ -48,16 +48,15 @@ export class Accounts {
this
.
accountsKeys
[
addressStr
]
=
'0x'
+
privateKey
.
toString
(
'hex'
)
const
stateManager
=
this
.
executionContext
.
vm
().
stateManager
stateManager
.
getAccount
(
Address
.
fromString
(
addressStr
)).
then
((
account
)
=>
{
stateManager
.
getAccount
(
Address
.
fromString
(
addressStr
)).
then
((
account
)
=>
{
account
.
balance
=
new
BN
(
balance
.
replace
(
'0x'
,
''
)
||
'f00000000000000001'
,
16
)
stateManager
.
putAccount
(
Address
.
fromString
(
addressStr
),
account
).
catch
((
error
)
=>
{
reject
(
error
)
}).
then
(()
=>
{
}).
then
(()
=>
{
resolve
({})
})
}).
catch
((
error
)
=>
{
reject
(
error
)
return
})
})
}
...
...
@@ -84,10 +83,9 @@ export class Accounts {
}
eth_getBalance
(
payload
,
cb
)
{
let
address
=
payload
.
params
[
0
]
const
address
=
payload
.
params
[
0
]
this
.
executionContext
.
vm
().
stateManager
.
getAccount
(
Address
.
fromString
(
address
)).
then
((
account
)
=>
{
this
.
executionContext
.
vm
().
stateManager
.
getAccount
(
Address
.
fromString
(
address
)).
then
((
account
)
=>
{
cb
(
null
,
new
BN
(
account
.
balance
).
toString
(
10
))
}).
catch
((
error
)
=>
{
cb
(
error
)
...
...
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