Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a BlockId type for safe conversion to Message #719

Merged
merged 6 commits into from
Oct 25, 2022

Conversation

Dentosal
Copy link
Member

It's hard to find the right boundary for the newtype. It cannot be created like types in the fuel-types crate, since the construction shouldn't be public. This is the minimal amount of changes to introduce the type, and it's converted to Bytes32 for interoperating with database and GraphQL functions. It might make sense to switch the database to use the BlockId type as well.

Requested in #718

@Dentosal Dentosal added enhancement New feature or request fuel-core-interfaces tech-debt The issue is to improve the current code and make it more clear/generic/reusable/pretty/avoidable. labels Oct 25, 2022
@Dentosal Dentosal requested a review from Voxelot October 25, 2022 17:20
@Dentosal Dentosal self-assigned this Oct 25, 2022
@Dentosal Dentosal requested a review from Voxelot October 25, 2022 19:34
@Voxelot Voxelot merged commit 75c8f9f into block-signing Oct 25, 2022
@Voxelot Voxelot deleted the block-signing-block-id-type branch October 25, 2022 19:49
Voxelot added a commit that referenced this pull request Oct 26, 2022
* add block signing and db models for sealed blocks

* add integ tests for checking sealed blocks

* mock setting the block height after production

* Create a BlockId type for safe conversion to Message (#719)

* Create a BlockId type for safe conversion to Message

* fmt

* Clippy

* Remove direct dep to fuel-crypto, as it's re-exported by fuel-vm

* Allow Into impl for clippy

* Fix lint name

* replace [u8;32] with secret key & secret key wrapper

* clippy

* use derive_more for newtype traits

* remove unneeded duplicate insert check

* add as_message to block id & block_producer getter to consensus data

* use real consensus data in the Interpreter::coinbase method

* add error context

* wean off of deref()

Co-authored-by: Hannes Karppila <hannes.karppila@gmail.com>
MujkicA pushed a commit that referenced this pull request Oct 26, 2022
* add block signing and db models for sealed blocks

* add integ tests for checking sealed blocks

* mock setting the block height after production

* Create a BlockId type for safe conversion to Message (#719)

* Create a BlockId type for safe conversion to Message

* fmt

* Clippy

* Remove direct dep to fuel-crypto, as it's re-exported by fuel-vm

* Allow Into impl for clippy

* Fix lint name

* replace [u8;32] with secret key & secret key wrapper

* clippy

* use derive_more for newtype traits

* remove unneeded duplicate insert check

* add as_message to block id & block_producer getter to consensus data

* use real consensus data in the Interpreter::coinbase method

* add error context

* wean off of deref()

Co-authored-by: Hannes Karppila <hannes.karppila@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fuel-core-interfaces tech-debt The issue is to improve the current code and make it more clear/generic/reusable/pretty/avoidable.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants