Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka committed Dec 13, 2024
1 parent a92a21b commit c2c6952
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ethcoder/typed_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ func (t *TypedData) encodeData(primaryType string, data map[string]interface{})
// encodeValue handles the recursive encoding of values according to their types
func (t *TypedData) encodeValue(typ string, value interface{}) ([]byte, error) {
// Handle arrays
if strings.HasSuffix(typ, "[]") {
baseType := typ[:len(typ)-2]
if strings.Index(typ, "[") > 0 {
baseType := typ[:strings.Index(typ, "[")]
values, ok := value.([]interface{})
if !ok {
return nil, fmt.Errorf("expected array for type %s", typ)
Expand Down

0 comments on commit c2c6952

Please sign in to comment.