Skip to content

Commit

Permalink
feat: prettier added and homepage lighthouse score optimization (celo…
Browse files Browse the repository at this point in the history
  • Loading branch information
viral-sangani authored Dec 21, 2022
1 parent 7027f4d commit 3de5466
Show file tree
Hide file tree
Showing 265 changed files with 2,618 additions and 2,534 deletions.
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
};
2 changes: 1 addition & 1 deletion blog/2022-01-02-hellocontracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Let's create a migration to deploy the contract. For that, we need to create a f
```javascript
var HelloWorld = artifacts.require("HelloWorld");

module.exports = function(deployer) {
module.exports = function (deployer) {
deployer.deploy(HelloWorld);
};
```
Expand Down
6 changes: 3 additions & 3 deletions blog/2022-01-03-hello-contract-remote-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ After compiling the contract, you need to create a migration to deploy the contr
```javascript title="migrations/2_deploy_helloworld.js"
var HelloWorld = artifacts.require("HelloWorld");

module.exports = function(deployer) {
module.exports = function (deployer) {
deployer.deploy(HelloWorld);
};
```
Expand Down Expand Up @@ -238,8 +238,8 @@ The entire deployment script is about 20 lines of code.
const Web3 = require("web3");
const ContractKit = require("@celo/contractkit");
const web3 = new Web3("https://alfajores-forno.celo-testnet.org");
const privateKeyToAddress = require("@celo/utils/lib/address")
.privateKeyToAddress;
const privateKeyToAddress =
require("@celo/utils/lib/address").privateKeyToAddress;
const kit = ContractKit.newKitFromWeb3(web3);
require("dotenv").config();
const HelloWorld = require("./build/contracts/HelloWorld.json");
Expand Down
5 changes: 2 additions & 3 deletions blog/2022-01-06-web-dapp.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,8 @@ A prerequisite to [voting on Celo governance proposals](/celo-owner-guide/voting
const lockValue = new BigNumber(res.flags.value);

const lockedGold = await this.kit.contracts.getLockedGold();
const pendingWithdrawalsValue = await lockedGold.getPendingWithdrawalsTotalValue(
address
);
const pendingWithdrawalsValue =
await lockedGold.getPendingWithdrawalsTotalValue(address);
const relockValue = BigNumber.minimum(pendingWithdrawalsValue, value);
const lockValue = value.minus(relockValue);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ Create a file called `1.Greeter.test.ts` and add the following content.
import { expect } from "chai";
import { Contract } from "ethers";
import { ethers } from "hardhat";
describe("Greeter", function() {
describe("Greeter", function () {
let greeter: Contract;
beforeEach(async function() {
beforeEach(async function () {
const Greeter = await ethers.getContractFactory("Greeter");
greeter = await Greeter.deploy();
await greeter.deployed();
});
it("should greet correctly before and after changing value", async function() {
it("should greet correctly before and after changing value", async function () {
await greeter.setGreeting("Celo to the Moon");
expect(await greeter.greet()).to.equal("Celo to the Moon");
});
Expand Down Expand Up @@ -207,18 +207,18 @@ Writing unit tests for GreeterV2 before deploying.
import { expect } from "chai";
import { BigNumber, Contract } from "ethers";
import { ethers } from "hardhat";
describe("Greeter V2", function() {
describe("Greeter V2", function () {
let greeterV2: Contract;
beforeEach(async function() {
beforeEach(async function () {
const GreeterV2 = await ethers.getContractFactory("GreeterV2");
greeterV2 = await GreeterV2.deploy();
await greeterV2.deployed();
});
it("should retrieve value previously stored", async function() {
it("should retrieve value previously stored", async function () {
await greeterV2.setGreeting("Celo to the Moon");
expect(await greeterV2.greet()).to.equal("Celo to the Moon");
});
it("should increment value correctly", async function() {
it("should increment value correctly", async function () {
expect(await greeterV2.counter()).to.equal(BigNumber.from("0"));
await greeterV2.increment();
expect(await greeterV2.counter()).to.equal(BigNumber.from("1"));
Expand Down Expand Up @@ -249,18 +249,18 @@ The above test was designed to only test `GreeterV2.sol` not the upgraded versio
import { expect } from "chai";
import { Contract } from "ethers";
import { ethers, upgrades } from "hardhat";
describe("Greeter (proxy) V2", function() {
describe("Greeter (proxy) V2", function () {
let greeter: Contract;
let greeterV2: Contract;
beforeEach(async function() {
beforeEach(async function () {
const Greeter = await ethers.getContractFactory("Greeter");
const GreeterV2 = await ethers.getContractFactory("GreeterV2");
greeter = await upgrades.deployProxy(Greeter);
// setting the greet value so that it can be checked after upgrade
await greeter.setGreeting("WAGMI");
greeterV2 = await upgrades.upgradeProxy(greeter.address, GreeterV2);
});
it("should retrieve value previously stored correctly", async function() {
it("should retrieve value previously stored correctly", async function () {
expect(await greeterV2.greet()).to.equal("WAGMI");
await greeter.setGreeting("Celo to the Moon");
expect(await greeterV2.greet()).to.equal("Celo to the Moon");
Expand Down Expand Up @@ -371,11 +371,11 @@ Let’s write test cases to deploy and test `GreeterV3` . Create a file called `
import { expect } from "chai";
import { BigNumber, Contract } from "ethers";
import { ethers, upgrades } from "hardhat";
describe("Greeter (proxy) V3 with name", function() {
describe("Greeter (proxy) V3 with name", function () {
let greeter: Contract;
let greeterV2: Contract;
let greeterV3: Contract;
beforeEach(async function() {
beforeEach(async function () {
const Greeter = await ethers.getContractFactory("Greeter");
const GreeterV2 = await ethers.getContractFactory("GreeterV2");
const GreeterV3 = await ethers.getContractFactory("GreeterV3");
Expand All @@ -385,13 +385,13 @@ describe("Greeter (proxy) V3 with name", function() {
greeterV2 = await upgrades.upgradeProxy(greeter.address, GreeterV2);
greeterV3 = await upgrades.upgradeProxy(greeter.address, GreeterV3);
});
it("should retrieve value previously stored and increment correctly", async function() {
it("should retrieve value previously stored and increment correctly", async function () {
expect(await greeterV2.greet()).to.equal("WAGMI ");
expect(await greeterV3.counter()).to.equal(BigNumber.from("0"));
await greeterV2.increment();
expect(await greeterV3.counter()).to.equal(BigNumber.from("1"));
});
it("should set name correctly in V3", async function() {
it("should set name correctly in V3", async function () {
expect(await greeterV3.name()).to.equal("");
const name = "Viral";
await greeterV3.setName(name);
Expand Down Expand Up @@ -504,12 +504,12 @@ Let’s write test cases for `GreeterV4.sol`
import { expect } from "chai";
import { Contract } from "ethers";
import { ethers, upgrades } from "hardhat";
describe("Greeter (proxy) V4 with getName", function() {
describe("Greeter (proxy) V4 with getName", function () {
let greeter: Contract;
let greeterV2: Contract;
let greeterV3: Contract;
let greeterV4: Contract;
beforeEach(async function() {
beforeEach(async function () {
const Greeter = await ethers.getContractFactory("Greeter");
const GreeterV2 = await ethers.getContractFactory("GreeterV2");
const GreeterV3 = await ethers.getContractFactory("GreeterV3");
Expand All @@ -519,7 +519,7 @@ describe("Greeter (proxy) V4 with getName", function() {
greeterV3 = await upgrades.upgradeProxy(greeter.address, GreeterV3);
greeterV4 = await upgrades.upgradeProxy(greeter.address, GreeterV4);
});
it("should setName and getName correctly in V4", async function() {
it("should setName and getName correctly in V4", async function () {
expect(await greeterV4.getName()).to.equal("");
const greetername = "Celo";
await greeterV4.setName(greetername);
Expand Down
2 changes: 1 addition & 1 deletion blog/authors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ josh:
name: Josh Crites
title: Developer Relations, cLabs
url: https://github.com/critesjosh
image_url: https://github.com/critesjosh.png
image_url: https://github.com/critesjosh.png
4 changes: 2 additions & 2 deletions blog/styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.observable-notebook {
background: white;
}
background: white;
}
1 change: 0 additions & 1 deletion docs/cli/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Manage your account, keys, and metadata


## `celocli account:authorize`

Keep your locked Gold more secure by authorizing alternative keys to be used for signing attestations, voting, or validating. By doing so, you can continue to participate in the protocol while keeping the key with access to your locked Gold in cold storage. You must include a "proof-of-possession" of the key being authorized, which can be generated with the "account:proof-of-possession" command.
Expand Down
1 change: 0 additions & 1 deletion docs/cli/autocomplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

display autocomplete installation instructions


## `celocli autocomplete [SHELL]`

display autocomplete installation instructions
Expand Down
1 change: 0 additions & 1 deletion docs/cli/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

list all the commands


## `celocli commands`

list all the commands
Expand Down
1 change: 0 additions & 1 deletion docs/cli/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Configure CLI options which persist across commands


## `celocli config:get`

Output network node configuration
Expand Down
1 change: 0 additions & 1 deletion docs/cli/dkg.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Publish your locally computed DKG results to the blockchain


## `celocli dkg:allowlist`

Allowlist an address in the DKG
Expand Down
1 change: 0 additions & 1 deletion docs/cli/election.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Participate in and view the state of Validator Elections


## `celocli election:activate`

Activate pending votes in validator elections to begin earning rewards. To earn rewards as a voter, it is required to activate your pending votes at some point after the end of the epoch in which they were made.
Expand Down
1 change: 0 additions & 1 deletion docs/cli/exchange.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Exchange Celo Dollars and CELO via the stability mechanism


## `celocli exchange:celo`

Exchange CELO for StableTokens via the stability mechanism. (Note: this is the equivalent of the old exchange:gold)
Expand Down
1 change: 0 additions & 1 deletion docs/cli/governance.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Interact with on-chain governance proposals and hotfixes


## `celocli governance:build-proposal`

Interactively build a governance proposal
Expand Down
1 change: 0 additions & 1 deletion docs/cli/grandamento.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Cancels a Granda Mento exchange proposal


## `celocli grandamento:cancel`

Cancels a Granda Mento exchange proposal
Expand Down
1 change: 0 additions & 1 deletion docs/cli/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

display help for celocli


## `celocli help [COMMAND]`

display help for celocli
Expand Down
1 change: 0 additions & 1 deletion docs/cli/identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Interact with ODIS and the attestations service


## `celocli identity:current-attestation-services`

Outputs the set of validators currently participating in BFT and which ones are participating in Celo's lightweight identity protocol
Expand Down
3 changes: 2 additions & 1 deletion docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Introduction to the Celo Command Line Interface and installation instructions.
The Command Line Interface allows users to interact with the Celo Protocol smart contracts.

It’s a command-line interface around the ContractKit. It allows you to interact with the Celo Protocol and smart contracts using command-line tools rather than writing JavaScript. It provides modules for interacting with modules on the ContractKit and is an excellent code reference when defining your own modules. Some common features you may want to consider are helping users participate in elections or in on-chain governance, voting for validators, or helping users interact with multi-sig contracts.

## NPM Package

The Celo CLI is published as a node module on NPM. Assuming you have [npm](https://www.npmjs.com/get-npm) and [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) both installed, you can install the Celo CLI using the following command:
Expand Down Expand Up @@ -93,7 +94,7 @@ You can specify the number of addresses to get for local signing with the `--led

You can specify an array of index addresses for local signing. Example `--ledgerCustomAddresses "[4,99]"`.

For example:
For example:

```shell
celocli transfer:celo --to <addressOfChoice> --value 1000000 --from <accountAddress> --useLedger
Expand Down
1 change: 0 additions & 1 deletion docs/cli/lockedgold.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

View and manage locked CELO


## `celocli lockedgold:lock`

Locks CELO to be used in governance and validator elections.
Expand Down
1 change: 0 additions & 1 deletion docs/cli/multisig.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Shows information about multi-sig contract


## `celocli multisig:show ADDRESS`

Shows information about multi-sig contract
Expand Down
1 change: 0 additions & 1 deletion docs/cli/network.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ description: View details about the network, like contracts and parameters

View details about the network, like contracts and parameters


## `celocli network:contracts`

Lists Celo core contracts and their addesses.
Expand Down
1 change: 0 additions & 1 deletion docs/cli/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Manage your Celo node


## `celocli node:accounts`

List the addresses that this node has the private keys for.
Expand Down
1 change: 0 additions & 1 deletion docs/cli/oracle.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

List oracle addresses for a given token


## `celocli oracle:list TOKEN`

List oracle addresses for a given token
Expand Down
1 change: 0 additions & 1 deletion docs/cli/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

list installed plugins


## `celocli plugins`

list installed plugins
Expand Down
1 change: 0 additions & 1 deletion docs/cli/releasegold.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

View and manage Release Gold contracts


## `celocli releasegold:authorize`

Authorize an alternative key to be used for a given action (Vote, Validate, Attest) on behalf of the ReleaseGold instance contract.
Expand Down
1 change: 0 additions & 1 deletion docs/cli/reserve.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Shows information about reserve


## `celocli reserve:status`

Shows information about reserve
Expand Down
1 change: 0 additions & 1 deletion docs/cli/rewards.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Show rewards information about a voter, registered Validator, or Validator Group


## `celocli rewards:show`

Show rewards information about a voter, registered Validator, or Validator Group
Expand Down
1 change: 0 additions & 1 deletion docs/cli/transfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Transfer CELO and Celo Dollars


## `celocli transfer:celo`

Transfer CELO to a specified address. (Note: this is the equivalent of the old transfer:gold)
Expand Down
1 change: 0 additions & 1 deletion docs/cli/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

View and manage Validators


## `celocli validator:affiliate GROUPADDRESS`

Affiliate a Validator with a Validator Group. This allows the Validator Group to add that Validator as a member. If the Validator is already a member of a Validator Group, affiliating with a different Group will remove the Validator from the first group's members.
Expand Down
1 change: 0 additions & 1 deletion docs/cli/validatorgroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

View and manage Validator Groups


## `celocli validatorgroup:commission`

Manage the commission for a registered Validator Group. This represents the share of the epoch rewards given to elected Validators that goes to the group they are a member of. Updates must be made in a two step process where the group owner first calls uses the queue-update option, then after the required update delay, the apply option. The commission update delay, in blocks, can be viewed with the network:parameters command. A groups next commission update block can be checked with validatorgroup:show
Expand Down
2 changes: 1 addition & 1 deletion docs/community/CIP-contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ CIP template:

For questions, comments, and discussions please use the [Celo Forum](https://forum.celo.org/) or [Discord](https://chat.celo.org/).

:::
:::
Loading

0 comments on commit 3de5466

Please sign in to comment.