MCPcopy Create free account
hub / github.com/ElementsProject/lightning / chain_events_eq

Function chain_events_eq

plugins/bkpr/test/run-recorder.c:304–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302}
303
304static bool chain_events_eq(struct chain_event *e1, struct chain_event *e2)
305{
306 CHECK(e1->db_id == e2->db_id);
307 CHECK(e1->acct_db_id == e2->acct_db_id);
308 CHECK((e1->origin_acct != NULL) == (e2->origin_acct != NULL));
309 if (e1->origin_acct)
310 CHECK(streq(e1->origin_acct, e2->origin_acct));
311 CHECK(streq(e1->tag, e2->tag));
312 CHECK(amount_msat_eq(e1->credit, e2->credit));
313 CHECK(amount_msat_eq(e1->debit, e2->debit));
314 CHECK(amount_msat_eq(e1->output_value, e2->output_value));
315 CHECK(streq(e1->currency, e2->currency));
316 CHECK(e1->timestamp == e2->timestamp);
317 CHECK(e1->blockheight == e2->blockheight);
318 CHECK(e1->stealable == e2->stealable);
319 CHECK(e1->ignored == e2->ignored);
320 CHECK(bitcoin_outpoint_eq(&e1->outpoint, &e2->outpoint));
321
322 CHECK((e1->spending_txid != NULL) == (e2->spending_txid != NULL));
323 if (e1->spending_txid)
324 CHECK(bitcoin_txid_eq(e1->spending_txid, e2->spending_txid));
325
326 CHECK((e1->payment_id != NULL) == (e2->payment_id != NULL));
327 if (e1->payment_id)
328 CHECK(sha256_eq(e1->payment_id, e2->payment_id));
329
330 CHECK((e1->desc != NULL) == (e2->desc != NULL));
331 if (e1->desc)
332 CHECK(streq(e1->desc, e2->desc));
333
334 return true;
335}
336
337static struct channel_event *make_channel_event(const tal_t *ctx,
338 char *tag,

Callers 1

test_chain_event_crudFunction · 0.85

Calls 1

amount_msat_eqFunction · 0.50

Tested by

no test coverage detected