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
b031e697
Unverified
Commit
b031e697
authored
Sep 13, 2021
by
elenadimitrova
Committed by
Kelvin Fichter
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove read-proxy-event.spec.ts integration tests
parent
f20e9a12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
74 deletions
+0
-74
read-proxy-event.spec.ts
integration-tests/test/read-proxy-event.spec.ts
+0
-74
No files found.
integration-tests/test/read-proxy-event.spec.ts
deleted
100644 → 0
View file @
f20e9a12
import
{
expect
}
from
'
chai
'
import
{
ethers
}
from
'
hardhat
'
/* Imports: External */
import
{
Contract
,
Wallet
}
from
'
ethers
'
import
{
OptimismEnv
}
from
'
./shared/env
'
describe
(
'
Reading events from proxy contracts
'
,
()
=>
{
let
l2Wallet
:
Wallet
before
(
async
()
=>
{
const
env
=
await
OptimismEnv
.
new
()
l2Wallet
=
env
.
l2Wallet
})
// helper to query the transfers
const
_queryFilterTransfer
=
async
(
queryContract
:
Contract
,
filterContract
:
Contract
)
=>
{
// Get the filter
const
filter
=
filterContract
.
filters
.
Transfer
(
null
,
null
,
null
)
// Query the filter
return
queryContract
.
queryFilter
(
filter
,
0
,
'
latest
'
)
}
let
ProxyERC20
:
Contract
let
ERC20
:
Contract
beforeEach
(
async
()
=>
{
// Set up our contract factories in advance.
const
Factory__ERC20
=
await
ethers
.
getContractFactory
(
'
ChainlinkERC20
'
,
l2Wallet
)
const
Factory__UpgradeableProxy
=
await
ethers
.
getContractFactory
(
'
UpgradeableProxy
'
,
l2Wallet
)
// Deploy the underlying ERC20 implementation.
ERC20
=
await
Factory__ERC20
.
deploy
()
await
ERC20
.
deployTransaction
.
wait
()
// Deploy the upgradeable proxy and execute the init function.
ProxyERC20
=
await
Factory__UpgradeableProxy
.
deploy
(
ERC20
.
address
,
ERC20
.
interface
.
encodeFunctionData
(
'
init
'
,
[
1000
,
// initial supply
'
Cool Token Name Goes Here
'
,
// token name
])
)
await
ProxyERC20
.
deployTransaction
.
wait
()
ProxyERC20
=
new
ethers
.
Contract
(
ProxyERC20
.
address
,
ERC20
.
interface
,
l2Wallet
)
})
it
(
'
should read transfer events from a proxy ERC20
'
,
async
()
=>
{
// Make two transfers.
const
recipient
=
'
0x0000000000000000000000000000000000000000
'
const
transfer1
=
await
ProxyERC20
.
transfer
(
recipient
,
1
)
await
transfer1
.
wait
()
const
transfer2
=
await
ProxyERC20
.
transfer
(
recipient
,
1
)
await
transfer2
.
wait
()
// Make sure events are being emitted in the right places.
expect
((
await
_queryFilterTransfer
(
ERC20
,
ERC20
)).
length
).
to
.
eq
(
0
)
expect
((
await
_queryFilterTransfer
(
ERC20
,
ProxyERC20
)).
length
).
to
.
eq
(
0
)
expect
((
await
_queryFilterTransfer
(
ProxyERC20
,
ERC20
)).
length
).
to
.
eq
(
2
)
expect
((
await
_queryFilterTransfer
(
ProxyERC20
,
ProxyERC20
)).
length
).
to
.
eq
(
2
)
})
})
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