feat: add ContractAddress type#159
Conversation
bea90b3 to
02d6946
Compare
gabrielbosio
left a comment
There was a problem hiding this comment.
Some small comments
|
@gabrielbosio do you have an opinion about the points I highlighted in the issue description? |
It depends if we want to migrate the |
|
@dorimedini-starkware you are maintaining the sequencer repo? |
no reason I can think of, but this suggested implementation differs from ours in several ways, like:
|
|
all in all I have no issue with this addition; it may take time for us to migrate to this new type though |
|
@dorimedini-starkware so do you want this crate to also add a |
I guess it would make the transition less painful, so sure. |
|
@dorimedini-starkware going back to point using derive_more::Display, or manual impl end up being the same. So no worries here Now regarding |
the point was to get a |
67dd9f2 to
0f3e898
Compare
794750f to
0ec371c
Compare
6143570 to
1a3ea40
Compare
317fb75 to
4070b1c
Compare
4070b1c to
f849d1f
Compare
f849d1f to
a25e4f9
Compare
gabrielbosio
left a comment
There was a problem hiding this comment.
Looks good overall, I've left some small suggestions
gabrielbosio
left a comment
There was a problem hiding this comment.
Looks good, left some minor comments
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>
8458f66 to
df656af
Compare
df656af to
ae0376d
Compare
Add a
ContractAddresswrapper type that guarantee the felt it contains is a valid starknet contract address.Contain some quality of like function for string conversion
Not a breaking change
Discussion:
@xJonathanLEI suggested we add ClassHash too
I chose to exclude addresses 0x0 and 0x1 from the normal ContractAddress flow. You can still build them with the unchecked one. Should we add constant ContractAddress::ZERO and ContractAddress::ONE to make those special case more explicit?
Do we want to allow them at all? Is there a risk to make some API unusable downstream if those value are entierly excluded?