Skip to content

Commit

Permalink
chore: implement base64 encoding in EIP712 (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonberg1997 authored Jul 21, 2023
1 parent 8c90df2 commit 4a567e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion x/auth/tx/eip712.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tx

import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"math/big"
Expand Down Expand Up @@ -475,7 +476,8 @@ func cleanTypesAndMsgValue(typedData apitypes.Types, primaryType string, msgValu
newValue := make(map[string]interface{})
bz, _ := json.Marshal(anyValue)
newValue["type"] = anyValue["@type"]
newValue["value"] = bz
base64Str := base64.StdEncoding.EncodeToString(bz) // base64 encode to keep consistency with js-sdk
newValue["value"] = []byte(base64Str)
msgValue[encName[:len(encName)-3]] = newValue
typedData[primaryType][i].Name = encName[:len(encName)-3]
typedData[primaryType][i].Type = "TypeAny"
Expand Down

0 comments on commit 4a567e8

Please sign in to comment.