onflow / flow-emulator

The Flow Emulator is a lightweight tool that emulates the behaviour of the real Flow network
https://onflow.org
Apache License 2.0
84 stars 49 forks source link

SDK adapter doesn't implement BlockPayload retrieval #703

Closed bartolomej closed 2 months ago

bartolomej commented 2 months ago

Problem

Functions for retrieving full block information (GetBlockById, GetBlockByHeight, GetLatestBlock) don't implement conversion from flowgo.Payload to sdk.BlockPayload, but instead just return an empty sdk.BlockPayload struct.

See example: https://github.com/onflow/flow-emulator/blame/799f57c037f3bd33acdd4e57a4d1b55ee58fc5d9/adapters/sdk.go#L179-L186

Steps to Reproduce

Use SDK adapter and try retrieving block payload (e.g. collection guarantees).

Acceptance Criteria

SDK adapter should support retrieval of block payloads.

Context

I'm playing around with building a revamped web-based playground. This was proposed in the grant: https://github.com/onflow/developer-grants/issues/260.