MCPcopy Index your code
hub / github.com/chain/Core / GetBlock

Method GetBlock

protocol/block.go:41–43  ·  view source on GitHub ↗

GetBlock returns the block at the given height, if there is one, otherwise it returns an error.

(ctx context.Context, height uint64)

Source from the content-addressed store, hash-verified

39// GetBlock returns the block at the given height, if there is one,
40// otherwise it returns an error.
41func (c *Chain) GetBlock(ctx context.Context, height uint64) (*legacy.Block, error) {
42 return c.store.GetBlock(ctx, height)
43}
44
45// GenerateBlock generates a valid, but unsigned, candidate block from
46// the current pending transaction pool. It returns the new block and

Callers 4

TestGetBlockFunction · 0.95
ValidateBlockForSigMethod · 0.95
TestGeneratorRecoveryFunction · 0.95

Calls 1

GetBlockMethod · 0.65

Tested by 3

TestGetBlockFunction · 0.76
TestGeneratorRecoveryFunction · 0.76