-
Notifications
You must be signed in to change notification settings - Fork 18
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
Feature add optimism goerli network #1039
Merged
mohammadranjbarz
merged 8 commits into
staging
from
feature_add_optimism_goerli_network
Jun 26, 2023
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9255b80
add optimism goerli configuration
CarlosQ96 8201bd0
add optimism goerli tokens
CarlosQ96 710a5c9
update tests and env vars for optimism goerli
CarlosQ96 5a420d8
add test to verify optimism goerli donation
CarlosQ96 182de73
add goerli optimism test for transaction details
CarlosQ96 d5933ed
add optimism goerli tokens for test envs
CarlosQ96 1d73216
add optimism goerli donation sync tests
CarlosQ96 70c4077
prevent adding testnet optimism-goerli tokens in production
CarlosQ96 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 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 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 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,57 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
import { Token } from '../src/entities/token'; | ||
import seedTokens from './data/seedTokens'; | ||
import { NETWORK_IDS } from '../src/provider'; | ||
|
||
export class AddOptimismGoerliTokens1687383705794 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.manager.save( | ||
Token, | ||
seedTokens | ||
.filter(token => token.networkId === NETWORK_IDS.OPTIMISM_GOERLI) | ||
.map(t => { | ||
t.address = t.address?.toLowerCase(); | ||
return t; | ||
}), | ||
); | ||
const tokens = await queryRunner.query(` | ||
SELECT * FROM token | ||
WHERE "networkId" = ${NETWORK_IDS.OPTIMISM_GOERLI} | ||
`); | ||
const givethOrganization = ( | ||
await queryRunner.query(`SELECT * FROM organization | ||
WHERE label='giveth'`) | ||
)[0]; | ||
const traceOrganization = ( | ||
await queryRunner.query(`SELECT * FROM organization | ||
WHERE label='trace'`) | ||
)[0]; | ||
|
||
for (const token of tokens) { | ||
await queryRunner.query(`INSERT INTO organization_tokens_token ("tokenId","organizationId") VALUES | ||
(${token.id}, ${givethOrganization.id}), | ||
(${token.id}, ${traceOrganization.id}) | ||
;`); | ||
} | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
const tokens = await queryRunner.query(` | ||
SELECT * FROM token | ||
WHERE "networkId" = ${NETWORK_IDS.OPTIMISM_GOERLI} | ||
`); | ||
await queryRunner.query( | ||
`DELETE FROM organization_tokens_token WHERE "tokenId" IN (${tokens | ||
.map(token => token.id) | ||
.join(',')})`, | ||
); | ||
await queryRunner.query( | ||
` | ||
DELETE from token | ||
WHERE "networkId" = ${NETWORK_IDS.OPTIMISM_GOERLI} | ||
`, | ||
); | ||
} | ||
} |
This file contains 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 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 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 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 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 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 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 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 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 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
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 think you need to add a condition to not add these test tokens in production env