-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial support for gov v3 (#54)
Co-authored-by: kartojal <david@web3ops.co> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Release bot :robot <gitbot@bgdlabs.com>
- Loading branch information
1 parent
9a4b6c5
commit a2d7fd2
Showing
67 changed files
with
2,830 additions
and
5,122 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
dist | ||
node_modules | ||
yarn-error.log | ||
|
||
# proposal cache | ||
cache |
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 @@ | ||
20.6.1 |
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,15 +1,32 @@ | ||
#!/usr/bin/env node | ||
import 'dotenv/config'; | ||
import yargs from 'yargs/yargs'; | ||
import { hideBin } from 'yargs/helpers'; | ||
import * as ipfsCmd from './commands/ipfs-upload'; | ||
import * as diffSnapshot from './commands/diff-snaphots'; | ||
import * as simulateProposal from './commands/simulate-proposal'; | ||
import * as fork from './commands/fork'; | ||
import { Command, Option } from '@commander-js/extra-typings'; | ||
import { addCommand as addIpfsCommand } from './commands/ipfsUpload'; | ||
import { addCommand as addDiffSnapshots } from './commands/diffSnaphots'; | ||
import { addCommand as addGovernance } from './commands/governance'; | ||
import { addCommand as addFork } from './commands/fork'; | ||
import packageJson from '../package.json'; | ||
|
||
yargs(hideBin(process.argv)) | ||
.command(ipfsCmd) | ||
.command(diffSnapshot) | ||
.command(simulateProposal) | ||
.command(fork) | ||
.demandCommand().argv; | ||
const program = new Command(); | ||
|
||
program | ||
.name('aave-cli') | ||
.description('CLI to interact with the aave ecosystem') | ||
.option('-v, --verbose', 'Showing logs for all the taken steps') | ||
.on('option:verbose', function () { | ||
process.env.VERBOSE = 'true'; | ||
}) | ||
.addOption( | ||
new Option('--format <format>', 'Set preferred output format').default('raw').choices(['raw', 'encoded'] as const) | ||
) | ||
.on('option:format', function (format) { | ||
process.env.FORMAT = format; | ||
}) | ||
.version(packageJson.version) | ||
.showHelpAfterError(); | ||
addGovernance(program); | ||
addDiffSnapshots(program); | ||
addFork(program); | ||
addIpfsCommand(program); | ||
|
||
program.parse(); |
This file was deleted.
Oops, something went wrong.
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 { Command } from '@commander-js/extra-typings'; | ||
import { diffReports } from '../reports/diff-reports'; | ||
import { readJsonString, readJsonFile } from '../utils/json'; | ||
import fs from 'fs'; | ||
|
||
export function addCommand(program: Command) { | ||
program | ||
.command('diff-snapshots') | ||
.description('generate a snapshot diff report') | ||
.argument('<from>') | ||
.argument('<to>') | ||
.option('-o, --out <string>', 'output path') | ||
.option('--stringMode', 'expects input to be a string, not paths') | ||
.action(async (_from, _to, options) => { | ||
const from = options.stringMode ? readJsonString(_from) : readJsonFile(_from); | ||
const to = options.stringMode ? readJsonString(_to) : readJsonFile(_to); | ||
const content = await diffReports(from, to); | ||
if (options.out) { | ||
fs.writeFileSync(options.out, content); | ||
} else { | ||
console.log(content); | ||
} | ||
}); | ||
} |
Oops, something went wrong.