lotus/itests/contracts/Blocktest.sol
snissn 510f980348
tests: itests: blocktest properties (#10304)
* add itests for various fevm block properties and assert correct chain id

* add value checks to the block property solidity itests

* move get block function to kit
2023-02-17 14:32:54 -08:00

25 lines
573 B
Solidity

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.17;
contract BlockTest {
function testChainID() public view{
require(block.chainid == 314);
}
function getBlockhashPrevious() public view returns (bytes32) {
return blockhash(block.number-1);
}
function getBasefee() public view returns (uint256){
return block.basefee;
}
function getBlockNumber() public view returns (uint256){
return block.number;
}
function getTimestamp() public view returns (uint256){
return block.timestamp;
}
}