Skip to content

Feat/sign with lab - #25

Closed
elizabethengelman wants to merge 19 commits into
feat/tx_signfrom
feat/sign_with_lab
Closed

Feat/sign with lab#25
elizabethengelman wants to merge 19 commits into
feat/tx_signfrom
feat/sign_with_lab

Conversation

@elizabethengelman

Copy link
Copy Markdown
Member

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
Copy Markdown

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
Copy Markdown
Member 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.

default_value = "https://lab.stellar.org/transaction/cli-sign"
)]
pub sign_with_lab: bool,
pub lab_url: String,

Copy link
Copy Markdown

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
Copy Markdown
Member 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
Copy Markdown
Member 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