stratum: set_difficulty should always be a notification (#32)

This commit is contained in:
Georges 2024-02-23 18:51:27 +01:00 committed by GitHub
parent 9f723782ab
commit 8c62817f73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -202,7 +202,7 @@ describe('StratumV1Client', () => {
expect(socket.on).toHaveBeenCalled();
socketEmitter(Buffer.from(MockRecording1.MINING_SUGGEST_DIFFICULTY));
await new Promise((r) => setTimeout(r, 1));
expect(socket.write).toHaveBeenCalledWith(`{"id":4,"method":"mining.set_difficulty","params":[512]}\n`, expect.any(Function));
expect(socket.write).toHaveBeenCalledWith(`{"id":null,"method":"mining.set_difficulty","params":[512]}\n`, expect.any(Function));
});
it('should set difficulty', async () => {

View File

@ -31,7 +31,7 @@ export class SuggestDifficulty extends StratumBaseMessage {
public response(difficulty: number) {
return {
id: this.id,
id: null,
method: eResponseMethod.SET_DIFFICULTY,
params: [difficulty]
}