Skip to content

Commit

Permalink
test: scanOutputsWithTweak
Browse files Browse the repository at this point in the history
  • Loading branch information
notTanveer committed Jan 25, 2025
1 parent 38931fd commit 674ce78
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions packages/core/test/scanning.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,35 @@ describe('Scanning', () => {
expect(tweak.toString('hex')).toBe(expectedTweakHex);
}
});

it('should return empty map if outputs do not match tweak', () => {
const scanPrivateKey = Buffer.from(
'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef',
'hex',
);
const spendPublicKey = Buffer.from(
'04abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef',
'hex',
);
const tweak = Buffer.from(
'04abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef',
'hex',
);
const outputs = [
Buffer.from(
'04abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef',
'hex',
),
];

const res = scanOutputsWithTweak(
scanPrivateKey,
spendPublicKey,
tweak,
outputs,
);

expect(res).toBeDefined();
expect(res.size).toBe(0);
});
});

0 comments on commit 674ce78

Please sign in to comment.