matter-labs / era-test-node

In-memory node that can be used for integration testing and debugging.
https://matter-labs.github.io/era-test-node
Apache License 2.0
313 stars 76 forks source link

feat: implement `anvil_` time-related API endpoints #420

Closed itegulov closed 3 days ago

itegulov commented 3 days ago

We need to implement three time-related API endpoints:

#[rpc(name = "anvil_setTime")]
fn set_time(&self, timestamp: Numeric) -> RpcResult<i128>;

#[rpc(name = "anvil_increaseTime")]
fn increase_time(&self, seconds: Numeric) -> RpcResult<u64>;

#[rpc(name = "anvil_setNextBlockTimestamp")]
fn set_next_block_timestamp(&self, timestamp: Numeric) -> RpcResult<()>;

The implementations should be almost identical to the matching evm_ ones.