getHeightFromTime calculates the height with this sql-chain config of a given time reading.
(t time.Time)
| 219 | |
| 220 | // getHeightFromTime calculates the height with this sql-chain config of a given time reading. |
| 221 | func (r *runtime) getHeightFromTime(t time.Time) int32 { |
| 222 | return int32(t.Sub(r.chainInitTime) / r.period) |
| 223 | } |
| 224 | |
| 225 | // nextTick returns the current clock reading and the duration till the next turn. If duration |
| 226 | // is less or equal to 0, use the clock reading to run the next cycle - this avoids some problem |
no outgoing calls
no test coverage detected