-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cli): allow to use ipfs:// on all commands (that make sense) #1594
Conversation
|
@@ -549,7 +547,6 @@ export const commandsConfig: CommandsConfig = { | |||
{ | |||
flags: '-c --chain-id <chainId>', | |||
description: 'Chain ID of the variant to inspect', | |||
defaultValue: '13370', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On inspect command, is better to ask the user for a chainId
@@ -16,8 +16,6 @@ export const applyCommandsConfig = (command: Command, config: CommandConfig) => | |||
config.arguments.map((argument: any) => { | |||
if (argument.flags === '<packageRefs...>') { | |||
command.argument(argument.flags, argument.description, parsePackagesArguments, argument.defaultValue); | |||
} else if (command.name() === 'interact' && argument.flags === '<packageRef>') { | |||
command.argument(argument.flags, argument.description, parsePackageArguments, argument.defaultValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small refactor, as the parsePackageArguments
is intended for parsing settings, but in interact
we don't need to parse settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleting this test as it is really testing almost nothing. And also we have a proper e2e test that already covers this case.
@@ -1,8 +1,6 @@ | |||
{ | |||
"publishIpfsUrl": "https://us-east.repo.usecannon.com", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new repo should work better!
"rpcUrl": "http://127.0.0.1:9545", | ||
"privateKey": "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", | ||
"registryRpcUrl": "http://127.0.0.1:9545", | ||
"etherscanApiUrl": "https://api.etherscan.io/api", | ||
"etherscanApiKey": "A7PNIZCEI2HDRUTDJBWS36XBGIB7Q74YMK" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing pasted key 👮♂️
e79b81a
to
abd4205
Compare
Merging as I got in-chat approval both from @saeta-eth and @dbeal-eth |
This PR makes the
getPackageInfo
fn to try and parse the given package reference, or, if an ipfsHash/Url is given, it will try to download it and get the fullPackageReference. Also, the chainId it will be taken by the users param--chain-id
, the package content, the given--rpc-url
provider, or lastly it will prompt the user to add it.This functionality was added to the following commands:
verify
diff
publish
unpublish
inspect
trace
(now we can trace from ipfs hash also 🙌)decode
interact
There's a special case for the following commands that a correct
packageReference
is required, and not an ipfs ref. This is now being correctly parsed and if needed the user is prompted for a chainIdfetch
Another special case is on the contrary, when only an
ipfsUrl
is allowed, but now we are improving the validation:pin
Extras
packages/cli/.env.test
file to be able to configure env vars for e2e tests