code style, let to const

This commit is contained in:
stjet
2024-06-30 19:36:19 +00:00
parent d9fa4dee0d
commit 9086c544aa
76 changed files with 413 additions and 380 deletions

16
work.ts
View File

@@ -2,10 +2,9 @@ import type { BlockHash } from "./rpc_types";
import type { RPC } from "./rpc";
export interface WorkProvider {
request_work(block_hash: BlockHash): Promise<string>,
request_work(block_hash: BlockHash): Promise<string>;
}
export class RPCWorkProvider {
readonly rpc: RPC;
@@ -17,13 +16,14 @@ export class RPCWorkProvider {
}
async request_work(block_hash: BlockHash): Promise<string> {
return (await this.rpc.call({
action: "work_generate",
hash: block_hash,
...this.extra_payload,
})).work;
return (
await this.rpc.call({
action: "work_generate",
hash: block_hash,
...this.extra_payload,
})
).work;
}
}
//