-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into mc/proposer-fraction
- Loading branch information
Showing
159 changed files
with
5,010 additions
and
903 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:8 | ||
FROM node:10 | ||
WORKDIR /celo-monorepo | ||
|
||
# ensure yarn.lock is evaluated by kaniko cache diff | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:8 | ||
FROM node:10 | ||
WORKDIR /celo-monorepo | ||
|
||
# Needed for gsutil | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:8 | ||
FROM node:10 | ||
WORKDIR /celo-monorepo | ||
|
||
# Needed for gsutil | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/cli/src/commands/identity/change-attestation-service-url.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { createAttestationServiceURLClaim } from '@celo/contractkit/lib/identity' | ||
import { IArg } from '@oclif/parser/lib/args' | ||
import { BaseCommand } from '../../base' | ||
import { Args, Flags } from '../../utils/command' | ||
import { modifyMetadata } from '../../utils/identity' | ||
|
||
export default class ChangeAttestationServiceUrl extends BaseCommand { | ||
static description = 'Change the URL of the attestation service in a local metadata file' | ||
|
||
static flags = { | ||
...BaseCommand.flags, | ||
url: Flags.url({ | ||
required: true, | ||
description: 'The url you want to claim', | ||
}), | ||
} | ||
|
||
static args: IArg[] = [Args.file('file', { description: 'Path of the metadata file' })] | ||
|
||
static examples = ['change-attestation-service-url ~/metadata.json'] | ||
|
||
async run() { | ||
const res = this.parse(ChangeAttestationServiceUrl) | ||
modifyMetadata(res.args.file, (metadata) => { | ||
const claim = createAttestationServiceURLClaim(res.flags.url) | ||
metadata.addClaim(claim) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { createDomainClaim } from '@celo/contractkit/lib/identity' | ||
import { flags } from '@oclif/command' | ||
import { IArg } from '@oclif/parser/lib/args' | ||
import { BaseCommand } from '../../base' | ||
import { Args } from '../../utils/command' | ||
import { modifyMetadata } from '../../utils/identity' | ||
|
||
export default class ChangeDomain extends BaseCommand { | ||
static description = 'Change the domain in a local metadata file' | ||
|
||
static flags = { | ||
...BaseCommand.flags, | ||
domain: flags.string({ | ||
required: true, | ||
description: 'The domain you want to claim', | ||
}), | ||
} | ||
|
||
static args: IArg[] = [Args.file('file', { description: 'Path of the metadata file' })] | ||
|
||
static examples = ['change-domain ~/metadata.json'] | ||
|
||
async run() { | ||
const res = this.parse(ChangeDomain) | ||
modifyMetadata(res.args.file, (metadata) => { | ||
const claim = createDomainClaim(res.flags.domain) | ||
metadata.addClaim(claim) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { createNameClaim } from '@celo/contractkit/lib/identity' | ||
import { flags } from '@oclif/command' | ||
import { IArg } from '@oclif/parser/lib/args' | ||
import { BaseCommand } from '../../base' | ||
import { Args } from '../../utils/command' | ||
import { modifyMetadata } from '../../utils/identity' | ||
|
||
export default class ChangeName extends BaseCommand { | ||
static description = 'Change the name in a local metadata file' | ||
|
||
static flags = { | ||
...BaseCommand.flags, | ||
name: flags.string({ | ||
required: true, | ||
description: 'The name you want to claim', | ||
}), | ||
} | ||
|
||
static args: IArg[] = [Args.file('file', { description: 'Path of the metadata file' })] | ||
|
||
static examples = ['change-name ~/metadata.json'] | ||
|
||
async run() { | ||
const res = this.parse(ChangeName) | ||
modifyMetadata(res.args.file, (metadata) => { | ||
const claim = createNameClaim(res.flags.name) | ||
metadata.addClaim(claim) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { IdentityMetadataWrapper } from '@celo/contractkit/lib/identity' | ||
import { IArg } from '@oclif/parser/lib/args' | ||
import { writeFileSync } from 'fs' | ||
import { BaseCommand } from '../../base' | ||
import { Args } from '../../utils/command' | ||
|
||
export default class CreateMetadata extends BaseCommand { | ||
static description = 'Create an empty metadata file' | ||
|
||
static flags = { | ||
...BaseCommand.flags, | ||
} | ||
|
||
static args: IArg[] = [ | ||
Args.newFile('file', { description: 'Path where the metadata should be saved' }), | ||
] | ||
|
||
static examples = ['create-metadata ~/metadata.json'] | ||
|
||
async run() { | ||
const { args } = this.parse(CreateMetadata) | ||
const metadata = new IdentityMetadataWrapper(IdentityMetadataWrapper.emptyData) | ||
writeFileSync(args.file, metadata.toString()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { BaseCommand } from '../../base' | ||
import { displaySendTx } from '../../utils/cli' | ||
import { Flags } from '../../utils/command' | ||
|
||
export default class RegisterMetadata extends BaseCommand { | ||
static description = 'Register metadata about an address' | ||
|
||
static flags = { | ||
...BaseCommand.flags, | ||
from: Flags.address({ | ||
required: true, | ||
description: 'Addess of the account to set metadata for', | ||
}), | ||
url: Flags.url({ | ||
required: true, | ||
description: 'The url to the metadata you want to register', | ||
}), | ||
} | ||
|
||
static examples = ['register-metadata --url https://www.celo.org --from 0x0'] | ||
|
||
async run() { | ||
const { flags } = this.parse(RegisterMetadata) | ||
this.kit.defaultAccount = flags.from | ||
const attestations = await this.kit.contracts.getAttestations() | ||
await displaySendTx('registerMetadata', attestations.setMetadataURL(flags.url)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { IdentityMetadataWrapper } from '@celo/contractkit/lib/identity' | ||
import { IArg } from '@oclif/parser/lib/args' | ||
import { BaseCommand } from '../../base' | ||
import { Args } from '../../utils/command' | ||
import { displayMetadata } from '../../utils/identity' | ||
|
||
export default class ShowMetadata extends BaseCommand { | ||
static description = 'Show the data in a local metadata file' | ||
|
||
static flags = { | ||
...BaseCommand.flags, | ||
} | ||
|
||
static args: IArg[] = [Args.file('file', { description: 'Path of the metadata file' })] | ||
|
||
static examples = ['show-metadata ~/metadata.json'] | ||
|
||
async run() { | ||
const res = this.parse(ShowMetadata) | ||
const metadata = IdentityMetadataWrapper.fromFile(res.args.file) | ||
console.info(`Metadata at ${res.args.file} contains the following claims: \n`) | ||
displayMetadata(metadata) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.