Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 6fe134b

Browse files
author
Jan Xie
committed
constantize block/skip time in casper contract
1 parent 3e7bebd commit 6fe134b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ethereum/casper_contract.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
data epochLength
2828
event DunkleAdded(hash:bytes32)
2929

30+
BLOCK_TIME = 3
31+
SKIP_TIME = 6
32+
3033
# 1 part-per-billion per block = ~1.05% annual interest assuming 3s blocks
3134
# 1 ppb per second = 3.20% annual interest
3235
BLOCK_MAKING_PPB = 10
@@ -145,7 +148,7 @@ def const getValidator(skips):
145148

146149

147150
def const getMinTimestamp(skips):
148-
return(self.genesisTimestamp + block.number * 3 + (self.totalSkips + skips) * 6)
151+
return(self.genesisTimestamp + block.number * BLOCK_TIME + (self.totalSkips + skips) * SKIP_TIME)
149152

150153

151154
def const getRandao(i, j):

0 commit comments

Comments
 (0)