-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
Feature Request
User Story
As a dev
I want to deterministically generate mock gift wraps
So that tests are deterministic
Acceptance Criteria
/// Helper to create mock gift wraps for testing
/// Since NDK's GiftWrap usecase requires async operations and cryptography,
/// these must be generated at runtime in seed.dart using the NDK instance
Future<List<Nip01Event>> createMockGiftWraps(
KeyPair pair, Nip01Event rumor, String recipientPubkey) async {
Ndk ndk = Ndk(NdkConfig(
eventVerifier: Bip340EventVerifier(),
cache: MemCacheManager(),
engine: NdkEngine.JIT,
defaultQueryTimeout: Duration(seconds: 10),
bootstrapRelays: []));
ndk.accounts
.loginPrivateKey(pubkey: pair.publicKey, privkey: pair.privateKey!);
return [
await ndk.giftWrap
.toGiftWrap(rumor: rumor, recipientPubkey: recipientPubkey, <b>createdAt: ...</b>),
await ndk.giftWrap.toGiftWrap(rumor: rumor, recipientPubkey: pair.publicKey, <b>createdAt: ...</b>)
];
}
Reactions are currently unavailable