Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Non-upgradeable deploys, round 2 #1376

Merged
merged 87 commits into from
Jan 21, 2020
Merged
Changes from 1 commit
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
40e12b4
add deploy command file
frangio Dec 10, 2019
e377eb5
refactor repeated handling of session expiration
frangio Dec 11, 2019
85574a2
remove redundant condition
frangio Dec 11, 2019
2522298
add idea for telemetry and interactivity
frangio Dec 12, 2019
1dc3143
wip
frangio Dec 13, 2019
9ee931c
wip
frangio Dec 17, 2019
bff4d35
add mostly functional oz deploy command
frangio Dec 19, 2019
6d4262c
add types to configmanager
frangio Dec 23, 2019
8b53d1d
add ProjectFile.translateMaybeAlias
frangio Dec 23, 2019
9f1fdad
finalize behavior of deploy
frangio Dec 23, 2019
c42731b
add basic test
frangio Dec 27, 2019
b02117b
add deploy test with constructor arguments
frangio Dec 27, 2019
cfb6afb
test that deploy produces correct "ProxyType" in network file
frangio Dec 27, 2019
9cb3268
rename ProxyType.Regular to ProxyType.NonProxy
frangio Dec 27, 2019
8b1a717
add proper error message for deploy when a contract is not found
frangio Dec 27, 2019
cd15858
add validation of argument count. refactor inputs to avoid repeating
frangio Dec 27, 2019
cc69e7a
add deploy test with multiple instances
frangio Dec 27, 2019
4477c8f
tweak test wording for consistency
frangio Dec 27, 2019
5010695
add pending test that is failing and more test ideas
frangio Dec 27, 2019
aa98fc6
fix deploy when the contract has undeployed libraries
frangio Jan 2, 2020
09ea739
fix deploy for contracts from dependencies
frangio Jan 2, 2020
46951bf
fix method prompt for non-upgradeable instances (call, send-tx)
frangio Jan 2, 2020
2f25d5c
throw ContractNotFound when contract not found in dependency
frangio Jan 2, 2020
f5fa029
tweak error message when no upgradeable instances are found
frangio Jan 2, 2020
ff2b0c0
refactor deploy action avoiding higher order functions
frangio Jan 3, 2020
9c99e27
remove unused import
frangio Jan 4, 2020
cfe5e70
add rough draft of interactivity for deploy command
frangio Jan 4, 2020
2266a33
refactor most of contractsList out to choices.contracts
frangio Jan 6, 2020
e780d68
add index argument to argLabel
frangio Jan 6, 2020
32734ce
fix error in deploy preAction
frangio Jan 6, 2020
b616155
finish implementation of interactivity for deploy
frangio Jan 6, 2020
9c9cb5e
add updated yarn.lock
frangio Jan 6, 2020
be1a82d
add todo note on the contracts choices list
frangio Jan 6, 2020
bbee334
enable switching to create mode with upgradeable flag
frangio Jan 7, 2020
a8383d1
remove unused interface members
frangio Jan 7, 2020
7559621
create module for registering command under new architecture
frangio Jan 7, 2020
27f6288
rename deploy/command.ts to deploy/spec.ts
frangio Jan 7, 2020
8d70d0a
update yarn.lock
frangio Jan 7, 2020
65b80b7
use let variables for proper typing in tests
frangio Jan 7, 2020
5c0a693
Revert "refactor repeated handling of session expiration"
frangio Jan 7, 2020
1d2a401
add comments that document register-command.ts
frangio Jan 7, 2020
a851d4c
remove index argument from argLabel and add alternative function
frangio Jan 7, 2020
2345192
add --no-manifest-migration option
frangio Jan 13, 2020
daa827a
make network initialization conditional on NODE_ENV
frangio Jan 14, 2020
f957140
add --from option
frangio Jan 14, 2020
95c06fa
add --timeout option
frangio Jan 14, 2020
9822457
fix type error and remove unnecessary return type
frangio Jan 14, 2020
070a844
add network preselection
frangio Jan 14, 2020
5d77188
move network name normalization to Telemetry.report
frangio Jan 14, 2020
d40b08a
refactor and add comment regarding uninitialized project
frangio Jan 14, 2020
3d818ce
simplify object creation
frangio Jan 14, 2020
02154c3
refactor and add comments to choices module
frangio Jan 14, 2020
885258e
remove unnecessary use of exception
frangio Jan 14, 2020
04290b4
reuse deployed libraries
frangio Jan 14, 2020
1592753
change action calling convention to receive single params object
frangio Jan 15, 2020
802652c
make validate optional and add default validation for choices
frangio Jan 15, 2020
41d0def
rename Question -> ParamDetails, prompt -> details, message -> prompt…
frangio Jan 15, 2020
cf3c699
remove unnecessary duplicate processing
frangio Jan 15, 2020
dc2bb47
change validation+validationError api to single validationError fn
frangio Jan 16, 2020
6b451c9
fix --migrate-manifest option
frangio Jan 16, 2020
c091769
simplify how we obtain commander option values
frangio Jan 16, 2020
b6dcac6
remove use of require to read a json file, it confuses the ts compiler
frangio Jan 16, 2020
9479883
disable interactivity according to flag or env variable
frangio Jan 16, 2020
6865df7
introduce helper getConstructorInputs to separate concerns
frangio Jan 17, 2020
c4b38f2
refactor promptForMissing
frangio Jan 17, 2020
9c6c0a5
rename translateMaybeAlias -> normalizeContractAlias, and add documen…
frangio Jan 17, 2020
f1d7adf
store bytecode hash for regular deploys
frangio Jan 17, 2020
f0db127
replace --upgradeable with --kind and ensure a good interactive flow
frangio Jan 17, 2020
d5a37ec
allow specifying details without a prompt
frangio Jan 17, 2020
766aca5
add minimal deploy kind
frangio Jan 17, 2020
2c1a269
reword test names without should
frangio Jan 17, 2020
b83260c
skip compile when deploy forwards to create
frangio Jan 17, 2020
f9d1c30
fix telemetry test
frangio Jan 17, 2020
004f225
fix use of kind parameter
frangio Jan 17, 2020
b16a7d0
set default network if there is an open session
frangio Jan 17, 2020
d61e39a
Merge branch 'master' of github.com:OpenZeppelin/openzeppelin-sdk int…
frangio Jan 17, 2020
6fbaa12
disallow variadic in positional arguments other than the last one
frangio Jan 17, 2020
4f6f808
remove todos after opening them as issues
frangio Jan 17, 2020
67bf0d2
use fs-extra readJson
frangio Jan 17, 2020
59e9062
remove let in favor of ternary operator
frangio Jan 17, 2020
82cf02e
move types to top of file
frangio Jan 17, 2020
a916115
remove unnecessarily complex type
frangio Jan 20, 2020
c2550fa
get canonical network name in firebase subprocess
frangio Jan 20, 2020
a067946
Merge branch 'master' of github.com:OpenZeppelin/openzeppelin-sdk int…
frangio Jan 20, 2020
32fbb6e
fix getting canonical network name for telemetry
frangio Jan 21, 2020
1fe9c7f
fix error from merge
frangio Jan 21, 2020
aa90a24
remove fs.readJson, it wasn't working, was impossible to debug it
frangio Jan 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/cli/src/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default {
const commandData: Concealed<CommandData> = { ...concealedData, name: commandName };
if (network !== undefined) commandData.network = network;

const userEnvironment = getUserEnvironment();
const userEnvironment = await getUserEnvironment();
this.sendToFirebase(telemetryOptions.uuid, commandData, userEnvironment);
},

Expand Down Expand Up @@ -111,18 +111,22 @@ async function checkOptIn(interactive: boolean): Promise<GlobalTelemetryOptions
return globalOptions;
}

function getUserEnvironment(): UserEnvironment {
async function getUserEnvironment(): Promise<UserEnvironment> {
return {
platform: process.platform,
arch: process.arch,
nodeVersion: process.version,
cliVersion: require('../../package.json').version,
cliVersion: await getCLIVersion(),
upgradesVersion: getDependencyVersion('@openzeppelin/upgrades'),
truffleVersion: getDependencyVersion('truffle'),
web3Version: getDependencyVersion('web3'),
};
}

async function getCLIVersion(): Promise<string> {
return JSON.parse(await fs.readFile(__dirname + '/../../package.json', 'utf8')).version;
frangio marked this conversation as resolved.
Show resolved Hide resolved
}

function getDependencyVersion(dep: string): string | undefined {
try {
return require(`${dep}/package.json`).version;
Expand Down