Skip to content
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

Introduce build_deploy_transaction function on Contract #1306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mpoplavkov
Copy link
Contributor

close #1305

This PR doesn't exactly solve the issue, but adds a possibility to get the tx id from the built transaction. I didn't want to change the deploy method signature, cause it'll trigger changes in the whole project.

So, the proposed solution to get the tx id is:

let tx = contract.build_deploy_transaction(account, tx_policies).await?;
let tx_id = tx.id(provider.chain_id());
contract.deploy(account, tx_policies).await?;
println!("Deployed contract at tx: {}", tx_id.to_string());

However, I'm not sure if that's correct, cause in that flow the deploy transaction will be built twice (by calling build_deploy_transaction and then deploy), so potentially these two transactions might differ. Let me know what you think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return tx id when deploying a contract
1 participant