-
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.
* Verify transfer spl-token on solana, supporting multi chain solana related to #1175 * fix solana tests on devnet * add solana additional tokens * fix solana token transfer test * improve joi schema chaintype validator * Add another spl-token transfer test case, change validator of createDonation webservice related to #1232 (comment) * Refactor and change a nested if-else with witch case * Removed only tags from tests * Update src/utils/errorMessages.ts Co-authored-by: Amin Latifi <[email protected]> * Update src/utils/locales/en.json Co-authored-by: Amin Latifi <[email protected]> * Fill networkId for solana addresses when create/update projects * Add some test tokens for solana dev chain * Import lost donations into DB cronjob (#1236) * import donations from env vars and add tests * Read LOST_DONATIONS_TX_HASHES from .env instead of config * Fix build error --------- Co-authored-by: Amin Latifi <[email protected]> Co-authored-by: Mohammad Ranjbar Z <[email protected]> * setup notification center disabling and reduce notifications * Change filling networkId for solana * Fix migration files for adding spl tokens on solana * Modify create donation test cases for check filling networkId of solana donations * comment out notification center methods interface * Revert "comment out notification center methods interface" This reverts commit 4a6dd8c. * set logic as before, comment notification center methods not required * move donation received logic to notification adapter * Refactor get networkId for solana addresses and implement getAppropriateNetworkId * Fix filling solana donations price (#1252) * Fix filling solana donations price related to Giveth/giveth-dapps-v2#3394 (comment) * Add informative logs for filling value usd part * Add log for createDonation webservice * change type of transactionNetworkId to number in ajv schema * Update createDonation to use correct networkId * Added jobId to donation verification queue * fix test env * Import from Donation Backup Service (#1253) * Added Donation Save Backup Adapter * add backup service import cronjob * add interface of used params from mongo data * Change loading urls for backup service * Refactor donationSaveBackupAdapter and adding mock adapter * Removed unused package script * Refactored createBackupDonation to reuse resolver * Fix createBackupDonation() and write test case for that * Add importError to failed donation mongo backup --------- Co-authored-by: mohammadranjbarz <[email protected]> Co-authored-by: Carlos <[email protected]> * Fix query of getting failed donations from mongo API * Add more logs for importing failed donations * Change info logs to debug logs * 1.21.0 * Add importDate to donation entity * Fill importDate of donation correctly --------- Co-authored-by: Mohammad Ranjbar Z <[email protected]> Co-authored-by: Carlos <[email protected]> Co-authored-by: CarlosQ96 <[email protected]>
- Loading branch information
1 parent
297bf38
commit 262be4d
Showing
61 changed files
with
1,622 additions
and
372 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,62 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
import { Token } from '../src/entities/token'; | ||
import seedTokens from './data/seedTokens'; | ||
import { NETWORK_IDS } from '../src/provider'; | ||
import { ChainType } from '../src/types/network'; | ||
import { SOLANA_SYSTEM_PROGRAM } from '../src/utils/networks'; | ||
import { ENVIRONMENTS } from '../src/utils/utils'; | ||
|
||
export class addSolanaSplTokens1704487070444 implements MigrationInterface { | ||
async up(queryRunner: QueryRunner): Promise<void> { | ||
let tokensData; | ||
if (process.env.ENVIRONMENT === ENVIRONMENTS.PRODUCTION) { | ||
tokensData = seedTokens.filter( | ||
token => | ||
token.networkId === NETWORK_IDS.SOLANA_MAINNET && | ||
token.address !== SOLANA_SYSTEM_PROGRAM, | ||
); | ||
} else { | ||
tokensData = seedTokens.filter( | ||
token => | ||
token.networkId === NETWORK_IDS.SOLANA_DEVNET && | ||
token.address !== SOLANA_SYSTEM_PROGRAM, | ||
); | ||
} | ||
await queryRunner.manager.save(Token, tokensData); | ||
const tokens = await queryRunner.query( | ||
`SELECT * FROM token WHERE "chainType" = $1 AND "address" != $2`, | ||
[ChainType.SOLANA, SOLANA_SYSTEM_PROGRAM], | ||
); | ||
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 ($1, $2), ($1, $3)`, | ||
[token.id, givethOrganization.id, traceOrganization.id], | ||
); | ||
} | ||
} | ||
|
||
async down(queryRunner: QueryRunner): Promise<void> { | ||
const tokens = await queryRunner.query( | ||
`SELECT * FROM token WHERE "chainType" = $1 AND "address" != $2`, | ||
[ChainType.SOLANA, SOLANA_SYSTEM_PROGRAM], | ||
); | ||
await queryRunner.query( | ||
`DELETE FROM organization_tokens_token WHERE "tokenId" IN (${tokens | ||
.map(token => token.id) | ||
.join(',')})`, | ||
); | ||
await queryRunner.query( | ||
`DELETE FROM token WHERE "chainType" = $1 AND "address" != $2`, | ||
[ChainType.SOLANA, SOLANA_SYSTEM_PROGRAM], | ||
); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
migration/1706012712969-add_import_date_to_donation_entity.ts
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,15 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class addImportDateToDonationEntity1706012712969 | ||
implements MigrationInterface | ||
{ | ||
async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "donation" ADD COLUMN IF NOT EXISTS "importDate" TIMESTAMP WITH TIME ZONE`, | ||
); | ||
} | ||
|
||
async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "donation" DROP COLUMN "importDate"`); | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.