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
f8b5803a
Unverified
Commit
f8b5803a
authored
Mar 06, 2022
by
Matthew Slipper
Committed by
GitHub
Mar 06, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2263 from tonykogias/remove-unused-function-contracts-package
cleanup(contracts): remove unused code
parents
82465db9
b6a4fa4b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
52 deletions
+12
-52
healthy-otters-yawn.md
.changeset/healthy-otters-yawn.md
+5
-0
contract-defs.ts
packages/contracts/src/contract-defs.ts
+0
-28
constants.ts
packages/contracts/test/helpers/constants.ts
+0
-3
trie-test-generator.ts
packages/contracts/test/helpers/trie/trie-test-generator.ts
+6
-6
eth-time.ts
packages/contracts/test/helpers/utils/eth-time.ts
+1
-15
No files found.
.changeset/healthy-otters-yawn.md
0 → 100644
View file @
f8b5803a
---
'
@eth-optimism/contracts'
:
patch
---
Removes outdated functions and constants from the contracts package
packages/contracts/src/contract-defs.ts
View file @
f8b5803a
...
@@ -30,31 +30,3 @@ export const getContractFactory = (
...
@@ -30,31 +30,3 @@ export const getContractFactory = (
signer
signer
)
)
}
}
export
const
loadContract
=
(
name
:
string
,
address
:
string
,
provider
:
ethers
.
providers
.
JsonRpcProvider
):
ethers
.
Contract
=>
{
return
new
ethers
.
Contract
(
address
,
getContractInterface
(
name
)
as
any
,
provider
)
}
export
const
loadContractFromManager
=
async
(
args
:
{
name
:
string
proxy
?:
string
Lib_AddressManager
:
ethers
.
Contract
provider
:
ethers
.
providers
.
JsonRpcProvider
}):
Promise
<
ethers
.
Contract
>
=>
{
const
{
name
,
proxy
,
Lib_AddressManager
,
provider
}
=
args
const
address
=
await
Lib_AddressManager
.
getAddress
(
proxy
?
proxy
:
name
)
if
(
address
===
ethers
.
constants
.
AddressZero
)
{
throw
new
Error
(
`Lib_AddressManager does not have a record for a contract named:
${
name
}
`
)
}
return
loadContract
(
name
,
address
,
provider
)
}
packages/contracts/test/helpers/constants.ts
View file @
f8b5803a
/* External Imports */
/* External Imports */
import
{
defaultAccounts
}
from
'
ethereum-waffle
'
import
{
defaultAccounts
}
from
'
ethereum-waffle
'
export
const
DEFAULT_ACCOUNTS
=
defaultAccounts
export
const
DEFAULT_ACCOUNTS_HARDHAT
=
defaultAccounts
.
map
((
account
)
=>
{
export
const
DEFAULT_ACCOUNTS_HARDHAT
=
defaultAccounts
.
map
((
account
)
=>
{
return
{
return
{
balance
:
account
.
balance
,
balance
:
account
.
balance
,
...
@@ -10,10 +9,8 @@ export const DEFAULT_ACCOUNTS_HARDHAT = defaultAccounts.map((account) => {
...
@@ -10,10 +9,8 @@ export const DEFAULT_ACCOUNTS_HARDHAT = defaultAccounts.map((account) => {
})
})
export
const
RUN_OVM_TEST_GAS
=
20
_000_000
export
const
RUN_OVM_TEST_GAS
=
20
_000_000
export
const
FORCE_INCLUSION_PERIOD_SECONDS
=
600
export
const
L2_GAS_DISCOUNT_DIVISOR
=
32
export
const
L2_GAS_DISCOUNT_DIVISOR
=
32
export
const
ENQUEUE_GAS_COST
=
60
_000
export
const
ENQUEUE_GAS_COST
=
60
_000
export
const
FORCE_INCLUSION_PERIOD_BLOCKS
=
600
/
12
export
const
NON_NULL_BYTES32
=
export
const
NON_NULL_BYTES32
=
'
0x1111111111111111111111111111111111111111111111111111111111111111
'
'
0x1111111111111111111111111111111111111111111111111111111111111111
'
...
...
packages/contracts/test/helpers/trie/trie-test-generator.ts
View file @
f8b5803a
...
@@ -5,23 +5,23 @@ import { SecureTrie, BaseTrie } from 'merkle-patricia-tree'
...
@@ -5,23 +5,23 @@ import { SecureTrie, BaseTrie } from 'merkle-patricia-tree'
import
{
fromHexString
,
toHexString
}
from
'
@eth-optimism/core-utils
'
import
{
fromHexString
,
toHexString
}
from
'
@eth-optimism/core-utils
'
import
{
ethers
}
from
'
ethers
'
import
{
ethers
}
from
'
ethers
'
export
interface
TrieNode
{
interface
TrieNode
{
key
:
string
key
:
string
val
:
string
val
:
string
}
}
export
interface
InclusionProofTest
{
interface
InclusionProofTest
{
key
:
string
key
:
string
val
:
string
val
:
string
proof
:
string
proof
:
string
root
:
string
root
:
string
}
}
export
interface
NodeUpdateTest
extends
InclusionProofTest
{
interface
NodeUpdateTest
extends
InclusionProofTest
{
newRoot
:
string
newRoot
:
string
}
}
export
interface
EthereumAccount
{
interface
EthereumAccount
{
address
?:
string
address
?:
string
nonce
:
number
nonce
:
number
balance
:
number
balance
:
number
...
@@ -30,14 +30,14 @@ export interface EthereumAccount {
...
@@ -30,14 +30,14 @@ export interface EthereumAccount {
storage
?:
TrieNode
[]
storage
?:
TrieNode
[]
}
}
export
interface
AccountProofTest
{
interface
AccountProofTest
{
address
:
string
address
:
string
account
:
EthereumAccount
account
:
EthereumAccount
accountTrieWitness
:
string
accountTrieWitness
:
string
accountTrieRoot
:
string
accountTrieRoot
:
string
}
}
export
interface
AccountUpdateTest
extends
AccountProofTest
{
interface
AccountUpdateTest
extends
AccountProofTest
{
newAccountTrieRoot
:
string
newAccountTrieRoot
:
string
}
}
...
...
packages/contracts/test/helpers/utils/eth-time.ts
View file @
f8b5803a
...
@@ -17,24 +17,10 @@ export const increaseEthTime = async (
...
@@ -17,24 +17,10 @@ export const increaseEthTime = async (
await
mineBlock
(
provider
)
await
mineBlock
(
provider
)
}
}
export
const
mineBlock
=
async
(
const
mineBlock
=
async
(
provider
:
any
,
timestamp
?:
number
):
Promise
<
void
>
=>
{
provider
:
any
,
timestamp
?:
number
):
Promise
<
void
>
=>
{
await
provider
.
send
(
'
evm_mine
'
,
timestamp
?
[
timestamp
]
:
[])
await
provider
.
send
(
'
evm_mine
'
,
timestamp
?
[
timestamp
]
:
[])
}
}
export
const
getBlockTime
=
async
(
provider
:
any
,
block
?:
number
):
Promise
<
number
>
=>
{
await
mineBlock
(
provider
)
if
(
!!
block
)
{
block
=
await
getNextBlockNumber
(
provider
)
}
return
(
await
provider
.
getBlock
(
block
)).
timestamp
}
export
const
getNextBlockNumber
=
async
(
provider
:
any
):
Promise
<
number
>
=>
{
export
const
getNextBlockNumber
=
async
(
provider
:
any
):
Promise
<
number
>
=>
{
return
(
await
provider
.
getBlock
(
'
latest
'
)).
number
+
1
return
(
await
provider
.
getBlock
(
'
latest
'
)).
number
+
1
}
}
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