mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
stratum: set_difficulty should always be a notification (#32)
This commit is contained in:
@@ -202,7 +202,7 @@ describe('StratumV1Client', () => {
|
|||||||
expect(socket.on).toHaveBeenCalled();
|
expect(socket.on).toHaveBeenCalled();
|
||||||
socketEmitter(Buffer.from(MockRecording1.MINING_SUGGEST_DIFFICULTY));
|
socketEmitter(Buffer.from(MockRecording1.MINING_SUGGEST_DIFFICULTY));
|
||||||
await new Promise((r) => setTimeout(r, 1));
|
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 () => {
|
it('should set difficulty', async () => {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export class SuggestDifficulty extends StratumBaseMessage {
|
|||||||
|
|
||||||
public response(difficulty: number) {
|
public response(difficulty: number) {
|
||||||
return {
|
return {
|
||||||
id: this.id,
|
id: null,
|
||||||
method: eResponseMethod.SET_DIFFICULTY,
|
method: eResponseMethod.SET_DIFFICULTY,
|
||||||
params: [difficulty]
|
params: [difficulty]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user