diff --git a/staker/filetests/z_staker_internal_external_02_position_range_change_filetest.gnoXX_ExternalReward_0 b/staker/filetests/z_staker_internal_external_02_position_range_change_filetest.gno similarity index 97% rename from staker/filetests/z_staker_internal_external_02_position_range_change_filetest.gnoXX_ExternalReward_0 rename to staker/filetests/z_staker_internal_external_02_position_range_change_filetest.gno index 0fe67901e..bbd01d9cf 100644 --- a/staker/filetests/z_staker_internal_external_02_position_range_change_filetest.gnoXX_ExternalReward_0 +++ b/staker/filetests/z_staker_internal_external_02_position_range_change_filetest.gno @@ -11,7 +11,6 @@ package staker_test import ( "std" "strconv" - "time" "gno.land/p/demo/grc/grc721" @@ -178,18 +177,14 @@ func testCreateExternalIncentiveBar() { 1234569600, 1234569600+TIMESTAMP_90DAYS, ) + // startHeight 978 + // endHeight 3888978 + // nowHeight 127 // make it start - externalStartTime := int64(1234569600) - nowTime := time.Now().Unix() - timeLeft := externalStartTime - nowTime - - blockAvgTime := consts.BLOCK_GENERATION_INTERVAL - blockLeft := timeLeft / blockAvgTime - + blockLeft := 978 - 127 std.TestSkipHeights(int64(blockLeft)) // skip until external bar starts std.TestSkipHeights(10) // skip bit more to see reward calculation - } func testStakeToken01And02() { diff --git a/staker/type.gno b/staker/type.gno index 5b8e0b70a..74d701b0f 100644 --- a/staker/type.gno +++ b/staker/type.gno @@ -112,7 +112,9 @@ func NewExternalIncentive( blocksLeftUntilEndHeight := (endTimestamp - currentTime) * 1000 / msPerBlock startHeight := std.GetHeight() + blocksLeftUntilStartHeight + println("startHeight", startHeight) endHeight := std.GetHeight() + blocksLeftUntilEndHeight + println("endHeight", endHeight) return &ExternalIncentive{ incentiveId: incentiveId,