MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / keyWithSymbolToHeight

Function keyWithSymbolToHeight

sqlchain/chain.go:91–96  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

89// block key:
90// ['B', 'L', 'C', 'K', height, hash].
91func 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.
99type Chain struct {

Callers 1

NewChainWithContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected