Skip to content

Commit

Permalink
Improve error messaging and enhance documentation in eip712_cosmos.go
Browse files Browse the repository at this point in the history
This PR improves error handling and enhances documentation in the
eip712_cosmos.go file to provide clearer messages and more detailed
explanations.

Signed-off-by: Hwangjae Lee <[email protected]>
  • Loading branch information
meetrick committed Sep 10, 2024
1 parent b7a68cc commit 3b34957
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit 3b34957

Please sign in to comment.