mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
core/types: fix json encoding for Request
This commit is contained in:
parent
ec69830b6f
commit
9680a5f61e
1 changed files with 6 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ package types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
@ -94,6 +95,11 @@ func (r *Request) encode(w *bytes.Buffer) error {
|
||||||
return r.inner.encode(w)
|
return r.inner.encode(w)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MarshalJSON marshals as JSON.
|
||||||
|
func (r *Request) MarshalJSON() ([]byte, error) {
|
||||||
|
return json.Marshal(r.inner)
|
||||||
|
}
|
||||||
|
|
||||||
// MarshalBinary returns the canonical encoding of the request.
|
// MarshalBinary returns the canonical encoding of the request.
|
||||||
func (r *Request) MarshalBinary() ([]byte, error) {
|
func (r *Request) MarshalBinary() ([]byte, error) {
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue