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

Feat/sign with lab #25

Closed
wants to merge 19 commits into from
Closed

Conversation

elizabethengelman
Copy link

What

[TODO: Short statement about what is changing.]

Why

[TODO: Why this change is being made. Include any context required to understand the why.]

Known limitations

[TODO or N/A]


let txn_sign_url = url.to_string();

println!("Opening lab to sign transaction: {}", &txn_sign_url);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have --yes flag that we can use here.
I think we should add a prompt like "Lab link would be opened in the browser, do you want to continue? [Y/n]"
And if --yes passed, this prompt should be skipped

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me!

I'm having trouble implementing it, and could use another set of eyes. The issue is that when I am piping my tx xdr into the cli, the program seems to lose track of the stdin reader when it gets to trying to read the user's y response.

I.e. when I pass in this command:

echo AAAAAgAAAADcOHnq5sGLOngOCEMyLqqn5CvFV2HGbOSjJAIzhqBdkAAAAGQAEb7UAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAYAAAAAQAAAAAAAAAAAAAAANw4eermwYs6eA4IQzIuqqfkK8VXYcZs5KMkAjOGoF2Q04SY/PMseMCgfbEFkX5gTr9qD/d0mvD9H3acFOz/X5oAAAAALtGgcgsAibk5q8VOLY2R1G1NdGX7fLzlz7iBFBy64JIAAAAAAAAAAAAAAAA= \
| cargo run tx sign --network testnet --sign-with-lab

I see this issue:

thread 'main' panicked at cmd/soroban-cli/src/config/sign_with.rs:150:41:
called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "Failed to initialize input reader" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It opens lab as expected with --yes.

)]
pub sign_with_lab: bool,
pub lab_url: String,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it also be conflicts_with = "sign_with_key"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call! I'll push up a change shortly

@elizabethengelman elizabethengelman changed the base branch from feat/sign_and_send to feat/tx_sign September 11, 2024 19:58
@elizabethengelman
Copy link
Author

closing this in favor of stellar#1604

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.

3 participants