-
Notifications
You must be signed in to change notification settings - Fork 185
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
Introduced by-name deployment and declare-deploy
command
#2331
base: master
Are you sure you want to change the base?
Conversation
crates/sncast/src/main.rs
Outdated
let deploy: DeployResolved = if deploy.class_hash.is_some() { | ||
deploy.try_into().unwrap() | ||
} else { | ||
let contract = | ||
deploy.build_artifacts_and_get_compiled_contract(cli.json, &cli.profile)?; | ||
let class_hash = contract.sierra_class_hash; | ||
|
||
if !contract.is_declared(&provider).await? { | ||
bail!("Contract with class hash {:x} is not declared", class_hash); | ||
} | ||
|
||
deploy.resolved_with_class_hash(class_hash) | ||
}; | ||
|
||
deploy.validate()?; | ||
|
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.
So now we will explicitly fail if user tries to deploy contract that wasn't declared? What was the previous behavior. This might be worth including in a changelog if this behavior changed.
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.
No, the behavior remains the same, e.g. running
sncast -a my_account deploy --class-hash 0x123 --fee-token strk --url http://127.0.0.1:5050
will produce
Error: An error occurred in the called contract = ContractErrorData { revert_error: "Class with hash 0x123 is not declared" }
which is same as current behavior.
61e8f2a
to
b11b1bc
Compare
… into integraledelebesgue/feature-2279
… into integraledelebesgue/feature-2279
Closes #2279
Introduced changes
sncast deploy
now allows to deploy a contract by its name instead of class hash;--contract-name
and--class-hash
arguments are mutually exclusivedeclare-deploy
, used to quickly combine declaration with deploymentdeclare
,declare-deploy
- alwaysdeploy
- when depolying by nameChecklist
CHANGELOG.md