good morning!!!!

Skip to content
Commits on Source (1)
  • a's avatar
    fix client · fd87172c
    a authored
    fd87172c
......@@ -8,7 +8,7 @@ import (
)
func main() {
client, err := jrpc.Dial("ws://localhost:8545")
client, err := jrpc.Dial("https://mainnet.boba.network/")
if err != nil {
panic(err)
}
......
......@@ -163,10 +163,10 @@ func (m *Message) UnmarshalJSON(xs []byte) error {
return UnmarshalMessage(m, dec)
}
func (m *Message) MarshalJSON() ([]byte, error) {
func (m Message) MarshalJSON() ([]byte, error) {
buf := &bytes.Buffer{}
enc := jx.NewStreamingEncoder(buf, 4096)
err := MarshalMessage(m, enc)
err := MarshalMessage(&m, enc)
if err != nil {
return nil, err
}
......
......@@ -41,11 +41,11 @@ type Request struct {
}
func (r *Request) UnmarshalJSON(xs []byte) error {
return json.Unmarshal(xs, &r.Message)
return r.Message.UnmarshalJSON(xs)
}
func (r *Request) MarshalJSON() ([]byte, error) {
return json.Marshal(r.Message)
func (r Request) MarshalJSON() ([]byte, error) {
return r.Message.MarshalJSON()
}
func NewRequestFromMessage(ctx context.Context, message *Message) (r *Request) {
......