func (c *client) Block(ctx context.Context, ref torus.BlockRef) ([]byte, error) { resp, err := c.handler.Block(ctx, &models.BlockRequest{ BlockRef: ref.ToProto(), }) if err != nil { return nil, err } return resp.Data, nil }
func (c *client) PutBlock(ctx context.Context, ref torus.BlockRef, data []byte) error { _, err := c.handler.PutBlock(ctx, &models.PutBlockRequest{ Refs: []*models.BlockRef{ ref.ToProto(), }, Blocks: [][]byte{ data, }, }) return err }