diff --git a/x/auth/tx/eip712.go b/x/auth/tx/eip712.go index df1fa66d96..54f9a94d14 100644 --- a/x/auth/tx/eip712.go +++ b/x/auth/tx/eip712.go @@ -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]