-
Notifications
You must be signed in to change notification settings - Fork 2
feat: sponsored burn ws sandbox #571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
199fc20
add sponsored bridging protocol
NikolasHaimerl d5bab14
trigger CI
NikolasHaimerl 648ec86
Merge branch 'stage' into nikolas/sponsored-protocol-ws-support
NikolasHaimerl 14189f4
add sponsored CCTP protocol
NikolasHaimerl 9fa9b6e
Merge branch 'stage' into nikolas/sponsored-burn-ws-sandbox
NikolasHaimerl 298543f
Merge branch 'stage' into nikolas/sponsored-burn-ws-sandbox
NikolasHaimerl b387c63
comment
NikolasHaimerl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...s/indexer-database/src/migrations/1767709500000-AddDataSourceToSponsoredDepositForBurn.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
|
||
| export class AddDataSourceToSponsoredDepositForBurn1767709500000 | ||
| implements MigrationInterface | ||
| { | ||
| name = "AddDataSourceToSponsoredDepositForBurn1767709500000"; | ||
|
|
||
| public async up(queryRunner: QueryRunner): Promise<void> { | ||
| await queryRunner.query( | ||
| `ALTER TABLE "evm"."sponsored_deposit_for_burn" ADD "dataSource" "evm"."datasource_type_enum" DEFAULT 'polling'`, | ||
| ); | ||
| } | ||
|
|
||
| public async down(queryRunner: QueryRunner): Promise<void> { | ||
| await queryRunner.query( | ||
| `ALTER TABLE "evm"."sponsored_deposit_for_burn" DROP COLUMN "dataSource"`, | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,28 @@ const PK_CHAIN_BLOCK_TX_LOG = [ | |
| "logIndex", | ||
| ]; | ||
|
|
||
| /** | ||
| * Stores a DepositForBurn event in the database. | ||
| * | ||
| * @param event The DepositForBurn entity to store. | ||
|
Comment on lines
+13
to
+15
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| * @param repository The BlockchainEventRepository instance. | ||
| * @returns A promise that resolves to the result of the save operation. | ||
| */ | ||
| export const storeSponsoredDepositForBurnEvent: Storer< | ||
| Partial<entities.SponsoredDepositForBurn>, | ||
| dbUtils.BlockchainEventRepository | ||
| > = async ( | ||
| event: Partial<entities.SponsoredDepositForBurn>, | ||
| repository: dbUtils.BlockchainEventRepository, | ||
| ) => { | ||
| return repository.saveAndHandleFinalisationBatch<entities.SponsoredDepositForBurn>( | ||
| entities.SponsoredDepositForBurn, | ||
| [{ ...event, dataSource: DataSourceType.WEB_SOCKET } as any], | ||
| PK_CHAIN_BLOCK_TX_LOG as (keyof entities.SponsoredDepositForBurn)[], | ||
| [], | ||
| ); | ||
| }; | ||
|
|
||
| /** | ||
| * Stores a DepositForBurn event in the database. | ||
| * | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that we're going the fetch events separately. OOC why is the
destinationChainIdneeded to be associated with the SponsoredDepositForBurn? Is it for formatting addresses?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is for formatting addresses, we do the same for the regular CCTP indexer here:
indexer/packages/indexer/src/data-indexing/service/CCTPIndexerDataHandler.ts
Line 530 in 4893a59
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean with events being fetched separately?
The websocket listens to DepositForBurn and SponsoredDepositForBurn separately.
indexer/packages/indexer/src/data-indexing/service/config.ts
Line 104 in 0fe0880