()
| 143 | } |
| 144 | |
| 145 | func (rpcData *JSONRPCRequest) ToRPC2JSONBytes() ([]byte, error) { |
| 146 | id := rpcData.ID |
| 147 | if id == nil { |
| 148 | id = 0 |
| 149 | } |
| 150 | rpc2Data := JSONRPC2Request{id, "2.0", rpcData.Method, rpcData.Params} |
| 151 | return json.Marshal(rpc2Data) |
| 152 | } |
| 153 | |
| 154 | func (rpcData *JSONRPCRequest) ToRPC2JSONBytesLine() (bytes []byte, err error) { |
| 155 | bytes, err = rpcData.ToRPC2JSONBytes() |