Skip to content

Commit

Permalink
Merge pull request #67 from celo-org/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
dckesler authored Apr 12, 2023
2 parents 39a6f16 + e4d8a24 commit 62400f0
Show file tree
Hide file tree
Showing 31 changed files with 1,686 additions and 1,742 deletions.
10 changes: 10 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@
. "$(dirname -- "$0")/_/husky.sh"

yarn lint

# This block does prettier formatting and adds it to commit
FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
[ -z "$FILES" ] && exit 0

# Prettify all selected files
echo "$FILES" | xargs ./node_modules/.bin/prettier --ignore-unknown --write

# Add back the modified/prettified files to staging
echo "$FILES" | xargs git add
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
56 changes: 28 additions & 28 deletions apps/firebase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,42 @@
"keys:encrypt": "bash scripts/key_placer.sh encrypt"
},
"dependencies": {
"@celo/connect": "^3.0.1",
"@celo/contractkit": "^3.0.1",
"@celo/utils": "^3.0.1",
"@firebase/app": "^0.9.0",
"@google-cloud/logging": "^9.8.3",
"@celo/connect": "^4.0.0",
"@celo/contractkit": "^4.0.0",
"@celo/utils": "^4.0.0",
"@firebase/app": "^0.9.6",
"@google-cloud/logging": "^10.4.0",
"@mento-protocol/mento-sdk": "^0.1.4",
"bignumber.js": "^9.1.1",
"debug": "^4.1.1",
"ethers": "^5.7.0",
"firebase": "^9.15.0",
"firebase-admin": "^11.3.0",
"firebase-functions": "^4.1.0",
"firebase-tools": "^11.17.0",
"debug": "^4.3.4",
"ethers": "^5.7.2",
"firebase": "^9.19.0",
"firebase-admin": "^11.5.0",
"firebase-functions": "^4.2.1",
"firebase-tools": "^11.25.2",
"web3": "1.3.6"
},
"devDependencies": {
"@types/debug": "^4.1.4",
"@types/node": "^17.0.29",
"@types/yargs": "^13.0.2",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/eslint-plugin-tslint": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"cross-env": "5.2.0",
"eslint": "^8.14.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.2.9",
"@types/debug": "^4.1.7",
"@types/node": "^18.15.11",
"@types/yargs": "^17.0.24",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/eslint-plugin-tslint": "^5.57.0",
"@typescript-eslint/parser": "^5.57.0",
"cross-env": "7.0.3",
"eslint": "^8.37.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsdoc": "^40.1.1",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-unicorn": "^42.0.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-unicorn": "^46.0.0",
"firebase-bolt": "^0.8.4",
"husky": "^7.0.4",
"ts-node": "^10.7.0",
"typescript": "^4.6.3",
"yargs": "14.0.0"
"husky": "^8.0.3",
"ts-node": "^10.9.1",
"typescript": "^5.0.3",
"yargs": "17.7.1"
},
"engines": {
"node": "16"
"node": "18"
}
}
54 changes: 38 additions & 16 deletions apps/firebase/scripts/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,18 @@ yargs
})
.option('bigFaucetSafeAmount', {
type: 'string',
description: "Amount of CELO to be sent to *bigFaucetSafeAddress* each time the script runs"
description:
'Amount of CELO to be sent to *bigFaucetSafeAddress* each time the script runs',
})
.option('bigFaucetSafeStablesAmount', {
type: 'string',
description: "Amount of Stables to be sent to *bigFaucetSafeAddress* each time the script runs"
description:
'Amount of Stables to be sent to *bigFaucetSafeAddress* each time the script runs',
})
.option('bigFaucetSafeAddress', {
type: 'string',
description: "Address for the Celo Safe used for distributing large amounts of CELO to developers by request"
description:
'Address for the Celo Safe used for distributing large amounts of CELO to developers by request',
})

.option('deploy', {
Expand All @@ -144,8 +147,6 @@ yargs
}
).argv



function setConfig(network: string, config: Partial<NetworkConfig>) {
const setIfPresent = (name: string, value?: string | number | null) =>
value ? `faucet.${network}.${name}="${value}"` : ''
Expand All @@ -154,24 +155,36 @@ function setConfig(network: string, config: Partial<NetworkConfig>) {
setIfPresent('faucet_gold_amount', config.faucetGoldAmount),
setIfPresent('faucet_stable_amount', config.faucetStableAmount),
setIfPresent('authenticated_gold_amount', config.authenticatedGoldAmount),
setIfPresent('authenticated_stable_amount', config.authenticatedStableAmount),
setIfPresent(
'authenticated_stable_amount',
config.authenticatedStableAmount
),
setIfPresent('big_faucet_safe_address', config.bigFaucetSafeAddress),
setIfPresent('big_faucet_safe_amount', config.bigFaucetSafeAmount),
setIfPresent('big_faucet_safe_stables_amount', config.bigFaucetSafeStablesAmount),
setIfPresent(
'big_faucet_safe_stables_amount',
config.bigFaucetSafeStablesAmount
),
].join(' ')
execSync(`yarn firebase functions:config:set ${variables}`, { stdio: 'inherit' })
execSync(`yarn firebase functions:config:set ${variables}`, {
stdio: 'inherit',
})
}

function printConfig(network?: string) {
if (network != null) {
execSync(`yarn firebase functions:config:get faucet.${network}`, { stdio: 'inherit' })
execSync(`yarn firebase functions:config:get faucet.${network}`, {
stdio: 'inherit',
})
} else {
execSync(`yarn firebase functions:config:get faucet`, { stdio: 'inherit' })
}
}

function printAccounts(network: string) {
execSync(`yarn firebase database:get --pretty /${network}/accounts`, { stdio: 'inherit' })
execSync(`yarn firebase database:get --pretty /${network}/accounts`, {
stdio: 'inherit',
})
}

function enqueueFundRequest(network: string, address: string) {
Expand All @@ -181,7 +194,9 @@ function enqueueFundRequest(network: string, address: string) {
type: 'Faucet',
}
const data = JSON.stringify(request)
execSync(`yarn firebase database:push -d '${data}' /${network}/requests`, { stdio: 'inherit' })
execSync(`yarn firebase database:push -d '${data}' /${network}/requests`, {
stdio: 'inherit',
})
}

function addAccount(network: string, pk: string, address: string) {
Expand All @@ -191,15 +206,22 @@ function addAccount(network: string, pk: string, address: string) {
locked: false,
}
const data = JSON.stringify(account)
execSync(`yarn firebase database:push -d '${data}' /${network}/accounts`, { stdio: 'inherit' })
execSync(`yarn firebase database:push -d '${data}' /${network}/accounts`, {
stdio: 'inherit',
})
}

function clearAccounts(network: string) {
execSync(`yarn firebase database:remove /${network}/accounts`, { stdio: 'inherit' })
execSync(`yarn firebase database:remove /${network}/accounts`, {
stdio: 'inherit',
})
}

function deployFunctions() {
execSync(`yarn firebase deploy --only functions:faucetRequestProcessor,functions:bigFaucetFunder,functions:topUp`, {
stdio: 'inherit',
})
execSync(
`yarn firebase deploy --only functions:faucetRequestProcessor,functions:bigFaucetFunder,functions:topUp`,
{
stdio: 'inherit',
}
)
}
Loading

1 comment on commit 62400f0

@vercel
Copy link

@vercel vercel bot commented on 62400f0 Apr 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.