lightningdevkit / ldk-c-bindings

Main LDK C Bindings on which other bindings are built
Other
13 stars 14 forks source link

Improve Argument Naming #99

Closed arik-so closed 1 year ago

arik-so commented 1 year ago

There was an issue raised in ldk-swift pertaining to parameter names: https://github.com/lightningdevkit/ldk-swift/issues/91

For the sake of automatically being able to take argument names from the C bindings, I think it would be nice to be able to improve naming right here at the source. Specifically, here's the offending C method signature:

/**
 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
 */
struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
TheBlueMatt commented 1 year ago

Those are taken from upstream - its ReadableArgs::read(arg) but the arg is a tuple and broken out into its parts, so its arg_*. We could convert it to some other name upstream, but I'm not sure what we can do better here.

arik-so commented 1 year ago

Too bad. I was worried it came from a tuple :(