multi: add GetBlockHeader to BlockChainIO

This commit is contained in:
Jonathan Harvey-Buschel committed 2023-10-27 11:05:27 -04:00
1 parent 7a8803e3cf
commit 6edd1e1220
7 files changed
+61

No files matched your search

+18
View File
@@ -45,6 +45,24 @@ func (h *HarnessRPC) GetBlock(
return resp
}
// GetBlockHeader makes an RPC call to chain kit client's GetBlockHeader and
// asserts.
func (h *HarnessRPC) GetBlockHeader(
req *chainrpc.GetBlockHeaderRequest) *chainrpc.GetBlockHeaderResponse {
if req == nil {
req = &chainrpc.GetBlockHeaderRequest{}
}
ctxt, cancel := context.WithTimeout(h.runCtx, DefaultTimeout)
defer cancel()
resp, err := h.ChainKit.GetBlockHeader(ctxt, req)
h.NoError(err, "GetBlockHeader")
return resp
}
// GetBlockHash makes an RPC call to chain kit client's GetBlockHash and
// asserts.
func (h *HarnessRPC) GetBlockHash(