feat: use dlc-macros for async dlc-manager#236
feat: use dlc-macros for async dlc-manager#236bennyhodl wants to merge 6 commits intop2pderivatives:masterfrom
Conversation
ad64fea to
b970675
Compare
|
It requires a dependency of |
6157870 to
d05a137
Compare
|
There are conflicts with the macro expansion and the unit tests, so i made a script to ignore testing async with all features. |
|
Sorry I need to take some time to review that but don't have it right now. But regarding testing, I don't think it's nice to have to run a script to be able to run unit tests. Also I think it'd be good to have the async feature tested in some way, AFAICT it's not the case? |
d05a137 to
fe9a6d2
Compare
|
I can write tests for the async. I'm running into an issue with cargo that it tries compiling the non-async implementations. I'm not sure how we should get around this. Any ideas? |
Do you have more details on this? Like what error do you get? |
|
I think running all features on the workspace it tries to compile the oracle clients with both async and sync even though those flags are provided in the |
6a38ba9 to
624bd86
Compare
|
Updated and tests are passing now. I made the integration tests under a module that is under I'm not sure about using the macro for async. I think the implementation is harder to reason about than the alternative PR. Still works though ¯_(ツ)_/¯ |
|
Although, on second thought this might be a better solution with adding potentially an async blockchain interface. |
|
Both approaches have pros and cons but I also prefer this one. I just need to find time to review your code, but if you find someone else that could review it as well it would be great. To merge this I think I also want to have at least some integration tests using |
c92307b to
404cf82
Compare
4bf936f to
2ba6b52
Compare
|
@Tibo-lg I have spent a few days trying to get the async tests running. I keep having play whack a mole with the testing dependencies. I have been using this branch quite a bit in dlcdevkit. CI is passing and there is no code change to core functionality. Can this get merged? |
|
Sorry but I don't want to merge something that is not tested, because then we don't know first if it's actually working, and more importantly we won't know if it get broken by future changes. I can try to help you get the tests working though, is there anything you have that is worth sharing or should I just start from scratch? Also note as mentioned in DM that while I'm ok to merge it for now, I don't think that's the direction I want the library to take in the future, and I think it will be better to push async issues out of the library boundaries to avoid having to deal with the complexity. |
|
This is a commit I had running async tests. 4bf936f & the corresponding action https://github.com/p2pderivatives/rust-dlc/actions/runs/11942863204 Locally tests were passing but the tests failed with dropping a tokio runtime for blocking operations. I believe I tracked it down to the Esplora client and the blocking operations with the Blockchain interface. |
|
I get the same error when running locally. I guess it might be necessary to make the blockchain interface async as well? |
Alternate to #235
bdk_macrosuses old versions of syn and is no longer maintained so it might be useful to create adlc_macroscrate.This PR gives an example of a different implementation to support async manager compared to copying functions.