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
343da72a
Unverified
Commit
343da72a
authored
Sep 24, 2021
by
Mark Tyneway
Committed by
Kelvin Fichter
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integration-tests: cover new receipt fields
parent
65289e63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
forty-cougars-teach.md
.changeset/forty-cougars-teach.md
+5
-0
rpc.spec.ts
integration-tests/test/rpc.spec.ts
+36
-0
No files found.
.changeset/forty-cougars-teach.md
0 → 100644
View file @
343da72a
---
'
@eth-optimism/integration-tests'
:
patch
---
Add tests for optimistic ethereum related fields to the receipt
integration-tests/test/rpc.spec.ts
View file @
343da72a
import
{
injectL2Context
}
from
'
@eth-optimism/core-utils
'
import
{
injectL2Context
}
from
'
@eth-optimism/core-utils
'
import
{
Wallet
,
BigNumber
,
Contract
,
ContractFactory
}
from
'
ethers
'
import
{
Wallet
,
BigNumber
,
Contract
,
ContractFactory
}
from
'
ethers
'
import
{
serialize
}
from
'
@ethersproject/transactions
'
import
{
ethers
}
from
'
hardhat
'
import
{
ethers
}
from
'
hardhat
'
import
chai
,
{
expect
}
from
'
chai
'
import
chai
,
{
expect
}
from
'
chai
'
import
{
import
{
...
@@ -235,6 +236,41 @@ describe('Basic RPC tests', () => {
...
@@ -235,6 +236,41 @@ describe('Basic RPC tests', () => {
expect
(
receipt
.
status
).
to
.
eq
(
0
)
expect
(
receipt
.
status
).
to
.
eq
(
0
)
})
})
// Optimistic Ethereum special fields on the receipt
it
(
'
includes L1 gas price and L1 gas used
'
,
async
()
=>
{
const
tx
=
await
env
.
l2Wallet
.
populateTransaction
({
to
:
env
.
l2Wallet
.
address
,
gasPrice
:
1
,
})
const
raw
=
serialize
({
nonce
:
parseInt
(
tx
.
nonce
.
toString
(),
10
),
to
:
tx
.
to
,
gasLimit
:
tx
.
gasLimit
,
gasPrice
:
tx
.
gasPrice
,
type
:
tx
.
type
,
data
:
tx
.
data
,
})
const
l1Fee
=
await
env
.
gasPriceOracle
.
getL1Fee
(
raw
)
const
l1GasPrice
=
await
env
.
gasPriceOracle
.
l1BaseFee
()
const
l1GasUsed
=
await
env
.
gasPriceOracle
.
getL1GasUsed
(
raw
)
const
scalar
=
await
env
.
gasPriceOracle
.
scalar
()
const
decimals
=
await
env
.
gasPriceOracle
.
decimals
()
const
scaled
=
scalar
.
toNumber
()
/
10
**
decimals
.
toNumber
()
const
res
=
await
env
.
l2Wallet
.
sendTransaction
(
tx
)
await
res
.
wait
()
const
json
=
await
provider
.
send
(
'
eth_getTransactionReceipt
'
,
[
res
.
hash
])
expect
(
l1GasUsed
).
to
.
deep
.
equal
(
BigNumber
.
from
(
json
.
l1GasUsed
))
expect
(
l1GasPrice
).
to
.
deep
.
equal
(
BigNumber
.
from
(
json
.
l1GasPrice
))
expect
(
scaled
.
toString
()).
to
.
deep
.
equal
(
json
.
l1FeeScalar
)
expect
(
l1Fee
).
to
.
deep
.
equal
(
BigNumber
.
from
(
json
.
l1Fee
))
})
})
})
describe
(
'
eth_getTransactionByHash
'
,
()
=>
{
describe
(
'
eth_getTransactionByHash
'
,
()
=>
{
...
...
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