Commit graph

16 commits

Author SHA1 Message Date
Matt Corallo
fc416d6295 Update C++ bindings demo with new struct naming 2021-02-20 10:06:22 -05:00
Matt Corallo
68811da302 Update C bindings demos for new KeysManager API 2021-02-19 14:02:46 -05:00
Matt Corallo
0dcc937bf1 Update demo C++ bindings example for new bindings 2021-02-18 12:28:25 -05:00
Matt Corallo
06342a30b1 Adapt C++ bindings demo to new API and keys (new funding tx) 2021-02-12 18:59:01 -05:00
Matt Corallo
ac70f278cb [C++ bindings] Update demo app due to removed TupleTempl generics 2021-02-10 22:25:10 -05:00
Matt Corallo
3efd641ca4 Update C++ bindings demo to use ChannelManager de/serialization
This demonstrates (and tests) the newly-exposed `ChannelManager`
de/serialization functions. Best revewied with -b --color-moved.
2021-02-03 10:11:35 -05:00
Matt Corallo
78bc724091 [C++ bindings demo] Add now-missing std::moves 2021-02-03 10:11:35 -05:00
Matt Corallo
93e562f5bf [bindings] Update C++ demo for new NetGraphMsgHandler::new() params 2021-02-02 17:04:31 -05:00
Matt Corallo
66f46d4ad3 Update bindings demo for new ChannelMonitor-update API 2020-11-23 11:12:37 -05:00
Matt Corallo
d169966f76 [bindings] Update eq/clone trait fns to take object, not this_arg
When a trait is required to implement eq/clone (eg in the case of
`SocketDescriptor`), the generated trait struct contains an
eq/clone function which takes a `this_arg` pointer. Since the trait
object can always be read to get the `this_arg` pointer, there is
no loss of generality to pass the trait object itself, and it
provides a bit more flexibility when the trait could be one of
several implementations (which we use in the Java higher-level
bindings).
2020-11-23 11:08:34 -05:00
Matt Corallo
336cb0828a Update bindings demo for new Transaction::data mut-ness 2020-11-23 11:08:34 -05:00
Matt Corallo
90b668e426 Update bindings demo for changes from #681 and the Persister trait 2020-11-23 11:08:34 -05:00
Matt Corallo
7e18104414 Update demo.cpp for new tuple code 2020-10-21 14:54:51 -04:00
Matt Corallo
a5e7671d1e Update bindings demo apps for new code upstream 2020-10-21 14:50:22 -04:00
Matt Corallo
d9a38d1846 [bindings] Give Transaction objects a buffer-is-owned flag.
A lot of our container mapping depends on the `is_owned` flag
which we have for in-crate mapped objects to map references and
non-references into the same container type. Transaction was
mapped to two completely different types (a slice and a Vec type),
which led to a number of edge cases in the bindings generation.
Specifically, I spent a few days trying to map
`[(A, &Transaction)]` properly and came up empty - we map slices
into the same types as Vecs (and rely on the `is_owned` flag to
avoid double-free) and the lack of one for `Transaction` would have
required a special-case in numerous functions.

Instead, we just add a flag in `Transaction` to mirror what we do
for in-crate types and check it before free-ing any underlying
memory.

Note that, sadly, because the c_types objects aren't mapped as a
part of our C++ bindings generation, you have to manually call
`Transaction_free()` even in C++.
2020-10-21 14:50:22 -04:00
Matt Corallo
1af8a464b4 Add all the manually-generated bits for the c-bindings crate
Including:
 * A script to automatically generate all the rest,
 * Cargo.toml and cbindgen.toml,
 * manually-written wrapper types for a few types
2020-09-10 22:03:32 -04:00