Skip to content

Commit

Permalink
tmp fix to huma mainnet deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernardo Vieira committed Oct 20, 2023
1 parent fcb17ee commit 31022a6
Show file tree
Hide file tree
Showing 15 changed files with 170 additions and 1,416 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
},
"homepage": "https://github.com/impactMarket/backend#readme",
"engines": {
"node": "18.x"
"node": "16.x"
},
"workspaces": [
"packages/*",
"services/*"
],
"devDependencies": {
"lerna": "^7.0.2",
"eslint-config-impact-market": "2.3.0"
"lerna": "^7.0.2"
},
"scripts": {
"dev": "lerna exec --scope @impactmarket/api yarn dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.0.0",
"license": "Apache-2.0",
"engines": {
"node": "18.x"
"node": "16.x"
},
"scripts": {
"dev": "nodemon --config nodemon.json src/app.ts",
Expand Down
3 changes: 1 addition & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.0.0",
"license": "Apache-2.0",
"engines": {
"node": "18.x"
"node": "16.x"
},
"scripts": {
"test": "NODE_ENV=test mocha",
Expand Down Expand Up @@ -44,7 +44,6 @@
"typescript": "5.2.2"
},
"dependencies": {
"@impact-market/subgraph": "1.0.2-beta.1",
"@faker-js/faker": "8.1.0",
"@prismicio/client": "7.2.0",
"@prismicio/helpers": "2.3.9",
Expand Down
11 changes: 6 additions & 5 deletions packages/core/src/config/validatenv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function validateEnv() {
devDefault: onlyOnTestEnv('xyz')
}),
IMPACT_MARKET_CONTRACT_BLOCK: num({ devDefault: 0 }),
ATTESTATION_PROXY_ADDRESS: str({ devDefault: onlyOnTestEnv('xyz') }),
ATTESTATION_PROXY_ADDRESS: str({ default: '0x0000000000000000000000000000000000000000' }),
// aws config
AWS_ACCESS_KEY_ID: str({ devDefault: onlyOnTestEnv('xyz') }),
AWS_SECRET_ACCESS_KEY: str({ devDefault: onlyOnTestEnv('xyz') }),
Expand All @@ -77,12 +77,12 @@ function validateEnv() {
SLACK_TOKEN: str({ default: 'xyz' }),
SLACK_LAMBDA_CHANNEL: str({ default: 'xyz' }),
SENDGRID_API_KEY: str({ default: 'xyz' }),
FIREBASE_FILE_BASE64: str({ devDefault: 'xyz' }),
FIREBASE_FILE_BASE64: str({ default: 'a0' }),
HAS_REDIS_TLS: bool({ default: true }),
MAX_REQUEST_PER_USER: num({ default: 900 }),
HUBSPOT_KEY: str({ devDefault: 'xyz' }),
DAO_CONTRACT_ADDRESS: str({ devDefault: onlyOnTestEnv('xyz') }),
COMMUNITY_ADMIN_ADDRESS: str({ devDefault: onlyOnTestEnv('xyz') }),
COMMUNITY_ADMIN_ADDRESS: str({ default: '0x0000000000000000000000000000000000000000' }),
MICROCREDIT_CONTRACT_ADDRESS: str({ devDefault: onlyOnTestEnv('xyz') }),
CLAIM_LOCATION_TIMEFRAME: num({ default: 150 }),
CLAIM_INACTIVITY_THRESHOLD: num({ default: 4 }),
Expand All @@ -102,7 +102,6 @@ function validateEnv() {
COUNCIL_SUBGRAPH_URL: str({ devDefault: onlyOnTestEnv('xyz') }),
MICROCREDIT_SUBGRAPH_URL: str({ devDefault: onlyOnTestEnv('xyz') }),
IMAGE_HANDLER_URL: str({ devDefault: onlyOnTestEnv('xyz') }),
LEARN_AND_EARN_PRIVATE_KEY: str({ devDefault: onlyOnTestEnv('xyz') }),
INTERVAL_BETWEEN_LESSONS: num({ default: 7 }),
DAYS_TO_LIMIT_USERS: num({ default: 30 }),
CRON_JOB_BATCH_SIZE: num({ default: 20 }),
Expand All @@ -122,8 +121,10 @@ function validateEnv() {
// hot wallet variables
HUMA_PRIVATE_KEY: str({ default: '0785969a6f070bce78c7259252413d3e5099e990c042b27c561d6af59c8e506e' }),
// wallets
// default keys are randomly generated on string generators
LEARN_AND_EARN_PRIVATE_KEY: str({ default: '3591c95d47c357aaec3dd1803cc0f2236e439366d69b19664a8e6b7a747ea0a2' }),
RECURRING_DONATION_PRIVATE_KEY: str({
default: 'xg8rprh6vzjja31xx2b6db5wwo2i5gmcc37c239wyp6jhyiefapev5738nvj77c4'
default: '53c4687d6048f9e875049c36fdb466bd1a360e5e9a36965a1f5ff1d32ea45642'
})
});
}
Expand Down
7 changes: 3 additions & 4 deletions packages/core/src/subgraph/queries/manager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { CommunityEntity, ManagerEntity } from '@impact-market/subgraph';
import { queryAndTransformResponse } from './utils';

export const getCommunityManagers = async (
Expand All @@ -9,7 +8,7 @@ export const getCommunityManagers = async (
orderDirection?: string,
limit?: number,
offset?: number
): Promise<ManagerEntity[]> => {
): Promise<any[]> => {
const graphqlQuery = {
operationName: 'managerEntities',
query: `query managerEntities {
Expand Down Expand Up @@ -38,7 +37,7 @@ export const getCommunityManagers = async (
}`
};

return queryAndTransformResponse<ManagerEntity[]>(graphqlQuery);
return queryAndTransformResponse<any[]>(graphqlQuery);
};

export const countManagers = async (community: string, state?: number): Promise<number> => {
Expand All @@ -54,7 +53,7 @@ export const countManagers = async (community: string, state?: number): Promise<
}`
};

return queryAndTransformResponse<CommunityEntity, number>(graphqlQuery, v => {
return queryAndTransformResponse<any, number>(graphqlQuery, v => {
if (state === 0) {
return v.managers;
} else if (state === 1) {
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.0.0",
"license": "Apache-2.0",
"engines": {
"node": "18.x"
"node": "16.x"
},
"scripts": {
"test": "NODE_ENV=test mocha",
Expand Down
2 changes: 1 addition & 1 deletion services/authorizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "impact-market",
"license": "Apache-2.0",
"engines": {
"node": "18.x"
"node": "16.x"
},
"devDependencies": {
"@types/aws-lambda": "8.10.102",
Expand Down
2 changes: 2 additions & 0 deletions services/community-metrics/handler.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'cross-fetch/polyfill';
import {
calcuateCommunitiesDemographics,
calcuateCommunitiesMetrics,
Expand All @@ -13,6 +14,7 @@ import { verifyLazyAgenda } from './src/verifyLazyAgenda';

global.btoa = (str: string) => Buffer.from(str, 'binary').toString('base64');
global.atob = (str: string) => Buffer.from(str, 'base64').toString('binary');
global.fetch = require('node-fetch').default;

export const calculate = async (event, context) => {
const today = new Date();
Expand Down
13 changes: 6 additions & 7 deletions services/community-metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
"author": "impact-market",
"license": "Apache-2.0",
"engines": {
"node": "18.x"
"node": "16.x"
},
"dependencies": {
"@huma-finance/sdk": "0.0.44-beta.156",
"@huma-finance/shared": "0.0.43-beta.112",
"@huma-finance/sdk": "0.0.45",
"@huma-finance/shared": "0.0.45",
"@impactmarket/core": "1.0.0",
"ethers": "5.7.2"
"cross-fetch": "4.0.0",
"ethers": "5.7.2",
"node-fetch": "2.7.0"
},
"devDependencies": {
"serverless": "3.35.2",
Expand All @@ -24,8 +26,5 @@
"ts-loader": "9.4.1",
"webpack": "5.88.2",
"webpack-node-externals": "3.0.0"
},
"resolutions": {
"@huma-finance/shared": "0.0.43-beta.112"
}
}
2 changes: 1 addition & 1 deletion services/community-metrics/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ custom:

provider:
name: aws
runtime: nodejs18.x
runtime: nodejs16.x
region: ${env:AWS_REGION}

functions:
Expand Down
2 changes: 1 addition & 1 deletion services/learn-and-earn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "impact-market",
"license": "Apache-2.0",
"engines": {
"node": "18.x"
"node": "16.x"
},
"dependencies": {
"@impactmarket/core": "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion services/microcredit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "impact-market",
"license": "Apache-2.0",
"engines": {
"node": "18.x"
"node": "16.x"
},
"dependencies": {
"@impactmarket/core": "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion services/orchestrator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "impact-market",
"license": "Apache-2.0",
"engines": {
"node": "18.x"
"node": "16.x"
},
"dependencies": {
"aws-sdk": "2.1473.0",
Expand Down
2 changes: 1 addition & 1 deletion services/proposals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "impact-market",
"license": "Apache-2.0",
"engines": {
"node": "18.x"
"node": "16.x"
},
"dependencies": {
"@impactmarket/core": "1.0.0",
Expand Down
Loading

0 comments on commit 31022a6

Please sign in to comment.