From b63bfc9a34657c5767c507deb7c059e24dd22779 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 25 Jun 2024 09:06:47 +0100 Subject: refactor: replace keys with signer so that nip46 bunker signing can be added --- src/sub_commands/push.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/sub_commands/push.rs') diff --git a/src/sub_commands/push.rs b/src/sub_commands/push.rs index ade2ff8..92c1c18 100644 --- a/src/sub_commands/push.rs +++ b/src/sub_commands/push.rs @@ -148,7 +148,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { ahead.len() ); - let (keys, user_ref) = login::launch( + let (signer, user_ref) = login::launch( &git_repo, &cli_args.nsec, &cli_args.password, @@ -157,8 +157,6 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { ) .await?; - client.set_keys(&keys).await; - let mut patch_events: Vec = vec![]; for commit in &ahead { patch_events.push( @@ -167,7 +165,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { &root_commit, commit, Some(proposal_root_event.id), - &keys, + &signer, &repo_ref, patch_events.last().map(nostr::Event::id), None, @@ -175,11 +173,14 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { &None, &[], ) + .await .context("cannot make patch event from commit")?, ); } println!("pushing {} commits", ahead.len()); + client.set_signer(signer).await; + send_events( &client, patch_events, -- cgit v1.2.3