From 78ff7942388d1cbeab89f924c8b70c974c224333 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 30 Sep 2024 09:48:03 +0200 Subject: [PATCH] add missing endpoint --- libs/remix-simulator/README.md | 2 +- libs/remix-simulator/src/methods/miner.ts | 18 ++++++++++++++++++ libs/remix-simulator/src/provider.ts | 2 ++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 libs/remix-simulator/src/methods/miner.ts diff --git a/libs/remix-simulator/README.md b/libs/remix-simulator/README.md index a7921c7c9e..4c3717fefc 100644 --- a/libs/remix-simulator/README.md +++ b/libs/remix-simulator/README.md @@ -39,7 +39,7 @@ * [X] eth_getCode * [~] eth_sign * [X] eth_sendTransaction -* [_] eth_sendRawTransaction +* [x] eth_sendRawTransaction * [X] eth_call * [~] eth_estimateGas * [X] eth_getBlockByHash diff --git a/libs/remix-simulator/src/methods/miner.ts b/libs/remix-simulator/src/methods/miner.ts new file mode 100644 index 0000000000..55f8767111 --- /dev/null +++ b/libs/remix-simulator/src/methods/miner.ts @@ -0,0 +1,18 @@ +export class Miner { + vmContext + + constructor (vmContext) { + this.vmContext = vmContext + } + + methods () { + return { + miner_start: this.miner_start.bind(this), + miner_stop: this.miner_stop.bind(this) + } + } + + miner_start (payload, cb) {} + + miner_stop (payload, cb) {} +} diff --git a/libs/remix-simulator/src/provider.ts b/libs/remix-simulator/src/provider.ts index b6c52345fe..af9233263a 100644 --- a/libs/remix-simulator/src/provider.ts +++ b/libs/remix-simulator/src/provider.ts @@ -8,6 +8,7 @@ import { Filters } from './methods/filters' import { methods as miscMethods } from './methods/misc' import { methods as netMethods } from './methods/net' import { Transactions } from './methods/transactions' +import { Miner } from './methods/miner' import { Debug } from './methods/debug' import { VMContext } from './vm-context' import { Web3PluginBase } from 'web3' @@ -65,6 +66,7 @@ export class Provider { this.methods = merge(this.methods, netMethods()) this.methods = merge(this.methods, this.Transactions.methods()) this.methods = merge(this.methods, (new Debug(this.vmContext)).methods()) + this.methods = merge(this.methods, (new Miner(this.vmContext)).methods()) } async init () {