-
Notifications
You must be signed in to change notification settings - Fork 150
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
Pad addresses to correct length #2486
base: master
Are you sure you want to change the base?
Conversation
@@ -24,6 +26,30 @@ where | |||
serializer.serialize_str(&format!("{value:#}")) | |||
} | |||
|
|||
#[derive(Clone, Copy, Debug, PartialEq, Deserialize, CairoSerialize)] | |||
pub struct Address(pub Felt); |
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.
I'm not a big fan of using the Address
name since it is also used for class_hash
. Generally without additional context, it could be confusing to understand why it was introduced. Apart from this, I think we should also print transaction_hash
with padded 0
for consistency.
CHANGELOG.md
Outdated
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
#### Fixed | |||
|
|||
- `sncast declare` no longer fails for flat contracts (i.e. CASM artifacts with `bytecode_segment_lengths` being a number) | |||
- Addresses outputted when calling `sncast account create`, `sncast deploy` and `sncast declare` are now padded to the correct length and prefixed with `0x0` |
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.
The term correct length
implies that it has been incorrect so far, which I think is not true (but we would need to define what this means first). How about rephrasing it to note that it's now padded with 0 and always 64 characters long?
# Conflicts: # crates/sncast/src/helpers/block_explorer.rs
Closes #2248
Closes #2424
Introduced changes
sncast account create
,sncast declare
andsncast deploy
are now correctly padded to 66 (64 after0x
) characters length.Checklist
CHANGELOG.md