Skip to content

Commit

Permalink
Merge branch 'main' of github.com:centrifuge/apps into cent-app/fix-e…
Browse files Browse the repository at this point in the history
…mpty-hash
  • Loading branch information
sophialittlejohn committed Dec 20, 2023
2 parents 96ae602 + 9debe0b commit 921b835
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 82 deletions.
4 changes: 3 additions & 1 deletion centrifuge-app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const tsconfigJson = require('./tsconfig.json')
const path = require('path')
const synpressPath = path.join(process.cwd(), '/node_modules/@synthetixio/synpress')

module.exports = {
ignorePatterns: ['node_modules', 'build', '.env', ...(tsconfigJson.exclude || [])],
extends: ['react-app', 'react-app/jest'],
extends: ['react-app', 'react-app/jest', `${synpressPath}/.eslintrc.js`],
parserOptions: {
sourceType: 'module',
},
Expand Down
2 changes: 1 addition & 1 deletion centrifuge-app/src/components/InvestRedeem/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import BN from 'bn.js'
import Decimal from 'decimal.js-light'
import * as React from 'react'

type CurrencyMeta = Pick<CurrencyMetadata, 'decimals' | 'symbol'>
type CurrencyMeta = Pick<CurrencyMetadata, 'decimals' | 'symbol' | 'name'>

export type InvestRedeemAction =
| 'invest'
Expand Down
58 changes: 0 additions & 58 deletions centrifuge-app/src/components/TinlakeRewards/utils.test.ts

This file was deleted.

21 changes: 0 additions & 21 deletions centrifuge-app/src/utils/formatGeographyCodes.test.ts

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type EvmConnectorMeta = {
src: string
alt: string
}
connector: Connector
connector: Connector | any
get installed(): boolean
get shown(): boolean
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export const signAndSendDocumentsController = async (
poolSteps: {
...poolSteps,
[poolId]: {
...poolSteps?.[poolId],
[trancheId]: {
signAgreement: {
completed: true,
Expand Down
85 changes: 85 additions & 0 deletions onboarding-api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,89 @@ onboarding.get('/getTaxInfo', verifyAuth, getTaxInfoController)
// init
onboarding.get('/initProxies', initProxiesController)

// migration
// onboarding.post('/migrate', async (req: Request, res: Response) => {
// try {
// const userSanpshot = await userCollection.get()
// const users = userSanpshot?.docs.map((doc) => {
// return doc.data() as OnboardingUser
// })
// const docIds = userSanpshot?.docs.map((doc) => {
// return doc.id
// })
// const updatedUsers: [string, OnboardingUser][] = []
// for (const [index, user] of users.entries()) {
// const { globalSteps, ...rest } = user
// let taxDocument: string | null = null
// // @ts-expect-error
// if (globalSteps?.verifyTaxInfo?.completed === true) {
// taxDocument = `${process.env.ONBOARDING_STORAGE_BUCKET}/tax-information/${docIds[index]}.pdf`
// }
// // @ts-expect-error
// delete globalSteps.verifyTaxInfo
// const theUser = {
// ...rest,
// globalSteps,
// taxDocument,
// } as OnboardingUser
// await userCollection.doc(docIds[index]).set(theUser)
// updatedUsers.push([docIds[index], theUser])
// console.log(`progress: ${index + 1} of ${users.length} (${docIds[index]})`)
// }
// return res.send({ message: 'success', numberOfUsersUpdated: updatedUsers.length, updatedUsers })
// } catch (e) {
// const error = reportHttpError(e)
// return res.status(error.code).send({ error: error.message })
// }
// })

// internal
// onboarding.get('/whitelisted', async (req: Request, res: Response) => {
// try {
// const userSanpshot = await userCollection.get()
// const users = userSanpshot?.docs.map((doc) => {
// return doc.data() as OnboardingUser
// })

// const whitelistedUsersByPool = users.reduce((acc, user) => {
// const { poolSteps } = user
// const poolIds = Object.keys(poolSteps)
// const tranchesApproved = poolIds.reduce((acc, poolId) => {
// const tranches = Object.keys(poolSteps[poolId]).filter((trancheId) => {
// const { status } = poolSteps[poolId][trancheId]
// return status.status === 'approved'
// })
// if (tranches.length > 0) {
// return { ...acc, [poolId]: tranches }
// }
// return acc
// }, {})
// if (Object.keys(tranchesApproved).length === 0) return acc
// const address =
// // @ts-expect-error
// user?.wallets.evm?.length > 0
// ? // @ts-expect-error
// user.wallets.evm[0]
// : // @ts-expect-error
// user?.wallets.substrate?.length > 0
// ? // @ts-expect-error
// user.wallets.substrate[0]
// : // @ts-expect-error
// user?.wallets.evmOnSubstrate?.length > 0
// ? // @ts-expect-error
// user.wallets.evmOnSubstrate[0]
// : null

// if (address) {
// return { ...acc, [address]: { ...acc[address], ...tranchesApproved } }
// }
// return acc
// }, {})
// return res.send({ ...whitelistedUsersByPool })
// } catch (e) {
// const error = reportHttpError(e)
// return res.status(error.code).send({ error: error.message })
// }
// })

exports.onboarding = onboarding

0 comments on commit 921b835

Please sign in to comment.