From a731f59bd39abd2a75a2b5c0e92aa016845f5ef7 Mon Sep 17 00:00:00 2001 From: Coffepots Date: Fri, 6 Apr 2018 16:22:32 +0100 Subject: [PATCH] Moved EthTime to constants, update more timestamps to EthTime --- src/chain.nim | 2 +- src/constants.nim | 3 ++- src/utils/header.nim | 1 - src/vm_state.nim | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chain.nim b/src/chain.nim index 1056aad6b..7826ce781 100644 --- a/src/chain.nim +++ b/src/chain.nim @@ -31,7 +31,7 @@ type nonce*: string mixHash*: string extraData*: string - timestamp*: int + timestamp*: EthTime stateRoot*: string FundedAddress* = ref object diff --git a/src/constants.nim b/src/constants.nim index 73c2892b2..73a81f723 100644 --- a/src/constants.nim +++ b/src/constants.nim @@ -1,11 +1,12 @@ import - ttmath, math, strutils, tables, utils/padding, rlp + ttmath, math, strutils, tables, utils/padding, rlp, times # rlpFields UInt256, table type TypeHint* {.pure.} = enum UInt256, Bytes, Any + EthTime* = Time #Bytes* = seq[byte] diff --git a/src/utils/header.nim b/src/utils/header.nim index bd9f56425..7e68f01ad 100644 --- a/src/utils/header.nim +++ b/src/utils/header.nim @@ -1,7 +1,6 @@ import ../constants, ttmath, strformat, times, ../validation type - EthTime = Time Header* = ref object timestamp*: EthTime difficulty*: UInt256 diff --git a/src/vm_state.nim b/src/vm_state.nim index 0a6d4f137..8c7521279 100644 --- a/src/vm_state.nim +++ b/src/vm_state.nim @@ -44,7 +44,7 @@ method blockhash*(vmState: BaseVMState): string = method coinbase*(vmState: BaseVMState): string = vmState.blockHeader.coinbase -method timestamp*(vmState: BaseVMState): int = +method timestamp*(vmState: BaseVMState): EthTime = vmState.blockHeader.timestamp method blockNumber*(vmState: BaseVMState): UInt256 =