Skip to content

runtime-sdk: block.timestamp is return the timestamp of previous block. #2333

@roynguyen

Description

@roynguyen

Hi oasis team.
When I develop smart contract on emerald paratime, I emit block.timestamp to check with current block timestamp: https://explorer.oasis.io/testnet/emerald/tx/0x1ea9094d3c1e0b2e1565b9835bc78ea8059e9e59038304de2ec975abb7448b58. I saw that it was return the timestamp of previous block 13263665 is 0x68ca390c and current block is 13263666. I checked with your implement of block_timestamp when start EVM:
fn block_timestamp(&self) -> U256 {
self.backend.ctx.runtime_header().timestamp.into()
}
when we start EVM, we pass block_timestamp by timestamp of current runtime_header? and this is the reason?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions