-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added arbitrum secret keys * Added arbitrum seed tokens * Fixed test issue * Added acceptFunOnArbitrumFilter * Removed .only attribute from a test had remained by mistake * Added token verification tests * Updated validators to support arbitrum * Fixed coingecko id of TrueUsd * Changed a test description
- Loading branch information
1 parent
56f9f85
commit ea652a5
Showing
26 changed files
with
2,720 additions
and
1,849 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
import { Token } from '../src/entities/token'; | ||
import seedTokens from './data/seedTokens'; | ||
import config from '../src/config'; | ||
import { NETWORK_IDS } from '../src/provider'; | ||
|
||
export class AddArbitrumTokens1708279692128 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const environment = config.get('ENVIRONMENT') as string; | ||
|
||
const networkId = | ||
environment === 'production' | ||
? NETWORK_IDS.ARBITRUM_MAINNET | ||
: NETWORK_IDS.ARBITRUM_SEPOLIA; | ||
|
||
await queryRunner.manager.save( | ||
Token, | ||
seedTokens | ||
.filter(token => token.networkId === networkId) | ||
.map(token => { | ||
const t = { | ||
...token, | ||
}; | ||
t.address = t.address?.toLowerCase(); | ||
delete t.chainType; | ||
return t; | ||
}), | ||
); | ||
const tokens = await queryRunner.query(` | ||
SELECT * FROM token | ||
WHERE "networkId" = ${networkId} | ||
`); | ||
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) { | ||
// Add all Polygon tokens to Giveth organization | ||
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> {} | ||
} |
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
Oops, something went wrong.