Skip to content

Commit

Permalink
chore: added parsedBlock field in blockData
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitika committed Oct 24, 2024
1 parent 7e82da8 commit 4cdf7e9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 46 deletions.
13 changes: 1 addition & 12 deletions packages/core/test/encoding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,6 @@ describe('Encoding', () => {
const parsedBlock = parseSilentBlock(
Buffer.from(blockData.encodedBlockHex, 'hex'),
);
expect(parsedBlock).toStrictEqual({
type: blockData.type,
transactions: blockData.transactions.map((tx) => ({
txid: tx.id,
scanTweak: tx.scanTweak,
outputs: tx.outputs.map((output) => ({
pubKey: output.pubKey,
value: output.value,
vout: output.vout,
})),
})),
});
expect(parsedBlock).toStrictEqual(blockData.parsedBlock);
});
});
68 changes: 34 additions & 34 deletions packages/core/test/fixtures/encoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,40 +75,40 @@ export const labelled = [

export const silentBlock = [
{
type: 0,
transactions: [
{
id: 'd60cdcc1bdb78d44bf83e2ae0efa94bbb1187ba2397e4a40960d853b78e15b4f',
scanTweak:
'0381a4ef11a26108cf10d8c33305b77aec009beed82a77bb47b716a04ae9ae5bf1',
outputs: [
{
pubKey: 'ca80a975d09b84b385e39d779293121b9a7c80942d824d2496f098e3f077ced3',
value: 24771038,
vout: 1,
},
],
isSpent: false,
},
{
id: 'cf655a07ed9b672ecf811ce8b3b69257eecaf0518edd025d7014d7c0177050cb',
scanTweak:
'03d87550a4ba8ed7dd37df7739a021d6d212e70e8a8e6e9e70249c13a11fd9f412',
outputs: [
{
pubKey: '5af9436eb515871413a913f24290ba003eab7a64b9c62cb72051599a383de8ff',
value: 26940,
vout: 0,
},
{
pubKey: 'e7a3ab33572f47b074878c749a5f9a5d7e026f10b6ffcab1388e9356c07828fa',
value: 4400,
vout: 1,
},
],
isSpent: false,
},
],
parsedBlock: {
type: 0,
transactions: [
{
txid: 'd60cdcc1bdb78d44bf83e2ae0efa94bbb1187ba2397e4a40960d853b78e15b4f',
scanTweak:
'0381a4ef11a26108cf10d8c33305b77aec009beed82a77bb47b716a04ae9ae5bf1',
outputs: [
{
pubKey: 'ca80a975d09b84b385e39d779293121b9a7c80942d824d2496f098e3f077ced3',
value: 24771038,
vout: 1,
},
],
},
{
txid: 'cf655a07ed9b672ecf811ce8b3b69257eecaf0518edd025d7014d7c0177050cb',
scanTweak:
'03d87550a4ba8ed7dd37df7739a021d6d212e70e8a8e6e9e70249c13a11fd9f412',
outputs: [
{
pubKey: '5af9436eb515871413a913f24290ba003eab7a64b9c62cb72051599a383de8ff',
value: 26940,
vout: 0,
},
{
pubKey: 'e7a3ab33572f47b074878c749a5f9a5d7e026f10b6ffcab1388e9356c07828fa',
value: 4400,
vout: 1,
},
],
},
],
},
encodedBlockHex:
'0002d60cdcc1bdb78d44bf83e2ae0efa94bbb1187ba2397e4a40960d853b78e15b4f01000000000179f9deca80a975d09b84b385e39d779293121b9a7c80942d824d2496f098e3f077ced3000000010381a4ef11a26108cf10d8c33305b77aec009beed82a77bb47b716a04ae9ae5bf1cf655a07ed9b672ecf811ce8b3b69257eecaf0518edd025d7014d7c0177050cb02000000000000693c5af9436eb515871413a913f24290ba003eab7a64b9c62cb72051599a383de8ff000000000000000000001130e7a3ab33572f47b074878c749a5f9a5d7e026f10b6ffcab1388e9356c07828fa0000000103d87550a4ba8ed7dd37df7739a021d6d212e70e8a8e6e9e70249c13a11fd9f412',
},
Expand Down

0 comments on commit 4cdf7e9

Please sign in to comment.