Skip to content

Commit

Permalink
Add base chain (#1579)
Browse files Browse the repository at this point in the history
* Ignore small differences of amounts when matching draft donation for … (#1573)

* Ignore small differences of amounts when matching draft donation for erc20

* Fix eslint errors

* Release Integrate QF with super fluid streamed donations (#1555)

* add activeQfRoundId to sortingBy InstantBoosting

* add orderBy totalDonations and totalReactions

* feat: add getRecurringDonationStats resolver

* fix filtering by QF

* remove qfRounds joins for non qf round filters

* add some temp logs

* remove temp logs

* fix: changes test cases of recuring donations stats
- create recored with createdAt field in past so test result won't be related to other endpoints test cases

* Fix projectActualserviceView

* fix stream balance depleted issue (#1496)

Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com>

* rebuild

* refresh and fetch user address separately (#1499)

* Added pg_trgm extension migration (#1502)

* fix: change recurring donations stats query to single query

* fix recurring donation count

* WIP: projectIds textArea

* fix actual matching cap (#1507)

* fix query error

* fix user donations count

* fix recurring donation count tests

* fix user recurring donation query

* fix user recurring donation test

* add donations relation to qfround

* add findArchivedQfRounds endpoint

* add findArchivedQfRounds endpoint

* feat: add sponsors & banner images upload

* add sortBy to findArchivedQfRounds

* 1.23.3

* add new test graphql query

* add tests for new QfArchivedRounds

* fixes on qfArchivedRounds query

* add new tests for qfArchivedRounds query

* fix findArchivedQfRounds tests

* fix: keep already uploaded sponsors images

* fix skip and limit for findArchivedQfRounds

* Add logs and refactor the bootstrap code to help investigate latency problem

* Add poolSize to orm config

* Fix eslint errors

* remove changing squareRootSumOfProjects when cap is overflown

* Trigger ortto activity when user saves their profile info for the first time (#1520)

* add newUser to updateUser query

* add createOrttoProfile

* add createOrttoProfile to NotificationAdapterInterface

* add createOrttoProfile to MockNotificationAdapter

* add CREATE_ORTTO_PROFILE event

* Allow to set the matching pool token & amount to be something other than usd (#1517)

* Allow to set the matching pool token & amount to be something other than USD in adminjs

* Allow to set the matching pool token & amount to be something other than USD in QFRound table

* add null to allocatedTokenSymbol and allocatedTokenChainId

* add nullable true to allocatedTokenSymbol and allocatedTokenChainId

* add allocatedFundUSDPreferred and allocatedFundUSD to qfRound

* Comment migrations

* Hotfix db improvements (#1523)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

* add qfRound to qfRoundStats

* fix qfRoundStatsQuery

* Hotfix staging fix latency (#1528)

* add project donation summary view entity

* convert projectQueries to querybuilder

* add cache to projectDonationSummary queries

* add configurable cache to slow queries

* remove massive recurring donation log

* add await for project queries

* Add logs to projectVerificationForm

* Add logs to projectVerificationForm

* fix: add project Ids list textarea for qf round edit

* Master to staging (#1543)

* Hotfix db improvements (#1523) (#1524)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* Fix/db replica production (#1525)

* Hotfix db improvements (#1523)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

* Define db read only configs

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* update comment

* Hotfix latency issues for prod (#1529)

* Hotfix staging fix latency (#1528)

* add project donation summary view entity

* convert projectQueries to querybuilder

* add cache to projectDonationSummary queries

* add configurable cache to slow queries

* remove massive recurring donation log

* add await for project queries

* Add informative logs for draft donation service job (#1537)

* Fix eslint errors

* Fix/master test (#1541)

* Fixed master test issue

* Returned test to master pipeline

* Comment executing donation summary view

---------

Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com>

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>
Co-authored-by: Carlos <carlos.quintero096@gmail.com>
Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com>

* Fix/word similarity - staging (#1546)

* Hotfix db improvements (#1523) (#1524)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* Fix/db replica production (#1525)

* Hotfix db improvements (#1523)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

* Define db read only configs

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* update comment

* Hotfix latency issues for prod (#1529)

* Hotfix staging fix latency (#1528)

* add project donation summary view entity

* convert projectQueries to querybuilder

* add cache to projectDonationSummary queries

* add configurable cache to slow queries

* remove massive recurring donation log

* add await for project queries

* Add informative logs for draft donation service job (#1537)

* Fix eslint errors

* Fix/master test (#1541)

* Fixed master test issue

* Returned test to master pipeline

* Comment executing donation summary view

---------

Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com>

* Fixed word similarity issue

* Removed unused import

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>
Co-authored-by: Carlos <carlos.quintero096@gmail.com>
Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com>

* remove refresh_project_summary_from totals and add user cache (#1539)

* Remove users field from project

* Remove users field from filterProjectsQuery

* Remove projects field from user

* remove added logs

* fix eslint errors

* remove users from Project.create

* remove users from Project.create in testUtils.ts

* remove projectOwnerId

* replace admin with adminUserId

* Add recurring donation join to donations() endpoint (#1554)

related to #1483

* replace admin with adminUserId in SEED data

* replace admin with adminUserId

* replace admin with adminUserId in projectResolver.ts

* replace admin with adminUserId in projectsTab.ts

* replace admin with adminUserId in projectResolver.test.ts

* replace admin with adminUserId in projectResolver.ts

* add allocatedFundUSD and allocatedTokenSymbol to qfArchivedRounds

* fix nullable

* remove admin from project

* replace admin with adminUserId

* replace admin with adminUserId

* add adminUserId field

* drop admin column

* fix: add telegram to ProjectSocialMediaType enum to allow adding telegram url

* Add some logs

* Fix eslint errors

* Add maxQueuedJobs for draft donation worker

* Fix eslint errors

* fix unstable test case

* Disable concurrency for draft donation worker

* add indexes to project_summary_view (#1568)

* improve projectBySlug query

* fix: change output types to float

* Ignore small differences of amounts when matching draft donation for erc20

* add graphql-fields

* add getVerificationFormStatusByProjectId

* refactor projectBySlug

* add findProjectIdBySlug

* fix projectBySlug tests with new changes

* fix projectBySlug tests with new changes

* fix projectBySlug tests with new changes

* remove projectVerificationForm assert

* add logs

* fix title in should return projects with indicated slug test

* Add streamed mini donations to qf round (#1557)

* Add streamed mini donations to qf round

related to Giveth/giveth-dapps-v2#3284

* Fix eslint error

* Fix eslint errors

* make verificationFormStatus field public

* Reduce test runnning time (#1574)

* fix: reduce test runnning time

* fix: add permissions test case

* fix: add permissions test case

* fix: refactor (excluding permissions test cases from global beforeEach)

---------

Co-authored-by: Ramin <raminramazanpour@gmail.com>
Co-authored-by: Meriem-BM <barhoumi.meriem1@gmail.com>
Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>
Co-authored-by: Amin Latifi <a.latifi.al@gmail.com>
Co-authored-by: Carlos <carlos.quintero096@gmail.com>

* WIP add base network

* Continue on integrating with base chain

* Fix migrations

* Fix migrations

* Add test cases about filteriing base network

* Add BASE node http urls for rpc

* Add BASE node http urls for rpc

* Add missing things for integrating with base

* Fix creating new token with coingeckoId

related to #1564

* Fill base mainnet tokens

related to #1561

---------

Co-authored-by: Ramin <raminramazanpour@gmail.com>
Co-authored-by: Meriem-BM <barhoumi.meriem1@gmail.com>
Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>
Co-authored-by: Amin Latifi <a.latifi.al@gmail.com>
Co-authored-by: Carlos <carlos.quintero096@gmail.com>
  • Loading branch information
6 people authored May 27, 2024
1 parent 0e62006 commit b1ce41c
Show file tree
Hide file tree
Showing 23 changed files with 638 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/develop-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ jobs:
CELO_ALFAJORES_SCAN_API_KEY: ${{ secrets.CELO_ALFAJORES_SCAN_API_KEY }}
ARBITRUM_SCAN_API_KEY: ${{ secrets.ARBITRUM_SCAN_API_KEY }}
ARBITRUM_SEPOLIA_SCAN_API_KEY: ${{ secrets.ARBITRUM_SEPOLIA_SCAN_API_KEY }}
BASE_SCAN_API_KEY: ${{ secrets.BASE_SCAN_API_KEY }}
BASE_SEPOLIA_SCAN_API_KEY: ${{ secrets.BASE_SEPOLIA_SCAN_API_KEY }}
MORDOR_ETC_TESTNET: ${{ secrets.MORDOR_ETC_TESTNET }}
ETC_NODE_HTTP_URL: ${{ secrets.ETC_NODE_HTTP_URL }}
SOLANA_TEST_NODE_RPC_URL: ${{ secrets.SOLANA_TEST_NODE_RPC_URL }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/master-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ jobs:
CELO_ALFAJORES_SCAN_API_KEY: ${{ secrets.CELO_ALFAJORES_SCAN_API_KEY }}
ARBITRUM_SCAN_API_KEY: ${{ secrets.ARBITRUM_SCAN_API_KEY }}
ARBITRUM_SEPOLIA_SCAN_API_KEY: ${{ secrets.ARBITRUM_SEPOLIA_SCAN_API_KEY }}
BASE_SCAN_API_KEY: ${{ secrets.BASE_SCAN_API_KEY }}
BASE_SEPOLIA_SCAN_API_KEY: ${{ secrets.BASE_SEPOLIA_SCAN_API_KEY }}
MORDOR_ETC_TESTNET: ${{ secrets.MORDOR_ETC_TESTNET }}
ETC_NODE_HTTP_URL: ${{ secrets.ETC_NODE_HTTP_URL }}
DROP_DATABASE: ${{ secrets.DROP_DATABASE_DURING_TEST_PROD }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/staging-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ jobs:
CELO_ALFAJORES_SCAN_API_KEY: ${{ secrets.CELO_ALFAJORES_SCAN_API_KEY }}
ARBITRUM_SCAN_API_KEY: ${{ secrets.ARBITRUM_SCAN_API_KEY }}
ARBITRUM_SEPOLIA_SCAN_API_KEY: ${{ secrets.ARBITRUM_SEPOLIA_SCAN_API_KEY }}
BASE_SCAN_API_KEY: ${{ secrets.BASE_SCAN_API_KEY }}
BASE_SEPOLIA_SCAN_API_KEY: ${{ secrets.BASE_SEPOLIA_SCAN_API_KEY }}
MORDOR_ETC_TESTNET: ${{ secrets.MORDOR_ETC_TESTNET }}
ETC_NODE_HTTP_URL: ${{ secrets.ETC_NODE_HTTP_URL }}
DROP_DATABASE: ${{ secrets.DROP_DATABASE_DURING_TEST_STAGING }}
Expand Down
11 changes: 11 additions & 0 deletions config/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,14 @@ ENABLE_DRAFT_RECURRING_DONATION=true
DRAFT_RECURRING_DONATION_MATCH_EXPIRATION_HOURS=24

OPTIMISTIC_SEPOLIA_SCAN_API_KEY=

BASE_SCAN_API_URL=https://api.basescan.org/api
BASE_SCAN_API_KEY=0000000000000000000000000000000000
BASE_SEPOLIA_SCAN_API_URL=https://api-sepolia.basescan.org/api
BASE_SEPOLIA_SCAN_API_KEY=0000000000000000000000000000000000

# BASE MAINNET
BASE_MAINNET_NODE_HTTP_URL=

# BASE SEPOLIA
BASE_SEPOLIA_NODE_HTTP_URL=
6 changes: 6 additions & 0 deletions config/test.env
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ ARBITRUM_SCAN_API_URL=https://api.arbiscan.io/api
ARBITRUM_SCAN_API_KEY=0000000000000000000000000000000000
ARBITRUM_SEPOLIA_SCAN_API_URL=https://api-sepolia.arbiscan.io/api
ARBITRUM_SEPOLIA_SCAN_API_KEY=0000000000000000000000000000000000

BASE_SCAN_API_URL=https://api.basescan.org/api
BASE_SCAN_API_KEY=0000000000000000000000000000000000
BASE_SEPOLIA_SCAN_API_URL=https://api-sepolia.basescan.org/api
BASE_SEPOLIA_SCAN_API_KEY=0000000000000000000000000000000000

GNOSISSCAN_API_URL=https://api.gnosisscan.io/api
ETHERSCAN_API_KEY=00000000000000000000000000000000
GNOSISSCAN_API_KEY=0000000000000000000000000000000000
Expand Down
55 changes: 55 additions & 0 deletions migration/1716367359560-add_base_chain_tokens.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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 AddBaseChainTokens1716367359560 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
const environment = config.get('ENVIRONMENT') as string;

const networkId =
environment === 'production'
? NETWORK_IDS.BASE_MAINNET
: NETWORK_IDS.BASE_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 Base 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> {
//
}
}
Loading

0 comments on commit b1ce41c

Please sign in to comment.