Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Owning views of blockchain data #3982

Merged
merged 8 commits into from
Dec 28, 2016
Merged

Owning views of blockchain data #3982

merged 8 commits into from
Dec 28, 2016

Conversation

rphmeier
Copy link
Contributor

Closes #2079

Rather than just returning error-prone raw Bytes from BlockChainClient and BlockProvider, now immediately return an owning view of the bytes which can be used to

a) decode fully
b) decode on-demand
c) borrow sub-views
and d) yield raw bytes when necessary

@rphmeier rphmeier added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Dec 28, 2016
Copy link
Collaborator

@tomusdrw tomusdrw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks awesome!

@@ -128,7 +128,7 @@ fn query_none_block() {
fn query_bad_block() {
let client_result = get_test_client_with_blocks(vec![get_bad_state_dummy_block()]);
let client = client_result.reference();
let bad_block:Option<Bytes> = client.block_header(BlockId::Number(1));
let bad_block: Option<_> = client.block_header(BlockId::Number(1));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it need any type hint?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think it does, specifically. But it can't really hurt to have one :)

@rphmeier rphmeier added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Dec 28, 2016
@gavofyork gavofyork merged commit fe1f542 into master Dec 28, 2016
@gavofyork gavofyork deleted the raw_types branch December 28, 2016 12:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants