Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

H256 and some of the other types truncate the string output like 0x13...141 which imo is horrible/frustrating #2713

Closed
ethereumdegen opened this issue Jan 18, 2024 · 5 comments

Comments

@ethereumdegen
Copy link

ethereumdegen commented Jan 18, 2024

Is your feature request related to a problem? Please describe.
H256 and some of the other types truncate the string output like 0x13...141 which imo is horrible. Its so godforsaken painful to work with these types especially with databasing on the backend. The only reason why truncating would be nice i guess is frontend but ... no

Describe the solution you'd like
I would like to_string() to output the full normal string like 0x123123211 and perhaps add a to_string_shortened() to output what it outputs now

Describe alternatives you've considered

Additional context

@prestwich
Copy link
Collaborator

Those types are from a dependency. please file this issue with the Parity team (repo linked below). In the meantime, the workaround is to use debug formatting instead of display

https://github.com/paritytech/parity-common/

@prestwich prestwich closed this as not planned Won't fix, can't repro, duplicate, stale Jan 18, 2024
@gakonst
Copy link
Owner

gakonst commented Jan 18, 2024

Yep @ethereumdegen you can use format!("{:?}", foo) instead.

@ethereumdegen
Copy link
Author

although this is not obvious or pragmatic is it a rly good solution. alright i guess ill do that. I dont think i will be the last to find this odd however . thanks

@gakonst
Copy link
Owner

gakonst commented Jan 18, 2024

Yep it's been odd for a while to us as well. We've fixed it in docs.rs/alloy-primitives, which is going to be the recommended crate once we're done with the transition.

@DaniPopes
Copy link
Collaborator

See also paritytech/parity-common#656

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants