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

Improve error messaging and enhance documentation in eip712_cosmos.go #240

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions eip712_cosmos.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func traverseFields(

err = cdc.UnpackAny(any, &anyWrapper.Value)
if err != nil {
err = errors.Wrap(err, "failed to unpack Any in msg struct")
err = errors.Wrapf(err, "failed to unpack Any in msg struct at field %s", fieldName)
return err
}

Expand Down Expand Up @@ -354,8 +354,9 @@ func jsonNameFromTag(tag reflect.StructTag) string {
}

// _.foo_bar.baz -> TypeFooBarBaz
// this is needed for Geth's own signing code which doesn't
// tolerate complex type names
// sanitizeTypedef ensures that complex type names are simplified and
// conform to the format expected by Geth's signing code, which requires
// PascalCase for compatibility with EIP-712.
func sanitizeTypedef(str string) string {
buf := new(bytes.Buffer)
parts := strings.Split(str, ".")
Expand Down
Loading