Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
daa26208
Unverified
Commit
daa26208
authored
Apr 20, 2021
by
Liam Horne
Committed by
GitHub
Apr 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: add rpc test for eth_getBalance (#521)
parent
0497d7df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
rpc.spec.ts
integration-tests/test/rpc.spec.ts
+15
-0
No files found.
integration-tests/test/rpc.spec.ts
View file @
daa26208
...
...
@@ -3,9 +3,12 @@ import { Wallet, BigNumber } from 'ethers'
import
chai
,
{
expect
}
from
'
chai
'
import
{
sleep
,
l2Provider
,
GWEI
}
from
'
./shared/utils
'
import
chaiAsPromised
from
'
chai-as-promised
'
import
{
OptimismEnv
}
from
'
./shared/env
'
chai
.
use
(
chaiAsPromised
)
describe
(
'
Basic RPC tests
'
,
()
=>
{
let
env
:
OptimismEnv
;
const
DEFAULT_TRANSACTION
=
{
to
:
'
0x
'
+
'
1234
'
.
repeat
(
10
),
gasLimit
:
4000000
,
...
...
@@ -17,6 +20,10 @@ describe('Basic RPC tests', () => {
const
provider
=
injectL2Context
(
l2Provider
)
const
wallet
=
Wallet
.
createRandom
().
connect
(
provider
)
before
(
async
()
=>
{
env
=
await
OptimismEnv
.
new
()
})
describe
(
'
eth_sendRawTransaction
'
,
()
=>
{
it
(
'
should correctly process a valid transaction
'
,
async
()
=>
{
const
tx
=
DEFAULT_TRANSACTION
...
...
@@ -119,6 +126,14 @@ describe('Basic RPC tests', () => {
})
})
describe
(
'
eth_getBalance
'
,
()
=>
{
it
(
'
should get the OVM_ETH balance
'
,
async
()
=>
{
const
rpcBalance
=
await
provider
.
getBalance
(
env
.
l2Wallet
.
address
)
const
contractBalance
=
await
env
.
ovmEth
.
balanceOf
(
env
.
l2Wallet
.
address
)
expect
(
rpcBalance
).
to
.
be
.
deep
.
eq
(
contractBalance
)
})
})
describe
(
'
eth_chainId
'
,
()
=>
{
it
(
'
should get the correct chainid
'
,
async
()
=>
{
const
{
chainId
}
=
await
provider
.
getNetwork
()
...
...
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