diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-06-25 09:06:47 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-06-25 09:06:47 +0100 |
| commit | b63bfc9a34657c5767c507deb7c059e24dd22779 (patch) | |
| tree | 462be1e29e6f21c5e0d75458e4966f574389451c /src/sub_commands/push.rs | |
| parent | 20d201740f0ace8437cf595476a52f9e42407724 (diff) | |
refactor: replace keys with signer
so that nip46 bunker signing can be added
Diffstat (limited to 'src/sub_commands/push.rs')
| -rw-r--r-- | src/sub_commands/push.rs | 9 |
1 files changed, 5 insertions, 4 deletions
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<()> { | |||
| 148 | ahead.len() | 148 | ahead.len() |
| 149 | ); | 149 | ); |
| 150 | 150 | ||
| 151 | let (keys, user_ref) = login::launch( | 151 | let (signer, user_ref) = login::launch( |
| 152 | &git_repo, | 152 | &git_repo, |
| 153 | &cli_args.nsec, | 153 | &cli_args.nsec, |
| 154 | &cli_args.password, | 154 | &cli_args.password, |
| @@ -157,8 +157,6 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 157 | ) | 157 | ) |
| 158 | .await?; | 158 | .await?; |
| 159 | 159 | ||
| 160 | client.set_keys(&keys).await; | ||
| 161 | |||
| 162 | let mut patch_events: Vec<nostr::Event> = vec![]; | 160 | let mut patch_events: Vec<nostr::Event> = vec![]; |
| 163 | for commit in &ahead { | 161 | for commit in &ahead { |
| 164 | patch_events.push( | 162 | patch_events.push( |
| @@ -167,7 +165,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 167 | &root_commit, | 165 | &root_commit, |
| 168 | commit, | 166 | commit, |
| 169 | Some(proposal_root_event.id), | 167 | Some(proposal_root_event.id), |
| 170 | &keys, | 168 | &signer, |
| 171 | &repo_ref, | 169 | &repo_ref, |
| 172 | patch_events.last().map(nostr::Event::id), | 170 | patch_events.last().map(nostr::Event::id), |
| 173 | None, | 171 | None, |
| @@ -175,11 +173,14 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 175 | &None, | 173 | &None, |
| 176 | &[], | 174 | &[], |
| 177 | ) | 175 | ) |
| 176 | .await | ||
| 178 | .context("cannot make patch event from commit")?, | 177 | .context("cannot make patch event from commit")?, |
| 179 | ); | 178 | ); |
| 180 | } | 179 | } |
| 181 | println!("pushing {} commits", ahead.len()); | 180 | println!("pushing {} commits", ahead.len()); |
| 182 | 181 | ||
| 182 | client.set_signer(signer).await; | ||
| 183 | |||
| 183 | send_events( | 184 | send_events( |
| 184 | &client, | 185 | &client, |
| 185 | patch_events, | 186 | patch_events, |