Skip to content

Commit

Permalink
fix: GetMsgTypes function
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonberg1997 committed May 16, 2023
1 parent b2b10c2 commit 2f2e60a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions x/auth/tx/eip712.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,17 +454,22 @@ func cleanTypesAndMsgValue(typedData apitypes.Types, primaryType string, msgValu
newValue["value"] = bz
newAnySet[i] = newValue
}
msgValue[encName] = newAnySet
msgValue[encName[:len(encName)-3]] = newAnySet
typedData[primaryType][i].Name = encName[:len(encName)-3]
typedData[primaryType][i].Type = "TypeAny[]"
delete(typedData, encType[:len(encType)-2])
} else {
anyValue := msgValue[encName[:len(encName)-3]].(map[string]interface{})
newValue := make(map[string]interface{})
bz, _ := json.Marshal(anyValue)
newValue["type"] = anyValue["@type"]
newValue["value"] = bz
msgValue[encName] = newValue
msgValue[encName[:len(encName)-3]] = newValue
typedData[primaryType][i].Name = encName[:len(encName)-3]
typedData[primaryType][i].Type = "TypeAny"
delete(typedData, encType)
}
typedData[encType] = anyApiTypes
delete(msgValue, encName[:len(encName)-3])
typedData["TypeAny"] = anyApiTypes
continue
}
encValue := msgValue[encName]
Expand Down

0 comments on commit 2f2e60a

Please sign in to comment.