-
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
Merge master into staging #1807
Closed
Changes from 3 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
1c3a62c
Merge pull request #1783 from Giveth/staging
CarlosQ96 082848e
Next release sep 2024 (#1804)
mohammadranjbarz e643491
fix: add time condition to filter out old transactions (#1806)
Meriem-BM b144410
Update README.md to force CI deployment
geleeroyale 165d6b1
Change donation verification logic for imported and draft donations (…
mohammadranjbarz b8a47ba
Release 17 Sep (#1826)
mohammadranjbarz c785ce7
add chaintype and solana networks to tokenTab
CarlosQ96 108fe40
Merge pull request #1828 from Giveth/release_improve_token_networks_a…
CarlosQ96 37b9794
Add sponsor donations round 70 (#1824)
mohammadranjbarz f129c51
Fix linter errors
mohammadranjbarz 312a395
Change compare logic in draft donation service (#1823)
mohammadranjbarz 5e1b811
feat: stellar. add stellar into qf rounds
HrithikSampson cd4de51
Merge pull request #1835 from Giveth/add-stellar-into-qf-round
RamRamez fd1617b
fix eslint error
RamRamez d0eefa4
Merge pull request #1836 from Giveth/fix-eslint-error
RamRamez 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
101 changes: 101 additions & 0 deletions
101
migration/1724368995904-add_banner_endaoment_projects.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,101 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
import { endaomentProjects } from './data/importedEndaomentProjects'; | ||
import { endaomentProjectCategoryMapping } from './data/endaomentProjectCategoryMapping'; | ||
import { NETWORK_IDS } from '../src/provider'; | ||
|
||
export class AddBannerEndaomentProjects1724368995904 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const imageCategoryMapping = { | ||
'Public Goods': 'community', | ||
'Peace & Justice': 'community', | ||
'Sustainable Cities & Communities': 'nature', | ||
Housing: 'community', | ||
'Social Services': 'community', | ||
'Family & Children': 'community', | ||
'Health Care': 'community', | ||
'Registered Non-profits': 'non-profit', | ||
Research: 'education', | ||
'Mental Health': 'health-wellness', | ||
Animals: 'nature', | ||
Nutrition: 'health-wellness', | ||
Religious: 'community', | ||
Art: 'art-culture', | ||
Food: 'community', | ||
'Disaster Relief': 'non-profit', | ||
'Conservation & Biodiversity': 'nature', | ||
Education: 'education', | ||
'Industry & Innovation': 'economics-infrastructure', | ||
'Financial Services': 'finance', | ||
Schooling: 'education', | ||
Inclusion: 'equality', | ||
Climate: 'nature', | ||
'Water & Sanitation': 'community', | ||
Tech: 'technology', | ||
Employment: 'finance', | ||
Infrastructure: 'economics-infrastructure', | ||
'International Aid': 'non-profit', | ||
Other: '1', | ||
Recreation: 'community', | ||
Culture: 'art-culture', | ||
Recycling: 'nature', | ||
Agriculture: 'nature', | ||
Grassroots: 'community', | ||
'BIPOC Communities': 'equality', | ||
Fundraising: 'non-profit', | ||
'Registred Non-profits': 'non-profit', | ||
'Gender Equality': 'equality', | ||
}; | ||
|
||
for (const project of endaomentProjects) { | ||
const mainnetAddress = project.mainnetAddress; | ||
const projectAddresses = await queryRunner.query( | ||
`SELECT * FROM project_address WHERE LOWER(address) = $1 AND "networkId" = $2 LIMIT 1`, | ||
[mainnetAddress!.toLowerCase(), NETWORK_IDS.MAIN_NET], | ||
); | ||
|
||
const projectAddress = await projectAddresses?.[0]; | ||
|
||
if (!projectAddress) { | ||
// eslint-disable-next-line no-console | ||
console.log(`Could not find project address for ${mainnetAddress}`); | ||
continue; | ||
} | ||
|
||
// Insert the project-category relationship in a single query | ||
const getCategoryNames = (nteeCode: string): string[] => { | ||
const mapping = endaomentProjectCategoryMapping.find( | ||
category => category.nteeCode === nteeCode, | ||
); | ||
return mapping | ||
? [ | ||
mapping.category1, | ||
mapping.category2, | ||
mapping.category3 || '', | ||
mapping.category4 || '', | ||
].filter(Boolean) | ||
: []; | ||
}; | ||
if (!project.nteeCode) { | ||
// eslint-disable-next-line no-console | ||
console.log(`Could not find nteeCode for ${mainnetAddress}`); | ||
continue; | ||
} | ||
const categoryNames = getCategoryNames(String(project.nteeCode)); | ||
const bannerImage = `/images/defaultProjectImages/${imageCategoryMapping[categoryNames[1]] || '1'}.png`; | ||
await queryRunner.query(`UPDATE project SET image = $1 WHERE id = $2`, [ | ||
bannerImage, | ||
projectAddress.projectId, | ||
]); | ||
// eslint-disable-next-line no-console | ||
console.log( | ||
`Updated project ${projectAddress.projectId} with image ${bannerImage}`, | ||
); | ||
} | ||
} | ||
|
||
public async down(_queryRunner: QueryRunner): Promise<void> { | ||
// No down migration | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
migration/1725188424424-UniqueProjectAdressWithMomoForStellar.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,19 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class UniqueProjectAdressWithMomoForStellar1725188424424 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
CREATE UNIQUE INDEX unique_stellar_address | ||
ON project_address (address, memo) | ||
WHERE "chainType" = 'STELLAR'; | ||
`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
DROP INDEX unique_stellar_address; | ||
`); | ||
} | ||
} |
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
Oops, something went wrong.
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.
Tip
Codebase Verification
Function signature change verified, but test cases may need updating
The
validateProjectWalletAddress
function signature has been successfully updated to include the newmemo
parameter. The function definition and usage insrc/resolvers/projectResolver.ts
correctly incorporate this change.However, the test cases in
src/utils/validators/projectValidator.test.ts
do not include thememo
parameter in their function calls. These test cases should be reviewed and potentially updated to ensure they cover the new parameter:src/utils/validators/projectValidator.test.ts
Please review these test cases and update them as necessary to maintain comprehensive test coverage for the
validateProjectWalletAddress
function.Analysis chain
Verify the function signature change in the codebase.
The
validateProjectWalletAddress
function is now being invoked with an additionalmemo
parameter. Ensure that the function definition has been updated to accept this new parameter and that all other invocations of this function have been updated to pass thememo
argument.Run the following script to verify the function usage:
Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 91
Script:
Length of output: 8994