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
dc034be4
Unverified
Commit
dc034be4
authored
Nov 04, 2021
by
Corey Rice
Committed by
Kelvin Fichter
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: Turn on eslint no unused vars
parent
a98a1884
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
82 additions
and
100 deletions
+82
-100
.eslintrc.js
.eslintrc.js
+1
-0
fee-payment.spec.ts
integration-tests/test/fee-payment.spec.ts
+2
-9
native-eth-ovm-calls.spec.ts
integration-tests/test/native-eth-ovm-calls.spec.ts
+1
-7
native-eth.spec.ts
integration-tests/test/native-eth.spec.ts
+2
-2
whitelist.spec.ts
integration-tests/test/whitelist.spec.ts
+1
-1
008-Proxy__OVM_L1CrossDomainMessenger.deploy.ts
...ts/deploy/008-Proxy__OVM_L1CrossDomainMessenger.deploy.ts
+0
-1
011-set-addresses.ts
packages/contracts/deploy/011-set-addresses.ts
+0
-1
hardhat-deploy-ethers.ts
packages/contracts/src/hardhat-deploy-ethers.ts
+1
-5
l2-gasprice.ts
packages/contracts/tasks/l2-gasprice.ts
+1
-1
set-owner.ts
packages/contracts/tasks/set-owner.ts
+1
-1
whitelist.ts
packages/contracts/tasks/whitelist.ts
+1
-1
withdraw-fees.ts
packages/contracts/tasks/withdraw-fees.ts
+1
-1
L1CrossDomainMessenger.spec.ts
...est/contracts/L1/messaging/L1CrossDomainMessenger.spec.ts
+1
-2
L1StandardBridge.spec.ts
...acts/test/contracts/L1/messaging/L1StandardBridge.spec.ts
+1
-2
deposit.gas.spec.ts
...contracts/test/contracts/L1/messaging/deposit.gas.spec.ts
+2
-2
CanonicalTransactionChain.gas.spec.ts
...contracts/L1/rollup/CanonicalTransactionChain.gas.spec.ts
+2
-4
CanonicalTransactionChain.spec.ts
...est/contracts/L1/rollup/CanonicalTransactionChain.spec.ts
+3
-6
L2StandardBridge.spec.ts
...acts/test/contracts/L2/messaging/L2StandardBridge.spec.ts
+1
-3
OVM_GasPriceOracle.spec.ts
...s/test/contracts/L2/predeploys/OVM_GasPriceOracle.spec.ts
+0
-1
misc.ts
packages/core-utils/src/common/misc.ts
+1
-1
watcher.ts
packages/core-utils/src/watcher.ts
+0
-1
fees.spec.ts
packages/core-utils/test/fees.spec.ts
+0
-5
solc.ts
packages/regenesis-surgery/scripts/solc.ts
+0
-9
verified.spec.ts
packages/regenesis-surgery/test/integration/verified.spec.ts
+1
-1
provider.ts
packages/regenesis-surgery/test/provider.ts
+58
-33
No files found.
.eslintrc.js
View file @
dc034be4
...
@@ -81,6 +81,7 @@ module.exports = {
...
@@ -81,6 +81,7 @@ module.exports = {
],
],
'
@typescript-eslint/type-annotation-spacing
'
:
'
off
'
,
'
@typescript-eslint/type-annotation-spacing
'
:
'
off
'
,
'
@typescript-eslint/unified-signatures
'
:
'
error
'
,
'
@typescript-eslint/unified-signatures
'
:
'
error
'
,
'
@typescript-eslint/no-unused-vars
'
:
'
error
'
,
},
},
},
},
],
],
...
...
integration-tests/test/fee-payment.spec.ts
View file @
dc034be4
...
@@ -3,14 +3,9 @@ import chaiAsPromised from 'chai-as-promised'
...
@@ -3,14 +3,9 @@ import chaiAsPromised from 'chai-as-promised'
chai
.
use
(
chaiAsPromised
)
chai
.
use
(
chaiAsPromised
)
/* Imports: External */
/* Imports: External */
import
{
ethers
,
BigNumber
,
Contract
,
utils
}
from
'
ethers
'
import
{
BigNumber
,
utils
}
from
'
ethers
'
import
{
sleep
}
from
'
@eth-optimism/core-utils
'
import
{
serialize
}
from
'
@ethersproject/transactions
'
import
{
serialize
}
from
'
@ethersproject/transactions
'
import
{
import
{
predeploys
,
getContractFactory
}
from
'
@eth-optimism/contracts
'
predeploys
,
getContractInterface
,
getContractFactory
,
}
from
'
@eth-optimism/contracts
'
/* Imports: Internal */
/* Imports: Internal */
import
{
isLiveNetwork
}
from
'
./shared/utils
'
import
{
isLiveNetwork
}
from
'
./shared/utils
'
...
@@ -166,8 +161,6 @@ describe('Fee Payment Integration Tests', async () => {
...
@@ -166,8 +161,6 @@ describe('Fee Payment Integration Tests', async () => {
const
balanceBefore
=
await
env
.
l1Wallet
.
provider
.
getBalance
(
l1FeeWallet
)
const
balanceBefore
=
await
env
.
l1Wallet
.
provider
.
getBalance
(
l1FeeWallet
)
const
withdrawalAmount
=
await
env
.
sequencerFeeVault
.
MIN_WITHDRAWAL_AMOUNT
()
const
withdrawalAmount
=
await
env
.
sequencerFeeVault
.
MIN_WITHDRAWAL_AMOUNT
()
const
l2WalletBalance
=
await
env
.
l2Wallet
.
getBalance
()
// Transfer the minimum required to withdraw.
// Transfer the minimum required to withdraw.
const
tx
=
await
env
.
l2Wallet
.
sendTransaction
({
const
tx
=
await
env
.
l2Wallet
.
sendTransaction
({
to
:
env
.
sequencerFeeVault
.
address
,
to
:
env
.
sequencerFeeVault
.
address
,
...
...
integration-tests/test/native-eth-ovm-calls.spec.ts
View file @
dc034be4
import
{
import
{
BigNumber
,
Contract
,
ContractFactory
,
Wallet
}
from
'
ethers
'
BigNumber
,
BigNumberish
,
Contract
,
ContractFactory
,
Wallet
,
}
from
'
ethers
'
import
{
ethers
}
from
'
hardhat
'
import
{
ethers
}
from
'
hardhat
'
import
chai
,
{
expect
}
from
'
chai
'
import
chai
,
{
expect
}
from
'
chai
'
import
{
import
{
...
...
integration-tests/test/native-eth.spec.ts
View file @
dc034be4
...
@@ -9,8 +9,8 @@ import { expectApprox } from '@eth-optimism/core-utils'
...
@@ -9,8 +9,8 @@ import { expectApprox } from '@eth-optimism/core-utils'
/* Imports: Internal */
/* Imports: Internal */
import
{
Direction
}
from
'
./shared/watcher-utils
'
import
{
Direction
}
from
'
./shared/watcher-utils
'
import
{
fundUser
,
PROXY_SEQUENCER_ENTRYPOINT_ADDRESS
}
from
'
./shared/utils
'
import
{
PROXY_SEQUENCER_ENTRYPOINT_ADDRESS
}
from
'
./shared/utils
'
import
{
OptimismEnv
,
useDynamicTimeoutForWithdrawals
}
from
'
./shared/env
'
import
{
OptimismEnv
}
from
'
./shared/env
'
const
DEFAULT_TEST_GAS_L1
=
330
_000
const
DEFAULT_TEST_GAS_L1
=
330
_000
const
DEFAULT_TEST_GAS_L2
=
1
_300_000
const
DEFAULT_TEST_GAS_L2
=
1
_300_000
...
...
integration-tests/test/whitelist.spec.ts
View file @
dc034be4
/* Imports: External */
/* Imports: External */
import
{
Contract
,
ContractFactory
,
Wallet
}
from
'
ethers
'
import
{
Contract
Factory
}
from
'
ethers
'
import
{
ethers
}
from
'
hardhat
'
import
{
ethers
}
from
'
hardhat
'
import
chai
,
{
expect
}
from
'
chai
'
import
chai
,
{
expect
}
from
'
chai
'
import
{
solidity
}
from
'
ethereum-waffle
'
import
{
solidity
}
from
'
ethereum-waffle
'
...
...
packages/contracts/deploy/008-Proxy__OVM_L1CrossDomainMessenger.deploy.ts
View file @
dc034be4
/* Imports: External */
/* Imports: External */
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
{
hexStringEquals
}
from
'
@eth-optimism/core-utils
'
/* Imports: Internal */
/* Imports: Internal */
import
{
import
{
...
...
packages/contracts/deploy/011-set-addresses.ts
View file @
dc034be4
/* Imports: External */
/* Imports: External */
import
{
hexStringEquals
,
awaitCondition
}
from
'
@eth-optimism/core-utils
'
import
{
hexStringEquals
,
awaitCondition
}
from
'
@eth-optimism/core-utils
'
import
{
ethers
}
from
'
hardhat
'
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
/* Imports: Internal */
/* Imports: Internal */
...
...
packages/contracts/src/hardhat-deploy-ethers.ts
View file @
dc034be4
...
@@ -2,11 +2,7 @@
...
@@ -2,11 +2,7 @@
import
{
ethers
,
Contract
}
from
'
ethers
'
import
{
ethers
,
Contract
}
from
'
ethers
'
import
{
Provider
}
from
'
@ethersproject/abstract-provider
'
import
{
Provider
}
from
'
@ethersproject/abstract-provider
'
import
{
Signer
}
from
'
@ethersproject/abstract-signer
'
import
{
Signer
}
from
'
@ethersproject/abstract-signer
'
import
{
import
{
sleep
,
awaitCondition
}
from
'
@eth-optimism/core-utils
'
sleep
,
hexStringEquals
,
awaitCondition
,
}
from
'
@eth-optimism/core-utils
'
import
{
HttpNetworkConfig
}
from
'
hardhat/types
'
import
{
HttpNetworkConfig
}
from
'
hardhat/types
'
export
const
deployAndPostDeploy
=
async
({
export
const
deployAndPostDeploy
=
async
({
...
...
packages/contracts/tasks/l2-gasprice.ts
View file @
dc034be4
...
@@ -21,7 +21,7 @@ task('set-l2-gasprice')
...
@@ -21,7 +21,7 @@ task('set-l2-gasprice')
process
.
env
.
CONTRACTS_DEPLOYER_KEY
,
process
.
env
.
CONTRACTS_DEPLOYER_KEY
,
types
.
string
types
.
string
)
)
.
setAction
(
async
(
args
,
hre
:
any
,
runSuper
)
=>
{
.
setAction
(
async
(
args
)
=>
{
const
provider
=
new
ethers
.
providers
.
JsonRpcProvider
(
args
.
contractsRpcUrl
)
const
provider
=
new
ethers
.
providers
.
JsonRpcProvider
(
args
.
contractsRpcUrl
)
const
signer
=
new
ethers
.
Wallet
(
args
.
contractsDeployerKey
).
connect
(
const
signer
=
new
ethers
.
Wallet
(
args
.
contractsDeployerKey
).
connect
(
provider
provider
...
...
packages/contracts/tasks/set-owner.ts
View file @
dc034be4
...
@@ -40,7 +40,7 @@ task('set-owner')
...
@@ -40,7 +40,7 @@ task('set-owner')
predeploys
.
OVM_GasPriceOracle
,
predeploys
.
OVM_GasPriceOracle
,
types
.
string
types
.
string
)
)
.
setAction
(
async
(
args
,
hre
:
any
,
runSuper
)
=>
{
.
setAction
(
async
(
args
)
=>
{
const
provider
=
new
ethers
.
providers
.
JsonRpcProvider
(
args
.
contractsRpcUrl
)
const
provider
=
new
ethers
.
providers
.
JsonRpcProvider
(
args
.
contractsRpcUrl
)
let
signer
:
ethers
.
Signer
let
signer
:
ethers
.
Signer
if
(
!
args
.
useLedger
)
{
if
(
!
args
.
useLedger
)
{
...
...
packages/contracts/tasks/whitelist.ts
View file @
dc034be4
...
@@ -42,7 +42,7 @@ task('whitelist')
...
@@ -42,7 +42,7 @@ task('whitelist')
predeploys
.
OVM_DeployerWhitelist
,
predeploys
.
OVM_DeployerWhitelist
,
types
.
string
types
.
string
)
)
.
setAction
(
async
(
args
,
hre
:
any
)
=>
{
.
setAction
(
async
(
args
)
=>
{
const
provider
=
new
ethers
.
providers
.
JsonRpcProvider
(
args
.
contractsRpcUrl
)
const
provider
=
new
ethers
.
providers
.
JsonRpcProvider
(
args
.
contractsRpcUrl
)
let
signer
:
ethers
.
Signer
let
signer
:
ethers
.
Signer
if
(
!
args
.
useLedger
)
{
if
(
!
args
.
useLedger
)
{
...
...
packages/contracts/tasks/withdraw-fees.ts
View file @
dc034be4
...
@@ -35,7 +35,7 @@ task('withdraw-fees')
...
@@ -35,7 +35,7 @@ task('withdraw-fees')
process
.
env
.
CONTRACTS_DEPLOYER_KEY
,
process
.
env
.
CONTRACTS_DEPLOYER_KEY
,
types
.
string
types
.
string
)
)
.
setAction
(
async
(
args
,
hre
:
any
)
=>
{
.
setAction
(
async
(
args
)
=>
{
const
provider
=
new
ethers
.
providers
.
JsonRpcProvider
(
args
.
contractsRpcUrl
)
const
provider
=
new
ethers
.
providers
.
JsonRpcProvider
(
args
.
contractsRpcUrl
)
let
signer
:
ethers
.
Signer
let
signer
:
ethers
.
Signer
if
(
!
args
.
useLedger
)
{
if
(
!
args
.
useLedger
)
{
...
...
packages/contracts/test/contracts/L1/messaging/L1CrossDomainMessenger.spec.ts
View file @
dc034be4
...
@@ -27,7 +27,6 @@ import {
...
@@ -27,7 +27,6 @@ import {
setEthTime
,
setEthTime
,
}
from
'
../../../helpers
'
}
from
'
../../../helpers
'
import
{
predeploys
}
from
'
../../../../src
'
import
{
predeploys
}
from
'
../../../../src
'
import
{
keccak256
}
from
'
ethers/lib/utils
'
const
MAX_GAS_LIMIT
=
8
_000_000
const
MAX_GAS_LIMIT
=
8
_000_000
...
@@ -113,7 +112,7 @@ describe('L1CrossDomainMessenger', () => {
...
@@ -113,7 +112,7 @@ describe('L1CrossDomainMessenger', () => {
AddressManager
.
address
,
AddressManager
.
address
,
'
CanonicalTransactionChain
'
'
CanonicalTransactionChain
'
)
)
const
queue
=
await
Factory__ChainStorageContainer
.
deploy
(
await
Factory__ChainStorageContainer
.
deploy
(
AddressManager
.
address
,
AddressManager
.
address
,
'
CanonicalTransactionChain
'
'
CanonicalTransactionChain
'
)
)
...
...
packages/contracts/test/contracts/L1/messaging/L1StandardBridge.spec.ts
View file @
dc034be4
...
@@ -31,13 +31,12 @@ describe('L1StandardBridge', () => {
...
@@ -31,13 +31,12 @@ describe('L1StandardBridge', () => {
let
aliceAddress
let
aliceAddress
// we can just make up this string since it's on the "other" Layer
// we can just make up this string since it's on the "other" Layer
let
Mock__OVM_ETH
:
MockContract
let
Factory__L1ERC20
:
ContractFactory
let
Factory__L1ERC20
:
ContractFactory
let
IL2ERC20Bridge
:
Interface
let
IL2ERC20Bridge
:
Interface
before
(
async
()
=>
{
before
(
async
()
=>
{
;[
l1MessengerImpersonator
,
alice
,
bob
]
=
await
ethers
.
getSigners
()
;[
l1MessengerImpersonator
,
alice
,
bob
]
=
await
ethers
.
getSigners
()
Mock__OVM_ETH
=
await
smockit
(
await
ethers
.
getContractFactory
(
'
OVM_ETH
'
))
await
smockit
(
await
ethers
.
getContractFactory
(
'
OVM_ETH
'
))
// deploy an ERC20 contract on L1
// deploy an ERC20 contract on L1
Factory__L1ERC20
=
await
smoddit
(
Factory__L1ERC20
=
await
smoddit
(
...
...
packages/contracts/test/contracts/L1/messaging/deposit.gas.spec.ts
View file @
dc034be4
/* External Imports */
/* External Imports */
import
{
ethers
}
from
'
hardhat
'
import
{
ethers
}
from
'
hardhat
'
import
{
Signer
,
ContractFactory
,
Contract
,
constants
}
from
'
ethers
'
import
{
Signer
,
ContractFactory
,
Contract
}
from
'
ethers
'
import
{
smoddit
}
from
'
@eth-optimism/smock
'
import
{
smoddit
}
from
'
@eth-optimism/smock
'
import
{
expectApprox
}
from
'
@eth-optimism/core-utils
'
import
{
expectApprox
}
from
'
@eth-optimism/core-utils
'
...
@@ -56,7 +56,7 @@ describe('[GAS BENCHMARK] Depositing via the standard bridge [ @skip-on-coverage
...
@@ -56,7 +56,7 @@ describe('[GAS BENCHMARK] Depositing via the standard bridge [ @skip-on-coverage
AddressManager
.
address
,
AddressManager
.
address
,
'
CanonicalTransactionChain
'
'
CanonicalTransactionChain
'
)
)
const
queue
=
await
Factory__ChainStorageContainer
.
deploy
(
await
Factory__ChainStorageContainer
.
deploy
(
AddressManager
.
address
,
AddressManager
.
address
,
'
CanonicalTransactionChain
'
'
CanonicalTransactionChain
'
)
)
...
...
packages/contracts/test/contracts/L1/rollup/CanonicalTransactionChain.gas.spec.ts
View file @
dc034be4
/* External Imports */
/* External Imports */
import
{
ethers
}
from
'
hardhat
'
import
{
ethers
}
from
'
hardhat
'
import
{
Signer
,
ContractFactory
,
Contract
,
constants
}
from
'
ethers
'
import
{
Signer
,
ContractFactory
,
Contract
}
from
'
ethers
'
import
{
smockit
,
MockContract
}
from
'
@eth-optimism/smock
'
import
{
smockit
,
MockContract
}
from
'
@eth-optimism/smock
'
import
{
import
{
AppendSequencerBatchParams
,
AppendSequencerBatchParams
,
...
@@ -10,13 +10,11 @@ import {
...
@@ -10,13 +10,11 @@ import {
}
from
'
@eth-optimism/core-utils
'
}
from
'
@eth-optimism/core-utils
'
import
{
TransactionResponse
}
from
'
@ethersproject/abstract-provider
'
import
{
TransactionResponse
}
from
'
@ethersproject/abstract-provider
'
import
{
keccak256
}
from
'
ethers/lib/utils
'
import
{
keccak256
}
from
'
ethers/lib/utils
'
import
_
from
'
lodash
'
/* Internal Imports */
/* Internal Imports */
import
{
import
{
makeAddressManager
,
makeAddressManager
,
setProxyTarget
,
setProxyTarget
,
FORCE_INCLUSION_PERIOD_SECONDS
,
L2_GAS_DISCOUNT_DIVISOR
,
L2_GAS_DISCOUNT_DIVISOR
,
ENQUEUE_GAS_COST
,
ENQUEUE_GAS_COST
,
getEthTime
,
getEthTime
,
...
@@ -92,7 +90,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain [ @skip-on-coverage ]', () =
...
@@ -92,7 +90,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain [ @skip-on-coverage ]', () =
AddressManager
.
address
,
AddressManager
.
address
,
'
CanonicalTransactionChain
'
'
CanonicalTransactionChain
'
)
)
const
queue
=
await
Factory__ChainStorageContainer
.
deploy
(
await
Factory__ChainStorageContainer
.
deploy
(
AddressManager
.
address
,
AddressManager
.
address
,
'
CanonicalTransactionChain
'
'
CanonicalTransactionChain
'
)
)
...
...
packages/contracts/test/contracts/L1/rollup/CanonicalTransactionChain.spec.ts
View file @
dc034be4
...
@@ -2,12 +2,11 @@ import { expect } from '../../../setup'
...
@@ -2,12 +2,11 @@ import { expect } from '../../../setup'
/* External Imports */
/* External Imports */
import
{
ethers
}
from
'
hardhat
'
import
{
ethers
}
from
'
hardhat
'
import
{
Signer
,
ContractFactory
,
Contract
,
BigNumber
,
constants
}
from
'
ethers
'
import
{
Signer
,
ContractFactory
,
Contract
}
from
'
ethers
'
import
{
smockit
,
MockContract
}
from
'
@eth-optimism/smock
'
import
{
smockit
,
MockContract
}
from
'
@eth-optimism/smock
'
import
{
import
{
AppendSequencerBatchParams
,
AppendSequencerBatchParams
,
encodeAppendSequencerBatch
,
encodeAppendSequencerBatch
,
remove0x
,
}
from
'
@eth-optimism/core-utils
'
}
from
'
@eth-optimism/core-utils
'
import
{
TransactionResponse
}
from
'
@ethersproject/abstract-provider
'
import
{
TransactionResponse
}
from
'
@ethersproject/abstract-provider
'
import
{
keccak256
}
from
'
ethers/lib/utils
'
import
{
keccak256
}
from
'
ethers/lib/utils
'
...
@@ -24,7 +23,6 @@ import {
...
@@ -24,7 +23,6 @@ import {
getEthTime
,
getEthTime
,
getNextBlockNumber
,
getNextBlockNumber
,
}
from
'
../../../helpers
'
}
from
'
../../../helpers
'
import
{
predeploys
}
from
'
../../../../src
'
const
ELEMENT_TEST_SIZES
=
[
1
,
2
,
4
,
8
,
16
]
const
ELEMENT_TEST_SIZES
=
[
1
,
2
,
4
,
8
,
16
]
const
MAX_GAS_LIMIT
=
8
_000_000
const
MAX_GAS_LIMIT
=
8
_000_000
...
@@ -115,7 +113,7 @@ describe('CanonicalTransactionChain', () => {
...
@@ -115,7 +113,7 @@ describe('CanonicalTransactionChain', () => {
AddressManager
.
address
,
AddressManager
.
address
,
'
CanonicalTransactionChain
'
'
CanonicalTransactionChain
'
)
)
const
queue
=
await
Factory__ChainStorageContainer
.
deploy
(
await
Factory__ChainStorageContainer
.
deploy
(
AddressManager
.
address
,
AddressManager
.
address
,
'
CanonicalTransactionChain
'
'
CanonicalTransactionChain
'
)
)
...
@@ -146,8 +144,7 @@ describe('CanonicalTransactionChain', () => {
...
@@ -146,8 +144,7 @@ describe('CanonicalTransactionChain', () => {
addressManagerOwner
addressManagerOwner
).
setGasParams
(
newGasDivisor
,
newEnqueueGasCost
)
).
setGasParams
(
newGasDivisor
,
newEnqueueGasCost
)
const
l2GasDiscountDivisor
=
await
CanonicalTransactionChain
.
l2GasDiscountDivisor
()
await
CanonicalTransactionChain
.
l2GasDiscountDivisor
()
const
enqueueL2GasPrepaid
=
const
enqueueL2GasPrepaid
=
await
CanonicalTransactionChain
.
enqueueL2GasPrepaid
()
await
CanonicalTransactionChain
.
enqueueL2GasPrepaid
()
expect
(
enqueueL2GasPrepaid
).
to
.
equal
(
newGasDivisor
*
newEnqueueGasCost
)
expect
(
enqueueL2GasPrepaid
).
to
.
equal
(
newGasDivisor
*
newEnqueueGasCost
)
...
...
packages/contracts/test/contracts/L2/messaging/L2StandardBridge.spec.ts
View file @
dc034be4
...
@@ -3,7 +3,6 @@ import { expect } from '../../../setup'
...
@@ -3,7 +3,6 @@ import { expect } from '../../../setup'
/* External Imports */
/* External Imports */
import
{
ethers
}
from
'
hardhat
'
import
{
ethers
}
from
'
hardhat
'
import
{
Signer
,
ContractFactory
,
Contract
}
from
'
ethers
'
import
{
Signer
,
ContractFactory
,
Contract
}
from
'
ethers
'
import
{
Interface
}
from
'
ethers/lib/utils
'
import
{
import
{
smockit
,
smockit
,
MockContract
,
MockContract
,
...
@@ -31,7 +30,6 @@ describe('L2StandardBridge', () => {
...
@@ -31,7 +30,6 @@ describe('L2StandardBridge', () => {
let
bobsAddress
:
string
let
bobsAddress
:
string
let
l2MessengerImpersonator
:
Signer
let
l2MessengerImpersonator
:
Signer
let
Factory__L1StandardBridge
:
ContractFactory
let
Factory__L1StandardBridge
:
ContractFactory
let
IL2ERC20Bridge
:
Interface
const
INITIAL_TOTAL_SUPPLY
=
100
_000
const
INITIAL_TOTAL_SUPPLY
=
100
_000
const
ALICE_INITIAL_BALANCE
=
50
_000
const
ALICE_INITIAL_BALANCE
=
50
_000
before
(
async
()
=>
{
before
(
async
()
=>
{
...
@@ -44,7 +42,7 @@ describe('L2StandardBridge', () => {
...
@@ -44,7 +42,7 @@ describe('L2StandardBridge', () => {
)
)
// get an L2ER20Bridge Interface
// get an L2ER20Bridge Interface
IL2ERC20Bridge
=
getContractInterface
(
'
IL2ERC20Bridge
'
)
getContractInterface
(
'
IL2ERC20Bridge
'
)
})
})
let
L2StandardBridge
:
Contract
let
L2StandardBridge
:
Contract
...
...
packages/contracts/test/contracts/L2/predeploys/OVM_GasPriceOracle.spec.ts
View file @
dc034be4
...
@@ -276,7 +276,6 @@ describe('OVM_GasPriceOracle', () => {
...
@@ -276,7 +276,6 @@ describe('OVM_GasPriceOracle', () => {
describe
(
'
decimals
'
,
()
=>
{
describe
(
'
decimals
'
,
()
=>
{
it
(
'
is the 5th storage slot
'
,
async
()
=>
{
it
(
'
is the 5th storage slot
'
,
async
()
=>
{
const
decimals
=
6
const
slot
=
5
const
slot
=
5
// get the storage slot value
// get the storage slot value
...
...
packages/core-utils/src/common/misc.ts
View file @
dc034be4
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* @param ms Number of milliseconds to sleep.
* @param ms Number of milliseconds to sleep.
*/
*/
export
const
sleep
=
async
(
ms
:
number
):
Promise
<
void
>
=>
{
export
const
sleep
=
async
(
ms
:
number
):
Promise
<
void
>
=>
{
return
new
Promise
<
void
>
((
resolve
,
reject
)
=>
{
return
new
Promise
<
void
>
((
resolve
)
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
resolve
(
null
)
resolve
(
null
)
},
ms
)
},
ms
)
...
...
packages/core-utils/src/watcher.ts
View file @
dc034be4
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
import
{
ethers
}
from
'
ethers
'
import
{
ethers
}
from
'
ethers
'
import
{
Provider
,
TransactionReceipt
}
from
'
@ethersproject/abstract-provider
'
import
{
Provider
,
TransactionReceipt
}
from
'
@ethersproject/abstract-provider
'
const
SENT_MESSAGE
=
ethers
.
utils
.
id
(
'
SentMessage(bytes)
'
)
const
RELAYED_MESSAGE
=
ethers
.
utils
.
id
(
`RelayedMessage(bytes32)`
)
const
RELAYED_MESSAGE
=
ethers
.
utils
.
id
(
`RelayedMessage(bytes32)`
)
const
FAILED_RELAYED_MESSAGE
=
ethers
.
utils
.
id
(
`FailedRelayedMessage(bytes32)`
)
const
FAILED_RELAYED_MESSAGE
=
ethers
.
utils
.
id
(
`FailedRelayedMessage(bytes32)`
)
...
...
packages/core-utils/test/fees.spec.ts
View file @
dc034be4
import
{
expect
}
from
'
./setup
'
import
*
as
fees
from
'
../src/fees
'
import
*
as
fees
from
'
../src/fees
'
import
{
BigNumber
,
utils
}
from
'
ethers
'
const
hundredBillion
=
10
**
11
const
tenThousand
=
10
**
4
describe
(
'
Fees
'
,
()
=>
{
describe
(
'
Fees
'
,
()
=>
{
it
(
'
should count zeros and ones
'
,
()
=>
{
it
(
'
should count zeros and ones
'
,
()
=>
{
...
...
packages/regenesis-surgery/scripts/solc.ts
View file @
dc034be4
...
@@ -173,15 +173,6 @@ export const solcInput = (contract: EtherscanContract) => {
...
@@ -173,15 +173,6 @@ export const solcInput = (contract: EtherscanContract) => {
return
input
return
input
}
}
const
compilerCache
:
{
[
target
:
string
]:
{
[
hash
:
string
]:
any
}
}
=
{
[
'
OVM
'
]:
{},
[
'
EVM
'
]:
{},
}
const
readCompilerCache
=
(
const
readCompilerCache
=
(
target
:
'
evm
'
|
'
ovm
'
,
target
:
'
evm
'
|
'
ovm
'
,
hash
:
string
hash
:
string
...
...
packages/regenesis-surgery/test/integration/verified.spec.ts
View file @
dc034be4
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-empty-function */
import
{
expect
,
env
,
NUM_ACCOUNTS_DIVISOR
}
from
'
../setup
'
import
{
expect
,
env
,
NUM_ACCOUNTS_DIVISOR
}
from
'
../setup
'
import
{
AccountType
,
Account
}
from
'
../../scripts/types
'
import
{
AccountType
}
from
'
../../scripts/types
'
describe
(
'
verified
'
,
()
=>
{
describe
(
'
verified
'
,
()
=>
{
before
(
async
()
=>
{
before
(
async
()
=>
{
...
...
packages/regenesis-surgery/test/provider.ts
View file @
dc034be4
...
@@ -75,10 +75,7 @@ export class GenesisJsonProvider implements AbstractProvider {
...
@@ -75,10 +75,7 @@ export class GenesisJsonProvider implements AbstractProvider {
}
}
}
}
async
getBalance
(
async
getBalance
(
addressOrName
:
string
):
Promise
<
BigNumber
>
{
addressOrName
:
string
,
blockTag
?:
BlockTag
):
Promise
<
BigNumber
>
{
const
address
=
remove0x
(
addressOrName
)
const
address
=
remove0x
(
addressOrName
)
const
account
=
this
.
state
[
address
]
const
account
=
this
.
state
[
address
]
if
(
!
account
)
{
if
(
!
account
)
{
...
@@ -87,10 +84,7 @@ export class GenesisJsonProvider implements AbstractProvider {
...
@@ -87,10 +84,7 @@ export class GenesisJsonProvider implements AbstractProvider {
return
BigNumber
.
from
(
account
.
balance
)
return
BigNumber
.
from
(
account
.
balance
)
}
}
async
getTransactionCount
(
async
getTransactionCount
(
addressOrName
:
string
):
Promise
<
number
>
{
addressOrName
:
string
,
blockTag
?:
BlockTag
):
Promise
<
number
>
{
const
address
=
remove0x
(
addressOrName
)
const
address
=
remove0x
(
addressOrName
)
const
account
=
this
.
state
[
address
]
const
account
=
this
.
state
[
address
]
if
(
!
account
)
{
if
(
!
account
)
{
...
@@ -99,7 +93,7 @@ export class GenesisJsonProvider implements AbstractProvider {
...
@@ -99,7 +93,7 @@ export class GenesisJsonProvider implements AbstractProvider {
return
account
.
nonce
return
account
.
nonce
}
}
async
getCode
(
addressOrName
:
string
,
blockTag
?:
BlockTag
):
Promise
<
string
>
{
async
getCode
(
addressOrName
:
string
):
Promise
<
string
>
{
const
address
=
remove0x
(
addressOrName
)
const
address
=
remove0x
(
addressOrName
)
const
account
=
this
.
state
[
address
]
const
account
=
this
.
state
[
address
]
if
(
!
account
)
{
if
(
!
account
)
{
...
@@ -110,8 +104,7 @@ export class GenesisJsonProvider implements AbstractProvider {
...
@@ -110,8 +104,7 @@ export class GenesisJsonProvider implements AbstractProvider {
async
getStorageAt
(
async
getStorageAt
(
addressOrName
:
string
,
addressOrName
:
string
,
position
:
BigNumber
|
number
,
position
:
BigNumber
|
number
blockTag
?:
BlockTag
):
Promise
<
string
>
{
):
Promise
<
string
>
{
const
address
=
remove0x
(
addressOrName
)
const
address
=
remove0x
(
addressOrName
)
const
account
=
this
.
state
[
address
]
const
account
=
this
.
state
[
address
]
...
@@ -130,7 +123,9 @@ export class GenesisJsonProvider implements AbstractProvider {
...
@@ -130,7 +123,9 @@ export class GenesisJsonProvider implements AbstractProvider {
transaction
:
Deferrable
<
TransactionRequest
>
,
transaction
:
Deferrable
<
TransactionRequest
>
,
blockTag
?:
BlockTag
|
Promise
<
BlockTag
>
blockTag
?:
BlockTag
|
Promise
<
BlockTag
>
):
Promise
<
string
>
{
):
Promise
<
string
>
{
throw
new
Error
(
'
Unsupported Method: call
'
)
throw
new
Error
(
`Unsupported Method: call with args: transaction -
${
transaction
}
, blockTag -
${
blockTag
}
`
)
}
}
async
send
(
method
:
string
,
args
:
Array
<
any
>
):
Promise
<
any
>
{
async
send
(
method
:
string
,
args
:
Array
<
any
>
):
Promise
<
any
>
{
...
@@ -177,73 +172,101 @@ export class GenesisJsonProvider implements AbstractProvider {
...
@@ -177,73 +172,101 @@ export class GenesisJsonProvider implements AbstractProvider {
async
sendTransaction
(
async
sendTransaction
(
signedTransaction
:
string
|
Promise
<
string
>
signedTransaction
:
string
|
Promise
<
string
>
):
Promise
<
TransactionResponse
>
{
):
Promise
<
TransactionResponse
>
{
throw
new
Error
(
'
Unsupported Method: sendTransaction
'
)
throw
new
Error
(
`Unsupported Method: sendTransaction with args: transaction -
${
signedTransaction
}
`
)
}
}
async
estimateGas
(
async
estimateGas
():
Promise
<
BigNumber
>
{
transaction
:
Deferrable
<
TransactionRequest
>
):
Promise
<
BigNumber
>
{
return
BigNumber
.
from
(
0
)
return
BigNumber
.
from
(
0
)
}
}
async
getBlock
(
async
getBlock
(
blockHashOrBlockTag
:
BlockTag
|
string
|
Promise
<
BlockTag
|
string
>
blockHashOrBlockTag
:
BlockTag
|
string
|
Promise
<
BlockTag
|
string
>
):
Promise
<
Block
>
{
):
Promise
<
Block
>
{
throw
new
Error
(
'
Unsupported Method: getBlock
'
)
throw
new
Error
(
`Unsupported Method: getBlock with args blockHashOrBlockTag -
${
blockHashOrBlockTag
}
`
)
}
}
async
getBlockWithTransactions
(
async
getBlockWithTransactions
(
blockHashOrBlockTag
:
BlockTag
|
string
|
Promise
<
BlockTag
|
string
>
blockHashOrBlockTag
:
BlockTag
|
string
|
Promise
<
BlockTag
|
string
>
):
Promise
<
BlockWithTransactions
>
{
):
Promise
<
BlockWithTransactions
>
{
throw
new
Error
(
'
Unsupported Method: getBlockWithTransactions
'
)
throw
new
Error
(
`Unsupported Method: getBlockWithTransactions with args blockHashOrBlockTag -
${
blockHashOrBlockTag
}
`
)
}
}
async
getTransaction
(
transactionHash
:
string
):
Promise
<
TransactionResponse
>
{
async
getTransaction
(
transactionHash
:
string
):
Promise
<
TransactionResponse
>
{
throw
new
Error
(
'
Unsupported Method: getTransaction
'
)
throw
new
Error
(
`Unsupported Method: getTransaction with args transactionHash -
${
transactionHash
}
`
)
}
}
async
getTransactionReceipt
(
async
getTransactionReceipt
(
transactionHash
:
string
transactionHash
:
string
):
Promise
<
TransactionReceipt
>
{
):
Promise
<
TransactionReceipt
>
{
throw
new
Error
(
'
Unsupported Method: getTransactionReceipt
'
)
throw
new
Error
(
`Unsupported Method: getTransactionReceipt with args transactionHash -
${
transactionHash
}
`
)
}
}
async
getLogs
(
filter
:
Filter
):
Promise
<
Array
<
Log
>>
{
async
getLogs
(
filter
:
Filter
):
Promise
<
Array
<
Log
>>
{
throw
new
Error
(
'
Unsupported Method: getLogs
'
)
throw
new
Error
(
`Unsupported Method: getLogs with args filter -
${
filter
}
`
)
}
}
async
resolveName
(
name
:
string
|
Promise
<
string
>
):
Promise
<
null
|
string
>
{
async
resolveName
(
name
:
string
|
Promise
<
string
>
):
Promise
<
null
|
string
>
{
throw
new
Error
(
'
Unsupported Method: resolveName
'
)
throw
new
Error
(
`Unsupported Method: resolveName with args name -
${
name
}
`
)
}
}
async
lookupAddress
(
async
lookupAddress
(
address
:
string
|
Promise
<
string
>
address
:
string
|
Promise
<
string
>
):
Promise
<
null
|
string
>
{
):
Promise
<
null
|
string
>
{
throw
new
Error
(
'
Unsupported Method: lookupAddress
'
)
throw
new
Error
(
`Unsupported Method: lookupAddress with args address -
${
address
}
`
)
}
}
on
(
eventName
:
EventType
,
listener
:
Listener
):
Provider
{
on
(
eventName
:
EventType
,
listener
:
Listener
):
Provider
{
throw
new
Error
(
'
Unsupported Method: on
'
)
throw
new
Error
(
`Unsupported Method: on with args eventName -
${
eventName
}
, listener -
${
listener
}
`
)
}
}
once
(
eventName
:
EventType
,
listener
:
Listener
):
Provider
{
once
(
eventName
:
EventType
,
listener
:
Listener
):
Provider
{
throw
new
Error
(
'
Unsupported Method: once
'
)
throw
new
Error
(
`Unsupported Method: once with args eventName -
${
eventName
}
, listener -
${
listener
}
`
)
}
}
emit
(
eventName
:
EventType
,
...
args
:
Array
<
any
>
):
boolean
{
emit
(
eventName
:
EventType
,
...
args
:
Array
<
any
>
):
boolean
{
throw
new
Error
(
'
Unsupported Method: emit
'
)
throw
new
Error
(
`Unsupported Method: emit with args eventName -
${
eventName
}
, args -
${
args
}
`
)
}
}
listenerCount
(
eventName
?:
EventType
):
number
{
listenerCount
(
eventName
?:
EventType
):
number
{
throw
new
Error
(
'
Unsupported Method: listenerCount
'
)
throw
new
Error
(
`Unsupported Method: listenerCount with args eventName -
${
eventName
}
`
)
}
}
listeners
(
eventName
?:
EventType
):
Array
<
Listener
>
{
listeners
(
eventName
?:
EventType
):
Array
<
Listener
>
{
throw
new
Error
(
'
Unsupported Method: listeners
'
)
throw
new
Error
(
`Unsupported Method: listeners with args eventName -
${
eventName
}
`
)
}
}
off
(
eventName
:
EventType
,
listener
?:
Listener
):
Provider
{
off
(
eventName
:
EventType
,
listener
?:
Listener
):
Provider
{
throw
new
Error
(
'
Unsupported Method: off
'
)
throw
new
Error
(
`Unsupported Method: off with args eventName -
${
eventName
}
, listener -
${
listener
}
`
)
}
}
removeAllListeners
(
eventName
?:
EventType
):
Provider
{
removeAllListeners
(
eventName
?:
EventType
):
Provider
{
throw
new
Error
(
'
Unsupported Method: removeAllListeners
'
)
throw
new
Error
(
`Unsupported Method: removeAllListeners with args eventName -
${
eventName
}
`
)
}
}
addListener
(
eventName
:
EventType
,
listener
:
Listener
):
Provider
{
addListener
(
eventName
:
EventType
,
listener
:
Listener
):
Provider
{
throw
new
Error
(
'
Unsupported Method: addListener
'
)
throw
new
Error
(
`Unsupported Method: addListener with args eventName -
${
eventName
}
, listener -
${
listener
}
`
)
}
}
removeListener
(
eventName
:
EventType
,
listener
:
Listener
):
Provider
{
removeListener
(
eventName
:
EventType
,
listener
:
Listener
):
Provider
{
throw
new
Error
(
'
Unsupported Method: removeListener
'
)
throw
new
Error
(
`Unsupported Method: removeListener with args eventName -
${
eventName
}
, listener -
${
listener
}
`
)
}
}
async
waitForTransaction
(
async
waitForTransaction
(
...
@@ -251,7 +274,9 @@ export class GenesisJsonProvider implements AbstractProvider {
...
@@ -251,7 +274,9 @@ export class GenesisJsonProvider implements AbstractProvider {
confirmations
?:
number
,
confirmations
?:
number
,
timeout
?:
number
timeout
?:
number
):
Promise
<
TransactionReceipt
>
{
):
Promise
<
TransactionReceipt
>
{
throw
new
Error
(
'
Unsupported Method: waitForTransaction
'
)
throw
new
Error
(
`Unsupported Method: waitForTransaction with args transactionHash -
${
transactionHash
}
, confirmations -
${
confirmations
}
, timeout -
${
timeout
}
`
)
}
}
readonly
_isProvider
:
boolean
readonly
_isProvider
:
boolean
...
...
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