From 83d75d6ae9cc5d6a09b6fb150346d76f38b643ed Mon Sep 17 00:00:00 2001 From: Aaron DeRuvo Date: Thu, 2 Jan 2020 11:19:28 -0800 Subject: [PATCH 1/5] Remove rep sentence from brand kit page (#2350) --- packages/web/static/locales/en/brand.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web/static/locales/en/brand.json b/packages/web/static/locales/en/brand.json index 071b6c61494..5e32978f2bc 100644 --- a/packages/web/static/locales/en/brand.json +++ b/packages/web/static/locales/en/brand.json @@ -5,7 +5,7 @@ "The Celo Brand Kit includes resources to visually represent Celo and the mission of prosperity for all. The kit offers instructions and assets for community contributors to appropriately communicate Celo brand affiliation. By using the Celo brand consistently, we can connect in our shared purpose.", "useageTitle": "How to use this guide?", "useageText": - "Shared norms and behaviors are the foundation of a beautiful community. By choosing to use these assets, you become a representative of Celo. Support the effort responsibly and uphold <0>Celo’s Code of Conduct." + "Shared norms and behaviors are the foundation of a beautiful community. Support the effort responsibly and uphold <0>Celo’s Code of Conduct." }, "logo": { "title": "Logo", From 16e2790e6fa46612838b40dad40f11e9f1e696c7 Mon Sep 17 00:00:00 2001 From: Aaron DeRuvo Date: Thu, 2 Jan 2020 13:54:17 -0800 Subject: [PATCH 2/5] Remove Rewards page from web (#2353) --- packages/web/pages/rewards.tsx | 51 ---------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 packages/web/pages/rewards.tsx diff --git a/packages/web/pages/rewards.tsx b/packages/web/pages/rewards.tsx deleted file mode 100644 index 5c451a40efa..00000000000 --- a/packages/web/pages/rewards.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import * as React from 'react' -import { StyleSheet, View } from 'react-native' -import { H1 } from 'src/fonts/Fonts' -import Header from 'src/header/Header.3' - -class Rewards extends React.Component { - componentDidMount() { - window.location.replace('https://storage.googleapis.com/verifier-apk/verifier-production.apk') - } - - render() { - return ( - -
- - -

Gracias por descargar la aplicación verificadora!

-
-
- - ) - } -} - -const styles = StyleSheet.create({ - container: { - flex: 1, - flexDirection: 'column', - justifyContent: 'flex-start', - alignItems: 'center', - paddingLeft: 20, - paddingRight: 20, - marginBottom: 80, - }, - maxWidth: { - width: '100%', - alignItems: 'flex-end', - justifyContent: 'flex-end', - maxWidth: 854, - }, - headerBox: { - alignSelf: 'stretch', - }, - header: { - alignSelf: 'stretch', - marginTop: 127, - marginBottom: 21, - }, -}) - -export default Rewards From f609f7c063f6b692a2877544719911e3dd7827f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kel=C3=A4?= Date: Fri, 3 Jan 2020 02:57:28 +0200 Subject: [PATCH 3/5] Fixes needed to make slashing work (#2346) --- .../contracts/governance/Validators.sol | 33 +++++++++++-------- .../protocol/test/governance/validators.ts | 1 + 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/packages/protocol/contracts/governance/Validators.sol b/packages/protocol/contracts/governance/Validators.sol index f5e2a59dfe6..b0fabaa0960 100644 --- a/packages/protocol/contracts/governance/Validators.sol +++ b/packages/protocol/contracts/governance/Validators.sol @@ -333,7 +333,7 @@ contract Validators is function getMembershipHistory(address account) external view - returns (uint256[] memory, address[] memory, uint256) + returns (uint256[] memory, address[] memory, uint256, uint256) { MembershipHistory storage history = validators[account].membershipHistory; uint256[] memory epochs = new uint256[](history.numEntries); @@ -343,7 +343,7 @@ contract Validators is epochs[i] = history.entries[index].epochNumber; membershipGroups[i] = history.entries[index].group; } - return (epochs, membershipGroups, history.lastRemovedFromGroupTimestamp); + return (epochs, membershipGroups, history.lastRemovedFromGroupTimestamp, history.tail); } /** @@ -1152,12 +1152,14 @@ contract Validators is return true; } - bytes32[] canForceDeaffiliation = [ - DOWNTIME_SLASHER_REGISTRY_ID, - DOUBLE_SIGNING_SLASHER_REGISTRY_ID, - GOVERNANCE_SLASHER_REGISTRY_ID, - GOVERNANCE_REGISTRY_ID - ]; + function getCanForceDeaffiliation() internal pure returns (bytes32[] memory) { + bytes32[] memory res = new bytes32[](4); + res[0] = DOWNTIME_SLASHER_REGISTRY_ID; + res[1] = DOUBLE_SIGNING_SLASHER_REGISTRY_ID; + res[2] = GOVERNANCE_SLASHER_REGISTRY_ID; + res[3] = GOVERNANCE_REGISTRY_ID; + return res; + } /** * @notice Removes a validator from the group for which it is a member. @@ -1166,7 +1168,7 @@ contract Validators is function forceDeaffiliateIfValidator(address validatorAccount) external nonReentrant - onlyRegisteredContracts(canForceDeaffiliation) + onlyRegisteredContracts(getCanForceDeaffiliation()) { if (isValidator(validatorAccount)) { Validator storage validator = validators[validatorAccount]; @@ -1199,10 +1201,12 @@ contract Validators is group.slashInfo.multiplier = FixidityLib.fixed1(); } - bytes32[] canHalveSlashingMultiplier = [ - DOWNTIME_SLASHER_REGISTRY_ID, - DOUBLE_SIGNING_SLASHER_REGISTRY_ID - ]; + function getCanHalveSlashingMultiplier() internal pure returns (bytes32[] memory) { + bytes32[] memory res = new bytes32[](2); + res[0] = DOWNTIME_SLASHER_REGISTRY_ID; + res[1] = DOUBLE_SIGNING_SLASHER_REGISTRY_ID; + return res; + } /** * @notice Halves the group's slashing multiplier. @@ -1211,7 +1215,7 @@ contract Validators is function halveSlashingMultiplier(address account) external nonReentrant - onlyRegisteredContracts(canHalveSlashingMultiplier) + onlyRegisteredContracts(getCanHalveSlashingMultiplier()) { require(isValidatorGroup(account), "Not a validator group"); ValidatorGroup storage group = groups[account]; @@ -1256,4 +1260,5 @@ contract Validators is ); return history.entries[index].group; } + } diff --git a/packages/protocol/test/governance/validators.ts b/packages/protocol/test/governance/validators.ts index 855c175fd33..03e86a0864b 100644 --- a/packages/protocol/test/governance/validators.ts +++ b/packages/protocol/test/governance/validators.ts @@ -65,6 +65,7 @@ const parseMembershipHistory = (membershipHistory: any) => { epochs: membershipHistory[0], groups: membershipHistory[1], lastRemovedFromGroupTimestamp: membershipHistory[2], + tail: membershipHistory[3], } } From df8f6561dad6c57de15428be58cdbf697f6a6e27 Mon Sep 17 00:00:00 2001 From: Jean Regisser Date: Fri, 3 Jan 2020 14:53:09 +0100 Subject: [PATCH 4/5] Update prettier to 1.19.1 to support TypeScript 3.7 (optional chaining, nullish coalescing, etc) (#2358) --- package.json | 12 +- packages/attestation-service/src/request.ts | 4 +- packages/blockchain-api/src/blockscout.ts | 8 +- packages/celotool/src/cmds/account/faucet.ts | 4 +- packages/celotool/src/cmds/account/lookup.ts | 4 +- packages/celotool/src/cmds/account/verify.ts | 8 +- .../src/cmds/deploy/initial/blockchain-api.ts | 4 +- .../src/cmds/deploy/upgrade/faucet.ts | 8 +- .../gcp/remove-leaked-forwarding-rules.ts | 4 +- packages/celotool/src/cmds/geth/run.ts | 5 +- packages/celotool/src/cmds/restore.ts | 4 +- .../src/e2e-tests/governance_tests.ts | 7 +- .../celotool/src/lib/attestation-service.ts | 6 +- packages/celotool/src/lib/blockscout.ts | 14 +- packages/celotool/src/lib/env-utils.ts | 4 +- packages/celotool/src/lib/geth.ts | 8 +- packages/cli/package.json | 2 +- packages/cli/src/utils/checks.ts | 5 +- packages/cli/src/utils/identity.ts | 12 +- .../contractkit/src/identity/claims/claim.ts | 12 +- .../contractkit/src/utils/tx-signing.test.ts | 4 +- .../contractkit/src/wrappers/Attestations.ts | 8 +- .../contractkit/src/wrappers/Governance.ts | 8 +- .../faucet/src/contracts/types/Escrow.d.ts | 4 +- .../java/org/celo/mobile/DetoxTest.java | 2 +- .../java/org/celo/mobile/MainActivity.java | 4 +- .../java/org/celo/mobile/NdkCrashService.java | 10 +- packages/mobile/src/account/Analytics.tsx | 7 +- .../mobile/src/account/DollarEducation.tsx | 5 +- packages/mobile/src/account/EditProfile.tsx | 9 +- packages/mobile/src/account/GoldEducation.tsx | 5 +- .../mobile/src/account/PhotosEducation.tsx | 5 +- packages/mobile/src/app/saga.test.ts | 10 +- packages/mobile/src/backup/BackupComplete.tsx | 27 +-- .../mobile/src/backup/BackupIntroduction.tsx | 140 ++++++------ packages/mobile/src/backup/BackupPhrase.tsx | 7 +- packages/mobile/src/backup/BackupQuiz.tsx | 7 +- packages/mobile/src/backup/BackupSocial.tsx | 11 +- .../mobile/src/backup/BackupSocialIntro.tsx | 11 +- .../mobile/src/components/AccountOverview.tsx | 8 +- .../mobile/src/components/DevSkipButton.tsx | 7 +- .../src/escrow/EscrowedPaymentListScreen.tsx | 11 +- packages/mobile/src/exchange/Activity.tsx | 9 +- .../src/exchange/ExchangeHomeScreen.tsx | 9 +- .../mobile/src/exchange/ExchangeReview.tsx | 8 +- .../src/exchange/ExchangeTradeScreen.tsx | 13 +- packages/mobile/src/fees/CalculateFee.tsx | 17 +- packages/mobile/src/fees/EstimateFee.tsx | 9 +- packages/mobile/src/firebase/firebase.ts | 10 +- packages/mobile/src/firebase/saga.ts | 4 +- packages/mobile/src/home/TransactionsList.tsx | 9 +- .../mobile/src/identity/verification.test.ts | 10 +- packages/mobile/src/identity/verification.ts | 4 +- packages/mobile/src/import/ImportWallet.tsx | 11 +- .../mobile/src/import/ImportWalletEmpty.tsx | 9 +- .../mobile/src/import/ImportWalletSocial.tsx | 11 +- packages/mobile/src/invite/saga.test.ts | 20 +- packages/mobile/src/language/Language.tsx | 7 +- .../mobile/src/navigator/NavigatorWrapper.tsx | 9 +- .../src/notifications/NotificationList.tsx | 9 +- .../IncomingPaymentRequestListScreen.tsx | 11 +- ...omingPaymentRequestSummaryNotification.tsx | 7 +- .../OutgoingPaymentRequestListScreen.tsx | 13 +- ...goingPaymentRequestSummaryNotification.tsx | 11 +- .../PaymentRequestReviewCard.tsx | 31 ++- packages/mobile/src/qrcode/QRScanner.tsx | 9 +- .../mobile/src/recipients/RecipientPicker.tsx | 5 +- .../mobile/src/send/ContactSyncBanner.tsx | 21 +- packages/mobile/src/send/Send.tsx | 19 +- packages/mobile/src/send/SendAmount.tsx | 17 +- .../mobile/src/send/TransferReviewCard.tsx | 31 ++- packages/mobile/src/send/saga.test.ts | 30 ++- .../src/transactions/TransferFeedItem.tsx | 4 +- packages/mobile/test/values.ts | 5 +- .../migrations/23_elect_validators.ts | 4 +- packages/protocol/test/common/accounts.ts | 28 +-- packages/protocol/test/governance/election.ts | 5 +- .../protocol/test/governance/governance.ts | 20 +- .../test/governance/sortedlinkedlist.ts | 5 +- .../react-components/analytics/wrapper.tsx | 2 +- .../components/LoadingLabel.tsx | 13 +- .../components/SmartTopAlert.tsx | 133 +++++------ .../react-components/components/TextInput.tsx | 22 +- packages/utils/src/io.ts | 41 ++-- packages/utils/src/phoneNumbers.ts | 6 +- .../verification-pool-api/src/database.ts | 44 ++-- .../java/org/celo/verifier/MessageState.java | 6 +- .../PushNotificationToSMSService.java | 20 +- .../verifier/RNVerifierServiceModule.java | 9 +- .../verifier/RNVerifierServicePackage.java | 2 +- .../verifier/SMSStatusBroadcastReceiver.java | 10 +- packages/verifier/src/App.tsx | 7 +- .../src/components/HomeScreen/Activity.tsx | 7 +- .../src/components/HomeScreen/HomeScreen.tsx | 5 +- .../src/components/NUX/EducationScreen.tsx | 5 +- .../src/components/NUX/LanguageScreen.tsx | 10 +- .../src/components/NUX/SetupAccountScreen.tsx | 5 +- packages/walletkit/src/signing-utils.ts | 4 +- .../walletkit/test/contract-utils-v2.test.ts | 7 +- packages/walletkit/test/erc20-utils.test.ts | 16 +- packages/web/src/about/VideoCover.tsx | 3 +- packages/web/src/community/CodeOfConduct.tsx | 6 +- .../web/src/community/connect/EventRow.tsx | 16 +- .../src/community/connect/FellowViewer.tsx | 4 +- packages/web/src/dev/Cover.tsx | 3 +- packages/web/src/dev/FullStack.tsx | 6 +- packages/web/src/header/Header.3.tsx | 102 ++++----- packages/web/src/jobs/lever.test.ts | 4 +- packages/web/src/shared/DropDown.tsx | 24 +- packages/web/src/utils/utils.ts | 8 +- scripts/check-packages.js | 4 +- yarn.lock | 216 ++++++++++-------- 112 files changed, 806 insertions(+), 863 deletions(-) diff --git a/package.json b/package.json index 54ff028be29..f701a677310 100644 --- a/package.json +++ b/package.json @@ -49,10 +49,10 @@ "jest-snapshot": "^24.9.0", "lerna": "^3.16.0", "patch-package": "^5.1.1", - "prettier": "1.13.5", - "prettier-plugin-java": "^0.4.0", - "prettier-plugin-solidity": "1.0.0-alpha.34", - "pretty-quick": "^1.11.1", + "prettier": "1.19.1", + "prettier-plugin-java": "^0.6.0", + "prettier-plugin-solidity": "1.0.0-alpha.35", + "pretty-quick": "^2.0.1", "solc": "0.5.8", "ts-jest": "^24.1.0", "ts-node": "^8.3.0", @@ -74,6 +74,8 @@ "**/extend": "^3.0.2", "**/cross-fetch": "^3.0.2", "sha3": "1.2.3", - "bignumber.js": "9.0.0" + "bignumber.js": "9.0.0", + "prettier": "^1.19.1", + "@types/prettier": "^1.19.0" } } diff --git a/packages/attestation-service/src/request.ts b/packages/attestation-service/src/request.ts index ee3d564eceb..808d7ec9cbd 100644 --- a/packages/attestation-service/src/request.ts +++ b/packages/attestation-service/src/request.ts @@ -53,9 +53,7 @@ function serializeErrors(errors: t.Errors) { const path = error.context.map(({ key }) => key).join('.') const value = error.message || - `Expected value at path ${path} to be of type ${expectedType.name}, but received ${ - error.value - }` + `Expected value at path ${path} to be of type ${expectedType.name}, but received ${error.value}` // Create recursive payload in case of nested properties let payload: any = value diff --git a/packages/blockchain-api/src/blockscout.ts b/packages/blockchain-api/src/blockscout.ts index 727844ebe19..518d1e84ae4 100644 --- a/packages/blockchain-api/src/blockscout.ts +++ b/packages/blockchain-api/src/blockscout.ts @@ -184,9 +184,7 @@ export class BlockscoutAPI extends RESTDataSource { }) console.info( - `[Celo] getFeedEvents address=${args.address} startblock=${args.startblock} endblock=${ - args.endblock - } rawTransactionCount=${rawTransactions.length} eventCount=${events.length}` + `[Celo] getFeedEvents address=${args.address} startblock=${args.startblock} endblock=${args.endblock} rawTransactionCount=${rawTransactions.length} eventCount=${events.length}` ) return events.sort((a, b) => b.timestamp - a.timestamp) } @@ -212,9 +210,7 @@ export class BlockscoutAPI extends RESTDataSource { }) } console.info( - `[Celo] getFeedRewards address=${args.address} startblock=${args.startblock} endblock=${ - args.endblock - } rawTransactionCount=${rawTransactions.length} rewardsCount=${rewards.length}` + `[Celo] getFeedRewards address=${args.address} startblock=${args.startblock} endblock=${args.endblock} rawTransactionCount=${rawTransactions.length} rewardsCount=${rewards.length}` ) return rewards.sort((a, b) => b.timestamp - a.timestamp) } diff --git a/packages/celotool/src/cmds/account/faucet.ts b/packages/celotool/src/cmds/account/faucet.ts index ba38f64bb52..45fe760d066 100644 --- a/packages/celotool/src/cmds/account/faucet.ts +++ b/packages/celotool/src/cmds/account/faucet.ts @@ -87,9 +87,7 @@ export const handler = async (argv: FaucetArgv) => { (argv.dollar !== 0 && !(await stableToken.balanceOf(address)).isZero()) ) { console.error( - `Unable to faucet ${address} on ${ - argv.celoEnv - }: --checkzero specified, but balance is non-zero` + `Unable to faucet ${address} on ${argv.celoEnv}: --checkzero specified, but balance is non-zero` ) process.exit(1) } diff --git a/packages/celotool/src/cmds/account/lookup.ts b/packages/celotool/src/cmds/account/lookup.ts index 6f55cee5cc7..01334805a9c 100644 --- a/packages/celotool/src/cmds/account/lookup.ts +++ b/packages/celotool/src/cmds/account/lookup.ts @@ -42,9 +42,7 @@ export const handler = async (argv: LookupArgv) => { Object.keys(matchingAddresses).map((address) => { const attestationsStats = matchingAddresses[address] console.info( - `${address} is attested to ${argv.phone} with ${ - attestationsStats.completed - } completed attestations out of ${attestationsStats.total} total` + `${address} is attested to ${argv.phone} with ${attestationsStats.completed} completed attestations out of ${attestationsStats.total} total` ) }) } diff --git a/packages/celotool/src/cmds/account/verify.ts b/packages/celotool/src/cmds/account/verify.ts index 3bb3d38435b..9defc9bf2b9 100644 --- a/packages/celotool/src/cmds/account/verify.ts +++ b/packages/celotool/src/cmds/account/verify.ts @@ -104,9 +104,7 @@ export async function printCurrentCompletedAttestations( const attestationStat = await attestations.getAttestationStat(phoneNumber, account) console.info( - `Phone Number: ${phoneNumber} has completed ${ - attestationStat.completed - } attestations out of a total of ${attestationStat.total}` + `Phone Number: ${phoneNumber} has completed ${attestationStat.completed} attestations out of a total of ${attestationStat.total}` ) } @@ -166,9 +164,7 @@ async function promptForCodeAndVerify( const userResponse = await prompts({ type: 'text', name: 'code', - message: `${ - attestationsToComplete.length - } attestations completable. Enter the code here or type exit`, + message: `${attestationsToComplete.length} attestations completable. Enter the code here or type exit`, }) if (userResponse.code === 'exit') { diff --git a/packages/celotool/src/cmds/deploy/initial/blockchain-api.ts b/packages/celotool/src/cmds/deploy/initial/blockchain-api.ts index 85e79488e1d..98383101442 100644 --- a/packages/celotool/src/cmds/deploy/initial/blockchain-api.ts +++ b/packages/celotool/src/cmds/deploy/initial/blockchain-api.ts @@ -17,9 +17,7 @@ export const handler = async (argv: BlockchainApiArgv) => { const newFaucetAddress = getAddressFromEnv(AccountType.VALIDATOR, 0) // We use the 0th validator as the faucet console.info(`updating blockchain-api yaml file for env ${argv.celoEnv}`) await execCmd( - `sed -i.bak 's/FAUCET_ADDRESS: .*$/FAUCET_ADDRESS: \"${newFaucetAddress}\"/g' ../blockchain-api/app.${ - argv.celoEnv - }.yaml` + `sed -i.bak 's/FAUCET_ADDRESS: .*$/FAUCET_ADDRESS: \"${newFaucetAddress}\"/g' ../blockchain-api/app.${argv.celoEnv}.yaml` ) await execCmd(`rm ../blockchain-api/app.${argv.celoEnv}.yaml.bak`) // Removing temporary bak file console.info(`deploying blockchain-api for env ${argv.config} to ${testnetProjectName}`) diff --git a/packages/celotool/src/cmds/deploy/upgrade/faucet.ts b/packages/celotool/src/cmds/deploy/upgrade/faucet.ts index 60f7a6f3dfa..33399b242a8 100644 --- a/packages/celotool/src/cmds/deploy/upgrade/faucet.ts +++ b/packages/celotool/src/cmds/deploy/upgrade/faucet.ts @@ -70,9 +70,7 @@ export const handler = async (argv: UpgradeFaucetArgs) => { console.info(`Updating contract addresses for ${argv.celoEnv} on ${argv.firebaseProject}`) await execCmd( - `yarn --cwd ../faucet cli config:set --net ${argv.celoEnv} --escrowAddress ${ - addressMap.escrow - } --goldTokenAddress ${addressMap.goldToken} --stableTokenAddress ${addressMap.stableToken}` + `yarn --cwd ../faucet cli config:set --net ${argv.celoEnv} --escrowAddress ${addressMap.escrow} --goldTokenAddress ${addressMap.goldToken} --stableTokenAddress ${addressMap.stableToken}` ) console.info(`Redepolying functions (neeeded for config changes to take place)`) await execCmd('yarn --cwd ../faucet cli deploy:functions') @@ -92,9 +90,7 @@ export const handler = async (argv: UpgradeFaucetArgs) => { await portForwardAnd(argv.celoEnv, fundFaucetAccounts) console.info( - `Done updating contract addresses and funding the faucet account for network ${ - argv.celoEnv - } in ${argv.firebaseProject}` + `Done updating contract addresses and funding the faucet account for network ${argv.celoEnv} in ${argv.firebaseProject}` ) console.info('Please double check the TX node IP address to ensure it did not change.') process.exit(0) diff --git a/packages/celotool/src/cmds/gcp/remove-leaked-forwarding-rules.ts b/packages/celotool/src/cmds/gcp/remove-leaked-forwarding-rules.ts index 0f3e023ec90..7e7d3994070 100644 --- a/packages/celotool/src/cmds/gcp/remove-leaked-forwarding-rules.ts +++ b/packages/celotool/src/cmds/gcp/remove-leaked-forwarding-rules.ts @@ -44,9 +44,7 @@ export const handler = async (argv: Argv) => { try { await execCmd( - `gcloud compute target-pools get-health ${target} --region=${zone} --format=json --project=${ - argv.project - }`, + `gcloud compute target-pools get-health ${target} --region=${zone} --format=json --project=${argv.project}`, {}, true ) diff --git a/packages/celotool/src/cmds/geth/run.ts b/packages/celotool/src/cmds/geth/run.ts index 43756798f58..0663f839acf 100644 --- a/packages/celotool/src/cmds/geth/run.ts +++ b/packages/celotool/src/cmds/geth/run.ts @@ -75,9 +75,8 @@ export const builder = (argv: yargs.Argv) => { description: 'Verbosity level', default: 5, }) - .coerce( - 'miner-address', - (minerAddress: string) => (minerAddress === null ? null : ensure0x(minerAddress)) + .coerce('miner-address', (minerAddress: string) => + minerAddress === null ? null : ensure0x(minerAddress) ) } diff --git a/packages/celotool/src/cmds/restore.ts b/packages/celotool/src/cmds/restore.ts index 761d7c4e601..d1fa42ce6fe 100644 --- a/packages/celotool/src/cmds/restore.ts +++ b/packages/celotool/src/cmds/restore.ts @@ -49,9 +49,7 @@ export const handler = async (argv: RestoreArgv) => { // That itself requires that the miner node be stopped. // For now, this step is intentionally manual. // When we encounter a real world use-case of restore, we can decide whether to automate this or not. - const restoreSnapshotCmd = `gcloud compute disks create ${pvcFullId} --source-snapshot=${ - argv.snapshotname - } --type ${diskType}` + const restoreSnapshotCmd = `gcloud compute disks create ${pvcFullId} --source-snapshot=${argv.snapshotname} --type ${diskType}` await execCmdWithExitOnFailure(restoreSnapshotCmd) // const gcloudSnapshotsUrl = 'https://console.cloud.google.com/compute/snapshots' // console.info(`Snapshot \"${snapshotName}\" can be seen at ${gcloudSnapshotsUrl}`) diff --git a/packages/celotool/src/e2e-tests/governance_tests.ts b/packages/celotool/src/e2e-tests/governance_tests.ts index 1874a34f09b..a1901b76c3a 100644 --- a/packages/celotool/src/e2e-tests/governance_tests.ts +++ b/packages/celotool/src/e2e-tests/governance_tests.ts @@ -32,10 +32,9 @@ async function newMemberSwapper(kit: ContractKit, members: string[]): Promise - this.addCheck(`${account} is Validator`, this.withValidators((v) => v.isValidator(account))) + this.addCheck( + `${account} is Validator`, + this.withValidators((v) => v.isValidator(account)) + ) isValidatorGroup = (account: Address) => this.addCheck( diff --git a/packages/cli/src/utils/identity.ts b/packages/cli/src/utils/identity.ts index 84ef8c0bfda..16d61320eff 100644 --- a/packages/cli/src/utils/identity.ts +++ b/packages/cli/src/utils/identity.ts @@ -95,8 +95,8 @@ export const displayMetadata = async (metadata: IdentityMetadataWrapper, kit: Co const status = verifiable ? await verifyClaim(claim, metadata.data.meta.address, metadataURLGetter) : validatable - ? await validateClaim(claim, metadata.data.meta.address, kit) - : 'N/A' + ? await validateClaim(claim, metadata.data.meta.address, kit) + : 'N/A' let extra = '' switch (claim.type) { case ClaimTypes.ATTESTATION_SERVICE_URL: @@ -123,10 +123,10 @@ export const displayMetadata = async (metadata: IdentityMetadataWrapper, kit: Co ? `Could not verify: ${status}` : 'Verified!' : validatable - ? status - ? `Invalid: ${status}` - : `Valid!` - : 'N/A', + ? status + ? `Invalid: ${status}` + : `Valid!` + : 'N/A', createdAt: moment.unix(claim.timestamp).fromNow(), } }) diff --git a/packages/contractkit/src/identity/claims/claim.ts b/packages/contractkit/src/identity/claims/claim.ts index bea01abe3f3..843dfedf0c2 100644 --- a/packages/contractkit/src/identity/claims/claim.ts +++ b/packages/contractkit/src/identity/claims/claim.ts @@ -47,12 +47,12 @@ export type Claim = export type ClaimPayload = K extends typeof ClaimTypes.DOMAIN ? DomainClaim : K extends typeof ClaimTypes.NAME - ? NameClaim - : K extends typeof ClaimTypes.KEYBASE - ? KeybaseClaim - : K extends typeof ClaimTypes.ATTESTATION_SERVICE_URL - ? AttestationServiceURLClaim - : AccountClaim + ? NameClaim + : K extends typeof ClaimTypes.KEYBASE + ? KeybaseClaim + : K extends typeof ClaimTypes.ATTESTATION_SERVICE_URL + ? AttestationServiceURLClaim + : AccountClaim export const isOfType = (type: K) => (data: Claim): data is ClaimPayload => data.type === type diff --git a/packages/contractkit/src/utils/tx-signing.test.ts b/packages/contractkit/src/utils/tx-signing.test.ts index 7c5f98c09f7..f9054a04c10 100644 --- a/packages/contractkit/src/utils/tx-signing.test.ts +++ b/packages/contractkit/src/utils/tx-signing.test.ts @@ -74,9 +74,7 @@ async function verifyLocalSigning(web3: Web3, celoTransaction: CeloTx): Promise< if (celoTransaction.gatewayFeeRecipient != null) { debug( 'Checking gateway fee recipient actual ' + - `${signedCeloTransaction.gatewayFeeRecipient} expected ${ - celoTransaction.gatewayFeeRecipient - }` + `${signedCeloTransaction.gatewayFeeRecipient} expected ${celoTransaction.gatewayFeeRecipient}` ) expect(signedCeloTransaction.gatewayFeeRecipient!.toLowerCase()).toEqual( celoTransaction.gatewayFeeRecipient.toLowerCase() diff --git a/packages/contractkit/src/wrappers/Attestations.ts b/packages/contractkit/src/wrappers/Attestations.ts index f75087adcec..36e329d8530 100644 --- a/packages/contractkit/src/wrappers/Attestations.ts +++ b/packages/contractkit/src/wrappers/Attestations.ts @@ -75,9 +75,11 @@ function parseGetCompletableAttestations(response: GetCompletableAttestationsRes (response[3] as unknown) as string ) - return zip3(response[0].map(valueToInt), response[1], metadataURLs).map( - ([blockNumber, issuer, metadataURL]) => ({ blockNumber, issuer, metadataURL }) - ) + return zip3( + response[0].map(valueToInt), + response[1], + metadataURLs + ).map(([blockNumber, issuer, metadataURL]) => ({ blockNumber, issuer, metadataURL })) } const stringIdentity = (x: string) => x diff --git a/packages/contractkit/src/wrappers/Governance.ts b/packages/contractkit/src/wrappers/Governance.ts index 52c3c492acf..c40fe469df9 100644 --- a/packages/contractkit/src/wrappers/Governance.ts +++ b/packages/contractkit/src/wrappers/Governance.ts @@ -367,7 +367,13 @@ export class GovernanceWrapper extends BaseWrapper { if (!queue) { queue = await this.getQueue() } - return { index: this.getIndex(proposalID, queue.map((record) => record.proposalID)), queue } + return { + index: this.getIndex( + proposalID, + queue.map((record) => record.proposalID) + ), + queue, + } } private async lesserAndGreater(proposalID: BigNumber.Value, _queue?: UpvoteRecord[]) { diff --git a/packages/faucet/src/contracts/types/Escrow.d.ts b/packages/faucet/src/contracts/types/Escrow.d.ts index d32e1f579d4..65cb4bc675e 100644 --- a/packages/faucet/src/contracts/types/Escrow.d.ts +++ b/packages/faucet/src/contracts/types/Escrow.d.ts @@ -39,9 +39,9 @@ export class Escrow extends Contract { sentPaymentIds(arg0: string, arg1: number | string): TransactionObject - getReceivedPaymentIds(identifier: string | number[]): TransactionObject<(string)[]> + getReceivedPaymentIds(identifier: string | number[]): TransactionObject - getSentPaymentIds(sender: string): TransactionObject<(string)[]> + getSentPaymentIds(sender: string): TransactionObject renounceOwnership(): TransactionObject diff --git a/packages/mobile/android/app/src/androidTest/java/org/celo/mobile/DetoxTest.java b/packages/mobile/android/app/src/androidTest/java/org/celo/mobile/DetoxTest.java index 91c425315f8..0c3b85e55fa 100644 --- a/packages/mobile/android/app/src/androidTest/java/org/celo/mobile/DetoxTest.java +++ b/packages/mobile/android/app/src/androidTest/java/org/celo/mobile/DetoxTest.java @@ -5,8 +5,8 @@ import androidx.test.rule.ActivityTestRule; import com.wix.detox.Detox; import org.junit.Rule; -import org.junit.runner.RunWith; import org.junit.Test; +import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) @LargeTest diff --git a/packages/mobile/android/app/src/main/java/org/celo/mobile/MainActivity.java b/packages/mobile/android/app/src/main/java/org/celo/mobile/MainActivity.java index 89a2c2f2052..e06e8eab15e 100644 --- a/packages/mobile/android/app/src/main/java/org/celo/mobile/MainActivity.java +++ b/packages/mobile/android/app/src/main/java/org/celo/mobile/MainActivity.java @@ -1,12 +1,12 @@ package org.celo.mobile; import android.os.Bundle; -import com.facebook.react.bridge.ReactContext; -import com.facebook.react.modules.core.DeviceEventManagerModule; import com.facebook.react.ReactActivityDelegate; import com.facebook.react.ReactFragmentActivity; import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactRootView; +import com.facebook.react.bridge.ReactContext; +import com.facebook.react.modules.core.DeviceEventManagerModule; import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; import java.util.Date; import org.devio.rn.splashscreen.SplashScreen; diff --git a/packages/mobile/android/app/src/main/java/org/celo/mobile/NdkCrashService.java b/packages/mobile/android/app/src/main/java/org/celo/mobile/NdkCrashService.java index 130b3b4cec9..275d4784f72 100644 --- a/packages/mobile/android/app/src/main/java/org/celo/mobile/NdkCrashService.java +++ b/packages/mobile/android/app/src/main/java/org/celo/mobile/NdkCrashService.java @@ -5,8 +5,8 @@ import java.io.BufferedReader; import java.io.File; import java.io.FileWriter; -import java.io.InputStreamReader; import java.io.IOException; +import java.io.InputStreamReader; import ru.ivanarh.jndcrash.NDCrashService; public class NdkCrashService extends NDCrashService { @@ -32,10 +32,10 @@ public void onCrash(String reportPath) { Log.d( TAG, "Logcat logs for the native error (from last " + - NUM_LOGCAT_LINES + - " lines): \"" + - logcatLogs + - "\"" + NUM_LOGCAT_LINES + + " lines): \"" + + logcatLogs + + "\"" ); try (FileWriter fileWriter = new FileWriter(ndkLogcatLogsReportPath, false/* append */)) { for (String line : logcatLogs.split("\n")) { diff --git a/packages/mobile/src/account/Analytics.tsx b/packages/mobile/src/account/Analytics.tsx index 7a13f986667..8ac23491e2a 100644 --- a/packages/mobile/src/account/Analytics.tsx +++ b/packages/mobile/src/account/Analytics.tsx @@ -55,7 +55,6 @@ const style = StyleSheet.create({ }, }) -export default connect( - mapStateToProps, - { setAnalyticsEnabled } -)(withTranslation(Namespaces.accountScreen10)(Analytics)) +export default connect(mapStateToProps, { + setAnalyticsEnabled, +})(withTranslation(Namespaces.accountScreen10)(Analytics)) diff --git a/packages/mobile/src/account/DollarEducation.tsx b/packages/mobile/src/account/DollarEducation.tsx index ecd97d49cd2..31d5a8e0de3 100644 --- a/packages/mobile/src/account/DollarEducation.tsx +++ b/packages/mobile/src/account/DollarEducation.tsx @@ -64,8 +64,5 @@ export class DollarEducation extends React.Component { } export default componentWithAnalytics( - connect<{}, DispatchProps>( - null, - { setEducationCompleted } - )(DollarEducation) + connect<{}, DispatchProps>(null, { setEducationCompleted })(DollarEducation) ) diff --git a/packages/mobile/src/account/EditProfile.tsx b/packages/mobile/src/account/EditProfile.tsx index 74ee88111ab..4f54bf0020c 100644 --- a/packages/mobile/src/account/EditProfile.tsx +++ b/packages/mobile/src/account/EditProfile.tsx @@ -89,9 +89,6 @@ const style = StyleSheet.create({ }, }) -export default connect( - mapStateToProps, - { - setName, - } -)(withTranslation(Namespaces.accountScreen10)(EditProfile)) +export default connect(mapStateToProps, { + setName, +})(withTranslation(Namespaces.accountScreen10)(EditProfile)) diff --git a/packages/mobile/src/account/GoldEducation.tsx b/packages/mobile/src/account/GoldEducation.tsx index 188c8539bc9..1af1ee14e56 100644 --- a/packages/mobile/src/account/GoldEducation.tsx +++ b/packages/mobile/src/account/GoldEducation.tsx @@ -62,8 +62,5 @@ export class GoldEducation extends React.Component { } export default componentWithAnalytics( - connect<{}, DispatchProps>( - null, - { setEducationCompleted } - )(GoldEducation) + connect<{}, DispatchProps>(null, { setEducationCompleted })(GoldEducation) ) diff --git a/packages/mobile/src/account/PhotosEducation.tsx b/packages/mobile/src/account/PhotosEducation.tsx index 33b5c936499..b3ee0e25180 100644 --- a/packages/mobile/src/account/PhotosEducation.tsx +++ b/packages/mobile/src/account/PhotosEducation.tsx @@ -48,8 +48,5 @@ export class PhotosEducation extends React.Component { } export default componentWithAnalytics( - connect<{}, DispatchProps>( - null, - { photosNUXCompleted } - )(PhotosEducation) + connect<{}, DispatchProps>(null, { photosNUXCompleted })(PhotosEducation) ) diff --git a/packages/mobile/src/app/saga.test.ts b/packages/mobile/src/app/saga.test.ts index 3541e0cb2cc..7ffadfeaa5a 100644 --- a/packages/mobile/src/app/saga.test.ts +++ b/packages/mobile/src/app/saga.test.ts @@ -62,14 +62,20 @@ describe('App saga', () => { it('Version Deprecated', async () => { await expectSaga(checkAppDeprecation) - .provide([[call(waitForRehydrate), null], [call(isAppVersionDeprecated), true]]) + .provide([ + [call(waitForRehydrate), null], + [call(isAppVersionDeprecated), true], + ]) .run() expect(navigate).toHaveBeenCalledWith(Screens.UpgradeScreen) }) it('Version Not Deprecated', async () => { await expectSaga(checkAppDeprecation) - .provide([[call(waitForRehydrate), null], [call(isAppVersionDeprecated), false]]) + .provide([ + [call(waitForRehydrate), null], + [call(isAppVersionDeprecated), false], + ]) .run() expect(navigate).not.toHaveBeenCalled() }) diff --git a/packages/mobile/src/backup/BackupComplete.tsx b/packages/mobile/src/backup/BackupComplete.tsx index 47c777ded09..9a2e2fc0a39 100644 --- a/packages/mobile/src/backup/BackupComplete.tsx +++ b/packages/mobile/src/backup/BackupComplete.tsx @@ -55,15 +55,15 @@ class BackupComplete extends React.Component { - {backupCompleted && - !socialBackupCompleted && ( - <> - {t('backupComplete.0')} - {t('backupComplete.1')} - - )} - {backupCompleted && - socialBackupCompleted && {t('backupComplete.2')}} + {backupCompleted && !socialBackupCompleted && ( + <> + {t('backupComplete.0')} + {t('backupComplete.1')} + + )} + {backupCompleted && socialBackupCompleted && ( + {t('backupComplete.2')} + )} ) @@ -92,10 +92,7 @@ const styles = StyleSheet.create({ }) export default componentWithAnalytics( - connect( - mapStateToProps, - { - exitBackupFlow, - } - )(withTranslation(Namespaces.backupKeyFlow6)(BackupComplete)) + connect(mapStateToProps, { + exitBackupFlow, + })(withTranslation(Namespaces.backupKeyFlow6)(BackupComplete)) ) diff --git a/packages/mobile/src/backup/BackupIntroduction.tsx b/packages/mobile/src/backup/BackupIntroduction.tsx index d275acaacf3..7710b95710d 100644 --- a/packages/mobile/src/backup/BackupIntroduction.tsx +++ b/packages/mobile/src/backup/BackupIntroduction.tsx @@ -105,29 +105,27 @@ class BackupIntroduction extends React.Component { {t('backupKeyIntro.1')} )} - {backupCompleted && - !socialBackupCompleted && ( - <> - - {t('backupKeyIntro.2')} - {t('backupKeyIntro.3')} - - {t('backupKeyIntro.4')} - - )} - {backupCompleted && - socialBackupCompleted && ( - <> - - {t('backupKeyIntro.2')} - {t('backupKeyIntro.3')} - - - {t('backupKeyIntro.5')} - {t('backupKeyIntro.6')} - - - )} + {backupCompleted && !socialBackupCompleted && ( + <> + + {t('backupKeyIntro.2')} + {t('backupKeyIntro.3')} + + {t('backupKeyIntro.4')} + + )} + {backupCompleted && socialBackupCompleted && ( + <> + + {t('backupKeyIntro.2')} + {t('backupKeyIntro.3')} + + + {t('backupKeyIntro.5')} + {t('backupKeyIntro.6')} + + + )} {doingPinVerification && ( @@ -141,53 +139,50 @@ class BackupIntroduction extends React.Component { standard={false} type={BtnTypes.PRIMARY} /> - {backupTooLate && - !backupDelayedTime && ( -