Skip to content
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

Algod: Better Box Reference Error Message #5325

Merged
merged 2 commits into from
Apr 21, 2023

Conversation

ahangsu
Copy link
Contributor

@ahangsu ahangsu commented Apr 21, 2023

Summary

See issue #5229, the box key representation is essentially a byte slice wrapped under string. This representation does not necessarily fall under ASCII symbol set, and printing with %v or %#v will be hard to decode and debug.

We decide to print with hex, i.e., %#x format.

Test Plan

@ahangsu ahangsu changed the title Enhancement: Better Box Reference Error Message Algod: Better Box Reference Error Message Apr 21, 2023
@@ -229,7 +229,7 @@ func (cs *roundCowState) NewBox(appIdx basics.AppIndex, key string, value []byte
return err
}
if exists {
return fmt.Errorf("attempt to recreate %s", key)
return fmt.Errorf("attempt to recreate %#x", key)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're in here, let's add the word "box" after "recreate" to match the wording elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, will do

@ahangsu ahangsu requested a review from jannotti April 21, 2023 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants