optimize share submission path

This commit is contained in:
Ben
2026-05-06 19:45:32 -04:00
parent 216fa74d99
commit 93f09ae889
8 changed files with 248 additions and 99 deletions
+27
View File
@@ -83,6 +83,33 @@ describe('MiningJob', () => {
expect(updatedBlock.version).toBe(jobTemplate.block.version);
});
it('should build the same header as the full block update path', () => {
const versionMask = parseInt('00002000', 16);
const nonce = parseInt('ed460d91', 16);
const extraNonce1 = '57a6f098';
const extraNonce2 = 'c708000000000000';
const timestamp = parseInt(MockRecording1.TIME, 16);
const updatedBlock = job.copyAndUpdateBlock(
jobTemplate,
versionMask,
nonce,
extraNonce1,
extraNonce2,
timestamp
);
const fastHeader = job.buildHeaderBuffer(
jobTemplate,
versionMask,
nonce,
extraNonce1,
extraNonce2,
timestamp
);
expect(fastHeader.equals(updatedBlock.toBuffer(true))).toBe(true);
});
it('should expose coinbase helpers for downstream validation', () => {
const notify = JSON.parse(job.response(jobTemplate));