| 33 | } |
| 34 | |
| 35 | void json_add_channel_event(struct json_stream *out, |
| 36 | struct channel_event *ev) |
| 37 | { |
| 38 | json_object_start(out, NULL); |
| 39 | json_add_string(out, "account", ev->acct_name); |
| 40 | json_add_string(out, "type", "channel"); |
| 41 | json_add_string(out, "tag", ev->tag); |
| 42 | json_add_amount_msat_only(out, "credit_msat", ev->credit); |
| 43 | json_add_amount_msat_only(out, "debit_msat", ev->debit); |
| 44 | if (!amount_msat_zero(ev->fees)) |
| 45 | json_add_amount_msat_only(out, "fees_msat", ev->fees); |
| 46 | json_add_string(out, "currency", ev->currency); |
| 47 | if (ev->payment_id) { |
| 48 | json_add_sha256(out, "payment_id", ev->payment_id); |
| 49 | json_add_u32(out, "part_id", ev->part_id); |
| 50 | } |
| 51 | json_add_u64(out, "timestamp", ev->timestamp); |
| 52 | if (ev->desc) |
| 53 | json_add_string(out, "description", ev->desc); |
| 54 | json_add_bool(out, "is_rebalance", ev->rebalance_id != NULL); |
| 55 | json_object_end(out); |
| 56 | } |
no test coverage detected