-
Notifications
You must be signed in to change notification settings - Fork 239
Allow declaring with deployment #3783
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
base: spr/master/94945a36
Are you sure you want to change the base?
Conversation
ac92c0d
to
48c85d9
Compare
899b363
to
a9c96f6
Compare
48c85d9
to
859e21b
Compare
a9c96f6
to
41b8753
Compare
41b8753
to
39b967c
Compare
28cef8c
to
b764071
Compare
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.
Wdyt about mentioning this in sncast 101?
b764071
to
96a6140
Compare
39b967c
to
0b18bd5
Compare
96a6140
to
24199f7
Compare
0b18bd5
to
04e89a1
Compare
commit-id:82e786a7 # Conflicts: # crates/sncast/src/main.rs
04e89a1
to
5ea3fa5
Compare
24199f7
to
aaa6e8d
Compare
To see deployment details, visit: | ||
contract: [..] | ||
class: [..] | ||
declare transaction: [..] | ||
deploy transaction: [..] |
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.
Maybe I'm a bit too picky, but after deployment details we have link to declare transaction. Maybe it can be moved above/separated?
Deploy(StandardDeployResponse), | ||
DeployWithDeclare(DeployResponseWithDeclare), |
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.
nit:
Deploy(StandardDeployResponse), | |
DeployWithDeclare(DeployResponseWithDeclare), | |
Standard(StandardDeployResponse), | |
WithDeclare(DeployResponseWithDeclare), |
} | ||
} | ||
} else { | ||
unreachable!("One of class_hash or contract_name must be provided"); |
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.
nit:
unreachable!("One of class_hash or contract_name must be provided"); | |
unreachable!("One of `--class-hash` or `--contract-name` must be provided"); |
#[derive(Args, Debug, Clone)] | ||
#[group(required = true, multiple = false)] | ||
pub struct ContractIdentifier { | ||
/// Class hash of contract to deploy | ||
#[arg(short = 'g', long)] | ||
pub class_hash: Option<Felt>, | ||
|
||
/// Contract name | ||
#[arg(long, conflicts_with = "class_hash")] | ||
pub contract_name: Option<String>, | ||
} | ||
|
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.
nit: Usage of id
and group
seems suitable here:
#[derive(Args, Debug, Clone)] | |
#[group(required = true, multiple = false)] | |
pub struct ContractIdentifier { | |
/// Class hash of contract to deploy | |
#[arg(short = 'g', long)] | |
pub class_hash: Option<Felt>, | |
/// Contract name | |
#[arg(long, conflicts_with = "class_hash")] | |
pub contract_name: Option<String>, | |
} | |
#[derive(Args, Debug, Clone)] | |
#[group(id = "contract_identifier", required = true, multiple = false)] | |
pub struct ContractIdentifier { | |
/// Class hash of contract to deploy | |
#[arg(short = 'g', long, group = "contract_identifier")] | |
pub class_hash: Option<Felt>, | |
/// Contract name | |
#[arg(long, group = "contract_identifier")] | |
pub contract_name: Option<String>, | |
} | |
(class_hash, None) | ||
} else if let Some(contract_name) = identifier.contract_name { | ||
let manifest_path = assert_manifest_path_exists()?; | ||
let package_metadata = get_package_metadata(&manifest_path, &None)?; |
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.
Does this feature work for workspaces?
WaitForTx { | ||
wait: true, | ||
wait_params: wait_config.wait_params, | ||
show_ui_outputs: true, |
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.
What if someone passes the --wait
flag?
} | ||
|
||
#[tokio::test] | ||
async fn test_deploy_with_declare_nonexistent_contract() { |
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.
What's the rationale behind this test given that its name refers to nonexistent_contract
, but the asserted error is Invalid transaction nonce
?
> The contract might wait for a few seconds before executing the deployment. | ||
> 📝 **Note** | ||
> If fee arguments are provided to the method, they will be shared between declare and deploy transactions. |
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.
It might suggest that the provided fee will will try to cover both transactions, which is not the case. I think it should be rephrased to clarify that the same fee arguments are used separately for each transaction
Stack:
wait_for_tx
#3782