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

Method FetchBlockByCount

worker/helper_test.go:156–167  ·  view source on GitHub ↗
(req *types.FetchBlockByCountReq, resp *types.FetchBlockResp)

Source from the content-addressed store, hash-verified

154}
155
156func (s *stubBPService) FetchBlockByCount(req *types.FetchBlockByCountReq, resp *types.FetchBlockResp) (err error) {
157 count := atomic.LoadUint32(&s.count)
158 if req.Count > count {
159 return ErrNotExists
160 }
161 if bi, ok := s.blockMap[req.Count%2]; ok {
162 resp.Count = bi.c
163 resp.Height = bi.h
164 resp.Block = bi.block
165 }
166 return
167}
168
169func (s *stubBPService) Init() {
170 s.blockMap = make(map[uint32]*blockInfo)

Callers 1

observerFetchBlockMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected