-
Notifications
You must be signed in to change notification settings - Fork 63
feat: add ContractAddress type #159
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
base: main
Are you sure you want to change the base?
Conversation
bea90b3 to
02d6946
Compare
gabrielbosio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, I've left some small suggestions
gabrielbosio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, left some minor comments
Co-authored-by: Gabriel Bosio <[email protected]>
Co-authored-by: Gabriel Bosio <[email protected]>
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?