refactor(core): move address logic to crate #1802
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Breaks out address related logic in
astria_core::primitive::v1
toastria-core-address
Background
One needs to import the entire kitchensink that is
astria-core
even if one only wants to use a fraction of its types. That leads to extremely long compilation times because all of its dependencies need to be compiled.This patch is the start to breaking out parts of
astria-core
into their own free standing crates, whichastria-core
then reexports.Changes
astria_core::primitive::v1
intoastria-core-address
Serialize
andDeserialize
impls on the domain typeAddress
(breaking because one needs to explicitly construct protobuf/wire typeAddress
; not breaking on the wire, json format stays the same)Protobuf
("domain type") trait forAddress
, removing its inherent constructors and methods to move from/to raw protobuf types ("wire types"); decouplesastria-core-address
fromastria-core
(specifically, the generated protobuf types) (breaking for consumers because they now need to import theProtobuf
trait)astria-core-consts
that only contains the constADDRESS_LENGTH
to allow decoupling of address and crypto logic (addressed in a separate patch)AddressBuilder::with_iter
from the public interface (only used inside the crate and not outside) (breaking for consumers of that method)Testing
Tests were shuffled around but not removed. Snapshot tests stay in place in astria core for now (because they are required for wire/protobuf types).
Changelogs
Changelogs updated.
Breaking Changelist
astria-core
because some inherent methods were removed from its public API.Related Issues
Part of #1798