-
Notifications
You must be signed in to change notification settings - Fork 11
Support public key literals and tidy up handling of Raw vs PodId #319
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -200,15 +200,15 @@ impl Ord for Hash { | |||
| impl fmt::Display for Hash { | ||||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||||
| if f.alternate() { | ||||
| write!(f, "0x{}", self.encode_hex::<String>()) | ||||
| } else { | ||||
| // display first hex digit in big endian | ||||
| write!(f, "0x")?; | ||||
| let v3 = self.0[3].to_canonical_u64(); | ||||
| for i in 0..4 { | ||||
| write!(f, "{:02x}", (v3 >> ((7 - i) * 8)) & 0xff)?; | ||||
| } | ||||
| write!(f, "…") | ||||
| } else { | ||||
| write!(f, "0x{}", self.encode_hex::<String>()) | ||||
|
||||
| Equal(?points_pod["{key_signer}"], {game_pk:#}) |
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.
In the MockMainPod we use alternate for Display to print the padding None statements and arguments.
So in MockMainPod alternate leads to more verbosity.
With this change the PublicKey becomes less verbose with alternate.
Maybe we should swap the usage of alternate in the MainMockPod to be consistent? So that alternate always means less verbose by showing less data.
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've reverted this change.
I think the long-term solution here might be a "to_podlang_string" function, so that we don't have to overload Display with lots of variants for different use-cases. In the meantime I'll stick to the existing convention of using # for more verbosity.
Uh oh!
There was an error while loading. Please reload this page.