mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-29 08:52:25 +00:00
Merge pull request #1986 from PR0M3TH3AN/fix-nip07-decryption-13328665886531040373
fix(nostr): correctly resolve signer capabilities when methods are present
This commit is contained in:
3 files changed
+10
-14
No files matched your search
+8
-11
@@ -307,19 +307,16 @@ function resolveSignerCapabilities(signer) {
|
||||
|
||||
return {
|
||||
sign:
|
||||
typeof capabilities.sign === "boolean"
|
||||
? capabilities.sign
|
||||
: typeof signer.signEvent === "function",
|
||||
(typeof capabilities.sign === "boolean" && capabilities.sign) ||
|
||||
typeof signer.signEvent === "function",
|
||||
nip44:
|
||||
typeof capabilities.nip44 === "boolean"
|
||||
? capabilities.nip44
|
||||
: typeof signer.nip44Encrypt === "function" ||
|
||||
typeof signer.nip44Decrypt === "function",
|
||||
(typeof capabilities.nip44 === "boolean" && capabilities.nip44) ||
|
||||
typeof signer.nip44Encrypt === "function" ||
|
||||
typeof signer.nip44Decrypt === "function",
|
||||
nip04:
|
||||
typeof capabilities.nip04 === "boolean"
|
||||
? capabilities.nip04
|
||||
: typeof signer.nip04Encrypt === "function" ||
|
||||
typeof signer.nip04Decrypt === "function",
|
||||
(typeof capabilities.nip04 === "boolean" && capabilities.nip04) ||
|
||||
typeof signer.nip04Encrypt === "function" ||
|
||||
typeof signer.nip04Decrypt === "function",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -55,9 +55,6 @@ test("batchFetchProfiles handles fast and failing relays", async () => {
|
||||
const originalWriteRelays = Array.isArray(nostrClient.writeRelays)
|
||||
? [...nostrClient.writeRelays]
|
||||
: nostrClient.writeRelays;
|
||||
const originalReadRelays = Array.isArray(nostrClient.readRelays)
|
||||
? [...nostrClient.readRelays]
|
||||
: nostrClient.readRelays;
|
||||
const originalPool = nostrClient.pool;
|
||||
|
||||
const poolListCalls = [];
|
||||
|
||||
@@ -57,8 +57,10 @@ test("RelayHealthService: ensureRelayState creates default state", () => {
|
||||
connected: false,
|
||||
lastLatencyMs: null,
|
||||
errorCount: 0,
|
||||
consecutiveFailures: 0,
|
||||
lastCheckedAt: null,
|
||||
lastErrorAt: null,
|
||||
lastUserLogAt: null,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user