diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/client.rs | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/lib/client.rs b/src/lib/client.rs index d8c5f6d..70616fc 100644 --- a/src/lib/client.rs +++ b/src/lib/client.rs | |||
| @@ -665,21 +665,24 @@ pub async fn sign_event( | |||
| 665 | event_builder: EventBuilder, | 665 | event_builder: EventBuilder, |
| 666 | signer: &Arc<dyn NostrSigner>, | 666 | signer: &Arc<dyn NostrSigner>, |
| 667 | ) -> Result<nostr::Event> { | 667 | ) -> Result<nostr::Event> { |
| 668 | // if signer.type_id().().eq(&nostr_signer::NostrSignerType::NIP46) { | 668 | // TODO: Yuki suggested he would add a backend option to NostrSigner so we can |
| 669 | let term = console::Term::stderr(); | 669 | // identify nip46 signers again and replace the below if statement with: |
| 670 | term.write_line("signing event with remote signer...")?; | 670 | // if signer.backend() == nip46 { |
| 671 | let event = signer | 671 | if std::env::var("NGITTEST").is_err() { |
| 672 | .sign_event(event_builder.build(signer.get_public_key().await?)) | 672 | let term = console::Term::stderr(); |
| 673 | .await | 673 | term.write_line("signing event with remote signer...")?; |
| 674 | .context("failed to sign event")?; | 674 | let event = signer |
| 675 | term.clear_last_lines(1)?; | 675 | .sign_event(event_builder.build(signer.get_public_key().await?)) |
| 676 | Ok(event) | 676 | .await |
| 677 | // } else { | 677 | .context("failed to sign event")?; |
| 678 | // signer | 678 | term.clear_last_lines(1)?; |
| 679 | // .sign_event(event_builder.build(signer.get_public_key().await?)) | 679 | Ok(event) |
| 680 | // .await | 680 | } else { |
| 681 | // .context("failed to sign event") | 681 | signer |
| 682 | // } | 682 | .sign_event(event_builder.build(signer.get_public_key().await?)) |
| 683 | .await | ||
| 684 | .context("failed to sign event") | ||
| 685 | } | ||
| 683 | } | 686 | } |
| 684 | 687 | ||
| 685 | pub async fn fetch_public_key(signer: &Arc<dyn NostrSigner>) -> Result<nostr::PublicKey> { | 688 | pub async fn fetch_public_key(signer: &Arc<dyn NostrSigner>) -> Result<nostr::PublicKey> { |