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
c4120a2f
Unverified
Commit
c4120a2f
authored
Mar 16, 2022
by
smartcontracts
Committed by
GitHub
Mar 16, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2330 from ethereum-optimism/sc/sdk-rm-messages-fn
fix(sdk): comment out getMessagesByAddress
parents
86b34454
d49feca1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
38 deletions
+47
-38
slimy-walls-appear.md
.changeset/slimy-walls-appear.md
+5
-0
cross-chain-messenger.ts
packages/sdk/src/cross-chain-messenger.ts
+16
-16
cross-chain-messenger.ts
packages/sdk/src/interfaces/cross-chain-messenger.ts
+24
-21
cross-chain-messenger.spec.ts
packages/sdk/test/cross-chain-messenger.spec.ts
+2
-1
No files found.
.changeset/slimy-walls-appear.md
0 → 100644
View file @
c4120a2f
---
'
@eth-optimism/sdk'
:
patch
---
Comment out non-functional getMessagesByAddress function
packages/sdk/src/cross-chain-messenger.ts
View file @
c4120a2f
...
@@ -208,22 +208,22 @@ export class CrossChainMessenger implements ICrossChainMessenger {
...
@@ -208,22 +208,22 @@ export class CrossChainMessenger implements ICrossChainMessenger {
})
})
}
}
public
async
getMessagesByAddress
(
//
public async getMessagesByAddress(
address
:
AddressLike
,
//
address: AddressLike,
opts
?:
{
//
opts?: {
direction
?:
MessageDirection
//
direction?: MessageDirection
fromBlock
?:
NumberLike
//
fromBlock?: NumberLike
toBlock
?:
NumberLike
//
toBlock?: NumberLike
}
//
}
):
Promise
<
CrossChainMessage
[]
>
{
//
): Promise<CrossChainMessage[]> {
throw
new
Error
(
`
//
throw new Error(`
The function getMessagesByAddress is currently not enabled because the sender parameter of
//
The function getMessagesByAddress is currently not enabled because the sender parameter of
the SentMessage event is not indexed within the CrossChainMessenger contracts.
//
the SentMessage event is not indexed within the CrossChainMessenger contracts.
getMessagesByAddress will be enabled by plugging in an Optimism Indexer (coming soon).
//
getMessagesByAddress will be enabled by plugging in an Optimism Indexer (coming soon).
See the following issue on GitHub for additional context:
//
See the following issue on GitHub for additional context:
https://github.com/ethereum-optimism/optimism/issues/2129
//
https://github.com/ethereum-optimism/optimism/issues/2129
`
)
//
`)
}
//
}
public
async
getBridgeForTokenPair
(
public
async
getBridgeForTokenPair
(
l1Token
:
AddressLike
,
l1Token
:
AddressLike
,
...
...
packages/sdk/src/interfaces/cross-chain-messenger.ts
View file @
c4120a2f
...
@@ -103,27 +103,30 @@ export interface ICrossChainMessenger {
...
@@ -103,27 +103,30 @@ export interface ICrossChainMessenger {
}
}
):
Promise
<
CrossChainMessage
[]
>
):
Promise
<
CrossChainMessage
[]
>
/**
// TODO: Make this function work. Likely requires indexer or the function will be prohibitively
* Retrieves all cross chain messages sent by a particular address.
// slow to query all of the necessary data.
*
//
* @param address Address to search for messages from.
// /**
* @param opts Options object.
// * Retrieves all cross chain messages sent by a particular address.
* @param opts.direction Direction to search for messages in. If not provided, will attempt to
// *
* find all messages in both directions.
// * @param address Address to search for messages from.
* @param opts.fromBlock Block to start searching for messages from. If not provided, will start
// * @param opts Options object.
* from the first block (block #0).
// * @param opts.direction Direction to search for messages in. If not provided, will attempt to
* @param opts.toBlock Block to stop searching for messages at. If not provided, will stop at the
// * find all messages in both directions.
* latest known block ("latest").
// * @param opts.fromBlock Block to start searching for messages from. If not provided, will start
* @returns All cross chain messages sent by the particular address.
// * from the first block (block #0).
*/
// * @param opts.toBlock Block to stop searching for messages at. If not provided, will stop at the
getMessagesByAddress
(
// * latest known block ("latest").
address
:
AddressLike
,
// * @returns All cross chain messages sent by the particular address.
opts
?:
{
// */
direction
?:
MessageDirection
// getMessagesByAddress(
fromBlock
?:
NumberLike
// address: AddressLike,
toBlock
?:
NumberLike
// opts?: {
}
// direction?: MessageDirection
):
Promise
<
CrossChainMessage
[]
>
// fromBlock?: NumberLike
// toBlock?: NumberLike
// }
// ): Promise<CrossChainMessage[]>
/**
/**
* Finds the appropriate bridge adapter for a given L1<>L2 token pair. Will throw if no bridges
* Finds the appropriate bridge adapter for a given L1<>L2 token pair. Will throw if no bridges
...
...
packages/sdk/test/cross-chain-messenger.spec.ts
View file @
c4120a2f
...
@@ -383,7 +383,8 @@ describe('CrossChainMessenger', () => {
...
@@ -383,7 +383,8 @@ describe('CrossChainMessenger', () => {
})
})
})
})
describe
(
'
getMessagesByAddress
'
,
()
=>
{
// Skipped until getMessagesByAddress can be implemented
describe
.
skip
(
'
getMessagesByAddress
'
,
()
=>
{
describe
(
'
when the address has sent messages
'
,
()
=>
{
describe
(
'
when the address has sent messages
'
,
()
=>
{
describe
(
'
when no direction is specified
'
,
()
=>
{
describe
(
'
when no direction is specified
'
,
()
=>
{
it
(
'
should find all messages sent by the address
'
)
it
(
'
should find all messages sent by the address
'
)
...
...
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