Skip to content

Commit 89a212e

Browse files
committed
CLI cleanup and fixes (#467)
Removes unused commands from the CLI. Fixes the CLI workflow. Update Typechain imports locations.
1 parent f3134fb commit 89a212e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+154
-379
lines changed

.github/workflows/npmtest.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3-
41
name: Node.js CI
52

63
on:
74
push:
8-
branches: [master]
5+
branches: [dev]
96
pull_request:
10-
branches: [master]
7+
branches: [dev]
118

129
jobs:
1310
build:

DEPLOYMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ Some contracts require the address from previously deployed contracts. For that
106106
3. Update the `package.json` and `package-lock.json` files with the new package version and publish a new npm package with `npm publish`. You can dry-run the files to be uploaded by running `npm publish --dry-run`.
107107
4. Merge this update into master, branch off and save for whatever version of the testnet is going on, and then tag this on the github repo, pointing to your branch (ex. at `testnet-phase-1` branch). This way we can always get the contract code for testnet, while continuing to do work on mainnet.
108108
5. Pull the updated package into the subgraph, and other apps that depend on the package.json.
109-
6. Send tokens to the whole team with `./cli/cli.ts transferTeamTokens --amount 10000000`
109+
6. Send tokens to the whole team using `./cli/cli.ts airdrop`

addresses.json

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -259,18 +259,6 @@
259259
"runtimeCodeHash": "0x126ff82d91cc4a00987d757db8d244edafb91507197b052441dcc94230e4b6ce",
260260
"txHash": "0x3df6cec81fa4ebed4c7c4575c3cb645378f89ff38fcd547307d9a26820579617"
261261
}
262-
},
263-
"GRTAssetHolder": {
264-
"address": "0x0000000000000000000000000000000000000000",
265-
"creationCodeHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
266-
"runtimeCodeHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
267-
"txHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
268-
},
269-
"AttestationApp": {
270-
"address": "0x0000000000000000000000000000000000000000",
271-
"creationCodeHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
272-
"runtimeCodeHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
273-
"txHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
274262
}
275263
},
276264
"4": {
@@ -533,32 +521,6 @@
533521
"creationCodeHash": "0x26a6f47e71ad242e264768571ce7223bf5a86fd0113ab6cb8200f65820232904",
534522
"runtimeCodeHash": "0xd5330527cfb09df657adc879d8ad704ce6b8d5917265cabbd3eb073d1399f122",
535523
"txHash": "0xca463b34d7967c4351d24b2af779817bd1da75e53a48957cfa32abd1ebf3a56c"
536-
},
537-
"GRTAssetHolder": {
538-
"address": "0x94896da4a6608b4C9C9F287873cc607BaC204804",
539-
"constructorArgs": [
540-
{
541-
"name": "adjudicatorAddress",
542-
"value": "0x94Fca2E2F57B25b2D9eA5d4FCEd6c5d8d9ad3172"
543-
},
544-
{
545-
"name": "tokenAddress",
546-
"value": "0x31958e219073d60FDCeb1d608c293754331dd352"
547-
},
548-
{
549-
"name": "controllerAddress",
550-
"value": "0x542919Faf1Ed3716fCF31c47dF98D6208EA50569"
551-
}
552-
],
553-
"creationCodeHash": "0xd912c1d3be60f8d4d3fb29cd203c926639a6b8546612953a33cf6810989cee59",
554-
"runtimeCodeHash": "0xdd3f9efcf92f1cf52471d8f4442649ce8a8315a3a4a554a49221f0dae16fca45",
555-
"txHash": "0x76641360856c3097b62773e942d194b0d3880f2cb56e192e141d8b03dbafac6d"
556-
},
557-
"AttestationApp": {
558-
"address": "0x02cbecbEE7Ad3f74d95b50755C26a16534F53C1A",
559-
"creationCodeHash": "0x9c31294194a6e9768a6da9af195b293dbc589e98ef88ebfd81156487e61d87f3",
560-
"runtimeCodeHash": "0xb0e364454528b8dcf5876bdb1ac15e6efb46d97d10583b4746bcf54cee3783a0",
561-
"txHash": "0x5f58737c9a39e766142148cae55d49abf9bcd04427e9f450183e841f74136ac4"
562524
}
563525
}
564526
}

cli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ Under the `commands/` there is one file per general command and a folder called
4747
- `deploy.ts` - helper to deploy a single contract.
4848
- `migrate.ts` - helper to migrate all contracts for a new network on chain.
4949
- `protocol.ts` - list, set or get any protocol parameter on any contract.
50-
- `transferTeamTokens.ts` - mint tokens for the whole team for testing purposes.
50+
- `airdrop.ts` - distribute tokens to multiple addresses.
5151
- `verify.ts` - verify a contract is on chain.
5252
- `upgrade.ts` - helper to upgrade a proxy to use a new implementation.

cli/cli.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ import yargs from 'yargs'
55
import { deployCommand } from './commands/deploy'
66
import { migrateCommand } from './commands/migrate'
77
import { proxyCommand } from './commands/proxy'
8-
import { verifyCommand } from './commands/verify'
98
import { protocolCommand } from './commands/protocol'
109
import { contractsCommand } from './commands/contracts'
11-
import { transferTeamTokensCommand } from './commands/transferTeamTokens'
1210
import { simulationCommand } from './commands/simulations'
1311
import { airdropCommand } from './commands/airdrop'
1412

@@ -25,10 +23,8 @@ yargs
2523
.command(deployCommand)
2624
.command(migrateCommand)
2725
.command(proxyCommand)
28-
.command(verifyCommand)
2926
.command(protocolCommand)
3027
.command(contractsCommand)
31-
.command(transferTeamTokensCommand)
3228
.command(simulationCommand)
3329
.command(airdropCommand)
3430
.demandCommand(1, 'Choose a command from the above list')

cli/commands/airdrop.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ import { parseGRT, formatGRT } from '@graphprotocol/common-ts'
88
import { utils, BigNumber, Contract } from 'ethers'
99
import { NonceManager } from '@ethersproject/experimental'
1010

11+
import { logger } from '../logging'
1112
import { sendTransaction } from '../network'
1213
import { loadEnv, CLIArgs, CLIEnvironment } from '../env'
1314

14-
const logger = consola.create({})
15-
1615
const { getAddress } = utils
1716

1817
const DISPERSE_CONTRACT_ADDRESS = {
@@ -76,7 +75,7 @@ const sure = async (message = 'Are you sure?'): Promise<boolean> => {
7675
message,
7776
})
7877
if (!res.confirm) {
79-
consola.success('Cancelled')
78+
logger.success('Cancelled')
8079
return false
8180
}
8281
return true

cli/commands/contracts/any.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import consola from 'consola'
21
import yargs, { Argv } from 'yargs'
32
import { ContractFunction } from 'ethers'
43

4+
import { logger } from '../../logging'
55
import { getContractAt, sendTransaction } from '../../network'
66
import { loadEnv, CLIArgs, CLIEnvironment } from '../../env'
77

8-
const logger = consola.create({})
9-
108
export const any = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise<void> => {
119
const contract = cliArgs.contract
1210
const func = cliArgs.func

cli/commands/contracts/curation.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import consola from 'consola'
21
import yargs, { Argv } from 'yargs'
32
import { parseGRT } from '@graphprotocol/common-ts'
43

4+
import { logger } from '../../logging'
55
import { sendTransaction } from '../../network'
66
import { loadEnv, CLIArgs, CLIEnvironment } from '../../env'
77

8-
const logger = consola.create({})
9-
108
export const mint = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise<void> => {
119
const subgraphID = cliArgs.subgraphID
1210
const amount = parseGRT(cliArgs.amount)

cli/commands/contracts/disputeManager.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import consola from 'consola'
21
import yargs, { Argv } from 'yargs'
32
import { constants, utils, Wallet } from 'ethers'
43
import { createAttestation, Attestation, Receipt } from '@graphprotocol/common-ts'
54

5+
import { logger } from '../../logging'
66
import { sendTransaction, getChainID, getProvider, toGRT, randomHexBytes } from '../../network'
77
import { loadEnv, CLIArgs, CLIEnvironment } from '../../env'
88

@@ -15,8 +15,6 @@ interface ChannelKey {
1515
address: string
1616
}
1717

18-
const logger = consola.create({})
19-
2018
async function buildAttestation(receipt: Receipt, signer: string, disputeManagerAddress: string) {
2119
const attestation = await createAttestation(signer, getChainID(), disputeManagerAddress, receipt)
2220
return attestation

cli/commands/contracts/ens.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import consola from 'consola'
21
import yargs, { Argv } from 'yargs'
32
import { utils } from 'ethers'
43

54
import { sendTransaction } from '../../network'
65
import { loadEnv, CLIArgs, CLIEnvironment } from '../../env'
6+
import { logger } from '../../logging'
77

8-
const logger = consola.create({})
98
export const registerTestName = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise<void> => {
109
const name = cliArgs.name
1110
const testRegistrar = cli.contracts.ITestRegistrar

0 commit comments

Comments
 (0)