blocks: pass keypair instead of privkey to avoid pubkey gen

Generating a pubkey is quite slow, so pass a keypair instead of privkey
This commit is contained in:
William Casarin
2023-08-28 11:46:03 -07:00
parent 8e92e28faf
commit c71b0ee916
24 changed files with 108 additions and 107 deletions

View File

@@ -39,7 +39,7 @@ struct EventShell<Content: View>: View {
return nil
}
return first_eref_mention(ev: event, privkey: state.keypair.privkey)
return first_eref_mention(ev: event, keypair: state.keypair)
}
func Mention(_ mention: Mention<NoteId>) -> some View {
@@ -71,7 +71,7 @@ struct EventShell<Content: View>: View {
UserStatusView(status: state.profiles.profile_data(pubkey).status, show_general: state.settings.show_general_statuses, show_music: state.settings.show_music_statuses)
if !options.contains(.no_replying_to) {
ReplyPart(events: state.events, event: event, privkey: state.keypair.privkey, profiles: state.profiles)
ReplyPart(events: state.events, event: event, keypair: state.keypair, profiles: state.profiles)
}
content
@@ -98,7 +98,7 @@ struct EventShell<Content: View>: View {
VStack(alignment: .leading, spacing: 2) {
EventTop(state: state, event: event, pubkey: pubkey, is_anon: is_anon)
UserStatusView(status: state.profiles.profile_data(pubkey).status, show_general: state.settings.show_general_statuses, show_music: state.settings.show_music_statuses)
ReplyPart(events: state.events, event: event, privkey: state.keypair.privkey, profiles: state.profiles)
ReplyPart(events: state.events, event: event, keypair: state.keypair, profiles: state.profiles)
}
}
.padding(.horizontal)