mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-09-01 17:55:15 +00:00
Make id an interface in CreateMessageWithId to match the struct better.
This commit is contained in:
parent
2e77f0bb0e
commit
7a7fa56407
1 changed files with 2 additions and 2 deletions
|
@ -162,7 +162,7 @@ type Error struct {
|
||||||
// jsonWithArgs takes a command, an id, and an interface which contains an
|
// jsonWithArgs takes a command, an id, and an interface which contains an
|
||||||
// array of the arguments for that command. It knows NOTHING about the commands
|
// array of the arguments for that command. It knows NOTHING about the commands
|
||||||
// so all error checking of the arguments must happen before it is called.
|
// so all error checking of the arguments must happen before it is called.
|
||||||
func jsonWithArgs(command string, id string, args interface{}) ([]byte, error) {
|
func jsonWithArgs(command string, id interface{}, args interface{}) ([]byte, error) {
|
||||||
rawMessage := Message{"1.0", id, command, args}
|
rawMessage := Message{"1.0", id, command, args}
|
||||||
finalMessage, err := json.Marshal(rawMessage)
|
finalMessage, err := json.Marshal(rawMessage)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -188,7 +188,7 @@ func CreateMessage(message string, args ...interface{}) ([]byte, error) {
|
||||||
// It is capable of handeling all of the commands from the standard client,
|
// It is capable of handeling all of the commands from the standard client,
|
||||||
// described at:
|
// described at:
|
||||||
// https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list
|
// https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list
|
||||||
func CreateMessageWithId(message string, id string, args ...interface{}) ([]byte, error) {
|
func CreateMessageWithId(message string, id interface{}, args ...interface{}) ([]byte, error) {
|
||||||
var finalMessage []byte
|
var finalMessage []byte
|
||||||
var err error
|
var err error
|
||||||
// Different commands have different required and optional arguments.
|
// Different commands have different required and optional arguments.
|
||||||
|
|
Loading…
Add table
Reference in a new issue