bitmask-core icon indicating copy to clipboard operation
bitmask-core copied to clipboard

Compilation error when use synchronize_wallet

Open crisdut opened this issue 1 year ago • 6 comments

I comment the psbt and sign_psbt endpoints in bitmaskd because the compilation fails. See error below:

Compiling bitmask-core v0.6.0-beta.5 (/home/****/projects/contrib/bitmask-core)
error[E0277]: the trait bound `fn(TypedHeader<Authorization<Bearer>>, Json<PsbtRequest>) -> impl std::future::Future<Output = std::result::Result<impl IntoResponse, AppError>> {psbt}: Handler<_, _, _>` is not satisfied
   --> src/bin/bitmaskd.rs:274:30
    |
274 |         .route("/psbt", post(psbt))
    |                         ---- ^^^^ the trait `Handler<_, _, _>` is not implemented for fn item `fn(TypedHeader<Authorization<Bearer>>, Json<PsbtRequest>) -> impl std::future::Future<Output = std::result::Result<impl IntoResponse, AppError>> {psbt}`
    |                         |
    |                         required by a bound introduced by this call
    |
    = help: the following other types implement trait `Handler<T, S, B>`:
              <Layered<L, H, T, S, B, B2> as Handler<T, S, B2>>
              <MethodRouter<S, B> as Handler<(), S, B>>
note: required by a bound in `post`
   --> /home/*****/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-0.6.18/src/routing/method_routing.rs:407:1
    |
407 | top_level_handler_fn!(post, POST);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `post`
    = note: this error originates in the macro `top_level_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `fn(TypedHeader<Authorization<Bearer>>, Json<SignPsbtRequest>) -> impl std::future::Future<Output = std::result::Result<impl IntoResponse, AppError>> {sign_psbt}: Handler<_, _, _>` is not satisfied
   --> src/bin/bitmaskd.rs:275:30
    |
275 |         .route("/sign", post(sign_psbt))
    |                         ---- ^^^^^^^^^ the trait `Handler<_, _, _>` is not implemented for fn item `fn(TypedHeader<Authorization<Bearer>>, Json<SignPsbtRequest>) -> impl std::future::Future<Output = std::result::Result<impl IntoResponse, AppError>> {sign_psbt}`
    |                         |
    |                         required by a bound introduced by this call
    |
    = help: the following other types implement trait `Handler<T, S, B>`:
              <Layered<L, H, T, S, B, B2> as Handler<T, S, B2>>
              <MethodRouter<S, B> as Handler<(), S, B>>
note: required by a bound in `post`
   --> /home/*****/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-0.6.18/src/routing/method_routing.rs:407:1
    |
407 | top_level_handler_fn!(post, POST);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `post`
    = note: this error originates in the macro `top_level_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)

After investigate, I noticed this occurs because I using the method synchronize_wallet. Do you have any idea why this happens?

crisdut avatar May 13 '23 18:05 crisdut

What is the error output if you add this to the route handler? #[axum_macros::debug_handler]

Also, what command are you running to build, and on which branch?

cryptoquick avatar May 14 '23 00:05 cryptoquick

What is the error output if you add this to the route handler? #[axum_macros::debug_handler]

Also, what command are you running to build, and on which branch?

I made that, but does not work!

crisdut avatar May 22 '23 18:05 crisdut

Is this still an issue?

cryptoquick avatar Jul 11 '23 01:07 cryptoquick

Is this still an issue?

Yes.

crisdut avatar Jul 11 '23 04:07 crisdut

This is going to be critical for the marketplace

josediegorobles avatar Aug 07 '23 20:08 josediegorobles

I've dug into this a little and I'm not certain we can fix this without going to BDK 1.0. I'm going to mark this as blocked by BDK 1.0.

cryptoquick avatar Sep 12 '23 18:09 cryptoquick