lnrpc add new RPC 'Quiesce' to protobuf definitions

This commit is contained in:
Keagan McClelland committed 2024-11-26 13:51:57 -07:00
1 parent 7a5b55a473
commit 99f5ca4018
8 files changed
+398 -21

No files matched your search

+25
View File
@@ -46,4 +46,29 @@ func RegisterDevJSONCallbacks(registry map[string]func(ctx context.Context,
}
callback(string(respBytes), nil)
}
registry["devrpc.Dev.Quiesce"] = func(ctx context.Context,
conn *grpc.ClientConn, reqJSON string, callback func(string, error)) {
req := &QuiescenceRequest{}
err := marshaler.Unmarshal([]byte(reqJSON), req)
if err != nil {
callback("", err)
return
}
client := NewDevClient(conn)
resp, err := client.Quiesce(ctx, req)
if err != nil {
callback("", err)
return
}
respBytes, err := marshaler.Marshal(resp)
if err != nil {
callback("", err)
return
}
callback(string(respBytes), nil)
}
}