mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-29 08:52:25 +00:00
Fix CI failures in NostrClient and SignerManager
- Export `resolveSignerCapabilities` from `SignerManager` and import in `NostrClient` to fix ReferenceError in `sendDirectMessage`. - Initialize `RelayBatchFetcher` in `NostrClient` constructor to fix TypeError in `fetchListIncrementally`. - Implement `registerPrivateKeySigner` in `NostrClient` to fix TypeError in signer tests. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
89b7fca560
commit
e25d79b2a2
2 files changed
+11
-2
No files matched your search
+10
-1
@@ -214,7 +214,8 @@ import { queueSignEvent } from "./signRequestQueue.js";
|
||||
import { EventsMap } from "./eventsMap.js";
|
||||
import { PersistenceManager } from "./managers/PersistenceManager.js";
|
||||
import { ConnectionManager } from "./managers/ConnectionManager.js";
|
||||
import { SignerManager } from "./managers/SignerManager.js";
|
||||
import { SignerManager, resolveSignerCapabilities } from "./managers/SignerManager.js";
|
||||
import { RelayBatchFetcher } from "./relayBatchFetcher.js";
|
||||
|
||||
function normalizeProfileFromEvent(event) {
|
||||
if (!event || !event.content) return null;
|
||||
@@ -580,6 +581,7 @@ export class NostrClient {
|
||||
constructor() {
|
||||
this.connectionManager = new ConnectionManager(this);
|
||||
this.signerManager = new SignerManager(this);
|
||||
this.relayBatchFetcher = new RelayBatchFetcher(this);
|
||||
|
||||
/**
|
||||
* @type {Map<string, object>}
|
||||
@@ -2907,6 +2909,13 @@ export class NostrClient {
|
||||
* @returns {Promise<import("nostr-tools").Event>} The signed and published edit event.
|
||||
* @throws {Error} If permission denied, ownership mismatch, or publish failure.
|
||||
*/
|
||||
registerPrivateKeySigner({ privateKey, pubkey }) {
|
||||
const adapter = createNsecAdapter(privateKey, pubkey);
|
||||
this.signerManager.setActiveSigner(adapter);
|
||||
// Also set session actor for worker-based encryption
|
||||
this.sessionActor = { privateKey, pubkey, source: "nsec" };
|
||||
}
|
||||
|
||||
async ensureActiveSignerForPubkey(pubkey) {
|
||||
return this.signerManager.ensureActiveSignerForPubkey(pubkey);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ import { queueSignEvent } from "../signRequestQueue.js";
|
||||
import { signEventWithPrivateKey } from "../publishHelpers.js";
|
||||
import { ensureNostrTools, getCachedNostrTools } from "../toolkit.js";
|
||||
|
||||
function resolveSignerCapabilities(signer) {
|
||||
export function resolveSignerCapabilities(signer) {
|
||||
const fallback = {
|
||||
sign: false,
|
||||
nip44: false,
|
||||
|
||||
Reference in new issue
Block a user