【问题标题】:How Can i Know the current blockchain height from RIDE?我如何从 RIDE 知道当前的区块链高度?
【发布时间】:2019-12-18 00:27:59
【问题描述】:

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

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

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

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

【问题讨论】:

    标签: wavesplatform ride


    【解决方案1】:

    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)
    }
    [...]
    

    【讨论】:

      猜你喜欢
      • 2023-02-13
      • 2010-10-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多