Skip to content

Commit 07dce81

Browse files
committed
Fix tx_bytes field
1 parent 7cc5064 commit 07dce81

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

cmd/handler/tx.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,17 @@ func TxsHandler(cli client.ABCIClient) http.HandlerFunc {
7272

7373
func ProtoTxsHandler(cli client.ABCIClient) http.HandlerFunc {
7474
return func(w http.ResponseWriter, r *http.Request) {
75-
var params map[string]string
75+
var params struct {
76+
TxBytes string `json:"tx_bytes"`
77+
Mode string `json:"mode"`
78+
}
7679
err := json.NewDecoder(r.Body).Decode(&params)
7780
if err != nil {
7881
writeError(w, fmt.Errorf("%s, %s", "unmarshaling json params", err.Error()))
7982
return
8083
}
8184

82-
txData, ok := params["tx"]
83-
if !ok {
84-
writeError(w, fmt.Errorf("%s, %s", "Missing tx param", err.Error()))
85-
return
86-
}
87-
88-
txBz, err := base64.StdEncoding.DecodeString(txData)
85+
txBz, err := base64.StdEncoding.DecodeString(params.TxBytes)
8986
if err != nil {
9087
writeError(w, fmt.Errorf("%s, %s", "cannot decode tx", err.Error()))
9188
return

0 commit comments

Comments
 (0)