Skip to content

Commit

Permalink
aliases releasecelo to releasegold (#10790)
Browse files Browse the repository at this point in the history
* Fix #10688 - aliases releasecelo to releasegold

* add a note about cli terminology

* long overdue change of gold to celo (in places where a human is the intended reader)
  • Loading branch information
aaronmgdr authored Dec 8, 2023
1 parent 1c9c844 commit bb3cf9f
Show file tree
Hide file tree
Showing 28 changed files with 556 additions and 53 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-cycles-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@celo/celocli': patch
---

update terminology: refer to celo not gold.
5 changes: 5 additions & 0 deletions .changeset/light-buses-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@celo/celocli': patch
---

Alias releasecelo to releasegold
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ packages/docs/developer-resources/wallet-remote/reference/**/*.md -diff -merge
packages/docs/developer-resources/wallet-remote/reference/**/*.md linguist-generated=true
packages/docs/developer-resources/wallet-rpc/reference/**/*.md -diff -merge
packages/docs/developer-resources/wallet-rpc/reference/**/*.md linguist-generated=true
packages/docs/command-line-interface/**/*.md -diff -merge
packages/docs/command-line-interface/**/*.md linguist-generated=true
# packages/docs/command-line-interface/**/*.md -diff -merge
# packages/docs/command-line-interface/**/*.md linguist-generated=true
6 changes: 5 additions & 1 deletion .github/workflows/celo-monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,16 @@ jobs:
if [[ $(git status packages/docs/command-line-interface --porcelain) ]]; then
git --no-pager diff packages/docs/command-line-interface
echo "There are git differences after generating CLI docs"
git status
git diff
exit 1
fi
- name: Verify that a new account can be created
run: |
yarn --cwd=packages/cli run celocli account:new
- name: Test that releasecelo command topic is working
run: |
yarn --cwd=packages/cli run celocli releasecelo --help
typescript-tests:
name: Typescript package Tests
runs-on: ['self-hosted', 'monorepo-node18']
Expand Down
12 changes: 12 additions & 0 deletions packages/cli/dev-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# Developer Guide for CLI

* Things to note *

## Terminology

```
# bin topic command flag
^ ^ ^ ^
celocli governance:show --help
```
5 changes: 4 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,11 @@
"node": {
"description": "Manage your Celo node"
},
"releasecelo": {
"description": "View and manage ReleaseGold contracts"
},
"releasegold": {
"description": "View and manage Release Gold contracts"
"description": "Alias for releasecelo"
},
"transfer": {
"description": "Transfer CELO and Celo Dollars"
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/lockedgold/delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Flags } from '../../utils/command'
import { LockedGoldArgs } from '../../utils/lockedgold'

export default class Delegate extends BaseCommand {
static description = 'Delegate locked gold.'
static description = 'Delegate locked celo.'

static flags = {
...BaseCommand.flags,
Expand All @@ -18,7 +18,7 @@ export default class Delegate extends BaseCommand {
percent: flags.string({
...LockedGoldArgs.valueArg,
required: true,
description: '1-100% of locked gold to be delegated',
description: '1-100% of locked celo to be delegated',
}),
}

Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/lockedgold/revoke-delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Flags } from '../../utils/command'
import { LockedGoldArgs } from '../../utils/lockedgold'

export default class RevokeDelegate extends BaseCommand {
static description = 'Revoke delegated locked gold.'
static description = 'Revoke delegated locked celo.'

static flags = {
...BaseCommand.flags,
Expand All @@ -18,7 +18,7 @@ export default class RevokeDelegate extends BaseCommand {
percent: flags.string({
...LockedGoldArgs.valueArg,
required: true,
description: '1-100% of locked gold to be revoked from currently delegated amount',
description: '1-100% of locked celo to be revoked from currently delegated amount',
}),
}

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/lockedgold/show.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Args } from '../../utils/command'

export default class Show extends BaseCommand {
static description =
'Show Locked Gold information for a given account. This includes the total amount of locked gold, the amount being used for voting in Validator Elections, the Locked Gold balance this account is required to maintain due to a registered Validator or Validator Group, and any pending withdrawals that have been initiated via "lockedgold:unlock".'
'Show Locked Gold information for a given account. This includes the total amount of locked celo, the amount being used for voting in Validator Elections, the Locked Gold balance this account is required to maintain due to a registered Validator or Validator Group, and any pending withdrawals that have been initiated via "lockedgold:unlock".'

static flags = {
...BaseCommand.flags,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/lockedgold/unlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { LockedGoldArgs } from '../../utils/lockedgold'

export default class Unlock extends BaseCommand {
static description =
'Unlocks CELO, which can be withdrawn after the unlocking period. Unlocked gold will appear as a "pending withdrawal" until the unlocking period is over, after which it can be withdrawn via "lockedgold:withdraw".'
'Unlocks CELO, which can be withdrawn after the unlocking period. Unlocked celo will appear as a "pending withdrawal" until the unlocking period is over, after which it can be withdrawn via "lockedgold:withdraw".'

static flags = {
...BaseCommand.flags,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Flags } from '../../utils/command'

export default class UpdateDelegatedAmount extends BaseCommand {
static description =
'Updates the amount of delegated locked gold. There might be discrepancy between the amount of locked gold and the amount of delegated locked gold because of received rewards.'
'Updates the amount of delegated locked celo. There might be discrepancy between the amount of locked celo and the amount of delegated locked celo because of received rewards.'

static flags = {
...BaseCommand.flags,
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/commands/releasecelo
2 changes: 1 addition & 1 deletion packages/cli/src/commands/releasegold/admin-revoke.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ testWithGanache('releasegold:admin-revoke cmd', (web3: Web3) => {
expect(destroyedContract).toBe(contractAddress)
})

describe('#when account exists with locked gold', () => {
describe('#when account exists with locked celo', () => {
const value = '10'

beforeEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/releasegold/admin-revoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default class AdminRevoke extends ReleaseGoldBaseCommand {
'ReleaseGoldInstanceDestroyed'
)
} else {
console.log('Some gold is still locked, printing pending withdrawals...')
console.log('Some celo is still locked, printing pending withdrawals...')
const lockedGold = await this.kit.contracts.getLockedGold()
const pendingWithdrawals = await lockedGold.getPendingWithdrawals(this.contractAddress)
pendingWithdrawals.forEach((w) => printValueMap(w))
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/releasegold/locked-gold.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ testWithGanache('releasegold:locked-gold cmd', (web3: Web3) => {
await testLocally(CreateAccount, ['--contract', contractAddress])
})

test('can lock gold with pending withdrawals', async () => {
test('can lock celo with pending withdrawals', async () => {
const lockedGold = await kit.contracts.getLockedGold()
await testLocally(LockedGold, [
'--contract',
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/releasegold/locked-gold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export default class LockedGold extends ReleaseGoldBaseCommand {
action: flags.string({
char: 'a',
options: ['lock', 'unlock', 'withdraw'],
description: "Action to perform on contract's gold",
description: "Action to perform on contract's celo",
required: true,
}),
value: Flags.wei({ required: true, description: 'Amount of gold to perform `action` with' }),
value: Flags.wei({ required: true, description: 'Amount of celo to perform `action` with' }),
yes: flags.boolean({ description: 'Answer yes to prompt' }),
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ testWithGanache('releasegold:refund-and-finalize cmd', (web3: Web3) => {
kit = newKitFromWeb3(web3)
})

test('can refund gold', async () => {
test('can refund celo', async () => {
await testLocally(Revoke, ['--contract', contractAddress, '--yesreally'])
const releaseGoldWrapper = new ReleaseGoldWrapper(
kit.connection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class RefundAndFinalize extends ReleaseGoldBaseCommand {

await newCheckBuilder(this)
.addCheck('Contract is revoked', () => isRevoked)
.addCheck('All contract gold is unlocked', () => remainingLockedBalance.eq(0))
.addCheck('All contract celo is unlocked', () => remainingLockedBalance.eq(0))
.runChecks()

this.kit.defaultAccount = await this.releaseGoldWrapper.getReleaseOwner()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { displaySendTx } from '../../utils/cli'
import { ReleaseGoldBaseCommand } from '../../utils/release-gold-base'

export default class SetMaxDistribution extends ReleaseGoldBaseCommand {
static description = 'Set the maximum distribution of gold for the given contract'
static description = 'Set the maximum distribution of celo for the given contract'

static flags = {
...ReleaseGoldBaseCommand.flags,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/releasegold/withdraw.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ testWithGanache('releasegold:withdraw cmd', (web3: Web3) => {
await testLocally(CreateAccount, ['--contract', contractAddress])
})

test('can withdraw released gold to beneficiary', async () => {
test('can withdraw released celo to beneficiary', async () => {
await testLocally(SetLiquidityProvision, ['--contract', contractAddress, '--yesreally'])
// ReleasePeriod of default contract
await timeTravel(300000000, web3)
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/commands/releasegold/withdraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { ReleaseGoldBaseCommand } from '../../utils/release-gold-base'

export default class Withdraw extends ReleaseGoldBaseCommand {
static description =
'Withdraws `value` released gold to the beneficiary address. Fails if `value` worth of gold has not been released yet.'
'Withdraws `value` released celo to the beneficiary address. Fails if `value` worth of celo has not been released yet.'

static flags = {
...ReleaseGoldBaseCommand.flags,
value: Flags.wei({
required: true,
description: 'Amount of released gold (in wei) to withdraw',
description: 'Amount of released celo (in wei) to withdraw',
}),
}

Expand All @@ -30,7 +30,7 @@ export default class Withdraw extends ReleaseGoldBaseCommand {
const maxDistribution = await this.releaseGoldWrapper.getMaxDistribution()
const totalWithdrawn = await this.releaseGoldWrapper.getTotalWithdrawn()
await newCheckBuilder(this)
.addCheck('Value does not exceed available unlocked gold', () =>
.addCheck('Value does not exceed available unlocked celo', () =>
value.lte(remainingUnlockedBalance)
)
.addCheck('Value would not exceed maximum distribution', () =>
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/reserve/transfergold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { displaySendTx } from '../../utils/cli'
import { Flags } from '../../utils/command'

export default class TransferGold extends BaseCommand {
static description = 'Transfers reserve gold to other reserve address'
static description = 'Transfers reserve celo to other reserve address'

static flags = {
...BaseCommand.flags,
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/commands/rewards/show.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ export default class Show extends BaseCommand {

cli.action.stop()

// At the end of each epoch: R, the total amount of rewards in gold to be allocated to stakers
// At the end of each epoch: R, the total amount of rewards in celo to be allocated to stakers
// for this epoch is programmatically derived from considering the tradeoff between paying rewards
// now vs. saving rewards for later.
//
// Every validator group has a slashing penalty M, initially M=1.0. All rewards to the group and to
// voters for the group are weighted by this factor.
//
// Let T be the total gold voting for groups eligible for rewards in this epoch. For each account
// holder, for each group, the amount of gold the account holder has voting for that group is increased
// Let T be the total celo voting for groups eligible for rewards in this epoch. For each account
// holder, for each group, the amount of celo the account holder has voting for that group is increased
// by average_epoch_score_of_elected_validators_in_group * account_gold_voting_for_group * R * M / T.
if (voterRewards.length > 0) {
console.info('')
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/src/utils/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,29 +270,29 @@ class CheckBuilder {

signerMeetsValidatorBalanceRequirements = () =>
this.addCheck(
`Signer's account has enough locked gold for registration`,
`Signer's account has enough locked celo for registration`,
this.withValidators((validators, _signer, account) =>
validators.meetsValidatorBalanceRequirements(account)
)
)

signerMeetsValidatorGroupBalanceRequirements = () =>
this.addCheck(
`Signer's account has enough locked gold for group registration`,
`Signer's account has enough locked celo for group registration`,
this.withValidators((validators, _signer, account) =>
validators.meetsValidatorGroupBalanceRequirements(account)
)
)

meetsValidatorBalanceRequirements = (account: Address) =>
this.addCheck(
`${account} has enough locked gold for registration`,
`${account} has enough locked celo for registration`,
this.withValidators((validators) => validators.meetsValidatorBalanceRequirements(account))
)

meetsValidatorGroupBalanceRequirements = (account: Address) =>
this.addCheck(
`${account} has enough locked gold for group registration`,
`${account} has enough locked celo for group registration`,
this.withValidators((validators) =>
validators.meetsValidatorGroupBalanceRequirements(account)
)
Expand Down
24 changes: 12 additions & 12 deletions packages/docs/command-line-interface/lockedgold.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ View and manage locked CELO

## `celocli lockedgold:delegate`

Delegate locked gold.
Delegate locked celo.

```
Delegate locked gold.
Delegate locked celo.
USAGE
$ celocli lockedgold:delegate
OPTIONS
--from=from (required)
--globalHelp View all available global flags
--percent=percent (required) 1-100% of locked gold to be delegated
--percent=percent (required) 1-100% of locked celo to be delegated
--to=to (required)
EXAMPLE
Expand Down Expand Up @@ -88,10 +88,10 @@ _See code: [src/commands/lockedgold/max-delegatees-count.ts](https://github.com/

## `celocli lockedgold:revoke-delegate`

Revoke delegated locked gold.
Revoke delegated locked celo.

```
Revoke delegated locked gold.
Revoke delegated locked celo.
USAGE
$ celocli lockedgold:revoke-delegate
Expand All @@ -100,7 +100,7 @@ OPTIONS
--from=from (required)
--globalHelp View all available global flags
--percent=percent (required) 1-100% of locked gold to be revoked from currently
--percent=percent (required) 1-100% of locked celo to be revoked from currently
delegated amount
--to=to (required)
Expand All @@ -114,10 +114,10 @@ _See code: [src/commands/lockedgold/revoke-delegate.ts](https://github.com/celo-

## `celocli lockedgold:show ACCOUNT`

Show Locked Gold information for a given account. This includes the total amount of locked gold, the amount being used for voting in Validator Elections, the Locked Gold balance this account is required to maintain due to a registered Validator or Validator Group, and any pending withdrawals that have been initiated via "lockedgold:unlock".
Show Locked Gold information for a given account. This includes the total amount of locked celo, the amount being used for voting in Validator Elections, the Locked Gold balance this account is required to maintain due to a registered Validator or Validator Group, and any pending withdrawals that have been initiated via "lockedgold:unlock".

```
Show Locked Gold information for a given account. This includes the total amount of locked gold, the amount being used for voting in Validator Elections, the Locked Gold balance this account is required to maintain due to a registered Validator or Validator Group, and any pending withdrawals that have been initiated via "lockedgold:unlock".
Show Locked Gold information for a given account. This includes the total amount of locked celo, the amount being used for voting in Validator Elections, the Locked Gold balance this account is required to maintain due to a registered Validator or Validator Group, and any pending withdrawals that have been initiated via "lockedgold:unlock".
USAGE
$ celocli lockedgold:show ACCOUNT
Expand All @@ -133,10 +133,10 @@ _See code: [src/commands/lockedgold/show.ts](https://github.com/celo-org/celo-mo

## `celocli lockedgold:unlock`

Unlocks CELO, which can be withdrawn after the unlocking period. Unlocked gold will appear as a "pending withdrawal" until the unlocking period is over, after which it can be withdrawn via "lockedgold:withdraw".
Unlocks CELO, which can be withdrawn after the unlocking period. Unlocked celo will appear as a "pending withdrawal" until the unlocking period is over, after which it can be withdrawn via "lockedgold:withdraw".

```
Unlocks CELO, which can be withdrawn after the unlocking period. Unlocked gold will appear as a "pending withdrawal" until the unlocking period is over, after which it can be withdrawn via "lockedgold:withdraw".
Unlocks CELO, which can be withdrawn after the unlocking period. Unlocked celo will appear as a "pending withdrawal" until the unlocking period is over, after which it can be withdrawn via "lockedgold:withdraw".
USAGE
$ celocli lockedgold:unlock
Expand All @@ -154,10 +154,10 @@ _See code: [src/commands/lockedgold/unlock.ts](https://github.com/celo-org/celo-

## `celocli lockedgold:update-delegated-amount`

Updates the amount of delegated locked gold. There might be discrepancy between the amount of locked gold and the amount of delegated locked gold because of received rewards.
Updates the amount of delegated locked celo. There might be discrepancy between the amount of locked celo and the amount of delegated locked celo because of received rewards.

```
Updates the amount of delegated locked gold. There might be discrepancy between the amount of locked gold and the amount of delegated locked gold because of received rewards.
Updates the amount of delegated locked celo. There might be discrepancy between the amount of locked celo and the amount of delegated locked celo because of received rewards.
USAGE
$ celocli lockedgold:update-delegated-amount
Expand Down
Loading

0 comments on commit bb3cf9f

Please sign in to comment.