0

我需要从 RIDE 脚本中知道区块链的当前高度,并在当前高度上或多或少地增加一周的高度。我试过这个:

let currentHeight = transactionHeightById(i.transactionId) 
let finishHeight = currentHeight + (7*1440)

这是正确/最好的方法吗?此外,当尝试获取 finishHeight 时,我收到此错误:

编译失败:在 952-974 中找不到函数重载 '+'(Int|Unit, Int)

4

1 回答 1

0

RIDE 中当前的 WAVES 区块链高度包含在变量height中。因此,要了解当前高度并为其添加大约一周的时间(高度):

[...]
else if (contestStartHeight <= height) then throw("Start Height must be greater than current Blockchain height: " + toString(height))
else {
    let contestFinishHeight = contestStartHeight + (7*1440)
}
[...]
于 2019-08-10T17:32:04.180 回答