keyWithSymbolToHeight converts a height back from a key(ack/resp/req/block) in bytes. ack key: ['Q', 'A', 'C', 'K', height, hash] resp key: ['R', 'E', 'S', 'P', height, hash] req key: ['R', 'E', 'Q', 'U', height, hash] block key: ['B', 'L', 'C', 'K', height, hash].
(k []byte)
| 89 | // block key: |
| 90 | // ['B', 'L', 'C', 'K', height, hash]. |
| 91 | func keyWithSymbolToHeight(k []byte) int32 { |
| 92 | if len(k) < 8 { |
| 93 | return -1 |
| 94 | } |
| 95 | return int32(binary.BigEndian.Uint32(k[4:])) |
| 96 | } |
| 97 | |
| 98 | // Chain represents a sql-chain. |
| 99 | type Chain struct { |
no outgoing calls
no test coverage detected