paritytech / subxt

Interact with Substrate based nodes in Rust or WebAssembly
Other
406 stars 242 forks source link

CI panic #280

Closed fewensa closed 3 years ago

fewensa commented 3 years ago

Hi:

Is there a plan to support to rust 2021. I encountered an error: https://github.com/darwinia-network/substrate-subxt/pull/1/checks?check_run_id=2638761026#step:7:679

warning: panic message is not a string literal
   --> src/frame/contracts.rs:257:13
    |
257 | /             format!(
258 | |                 "Error calling instantiate_with_code and receiving CodeStored Event: {:?}",
259 | |                 code_stored
260 | |             )
    | |_____________^
    |
    = note: `#[warn(non_fmt_panic)]` on by default
    = note: this is no longer accepted in Rust 2021
    = note: the assert!() macro supports formatting, so there's no need for the format!() macro here
help: remove the `format!(..)` macro call
    |
257 |             
258 |                 "Error calling instantiate_with_code and receiving CodeStored Event: {:?}",
259 |                 code_stored
260 |             
    |

https://github.com/darwinia-network/substrate-subxt/blob/dbb82e6c9442bfed8ba7bce3ad82bf3b9cba9cd3/src/frame/contracts.rs#L255-L261

        assert!(
            code_stored.is_ok(),
            format!(
                "Error calling instantiate_with_code and receiving CodeStored Event: {:?}",
                code_stored
            )
        );

run cargo test --workspace --verbose in ci, reminder me, change to

assert!(
  code_stored.is_ok(),
  "Error calling instantiate_with_code and receiving CodeStored Event: {:?}",
  code_stored
)

But this does not appear in paritytech/substrate-subxt

So, If you need to change, I can submit pr here. I would also like to know why this error does not appear here.

niklasad1 commented 3 years ago

It's just a warning currently so I don't understand why you call it panic in CI.

This warnings might not appear because an older version of rustc ran on the CI than in your fork.

However, if you want to fix these warnings we would certainly welcome PRs for it.

fewensa commented 3 years ago

Sorry, I checked and correct this build issues. you are right, my rust toolchain ia too low, the panic is another test. If want change to new assert! I can change it and create a new PR later

Sent from ProtonMail mobile

-------- Original Message -------- On May 24, 2021, 15:40, Niklas Adolfsson wrote:

It's just a warning currently so I don't understand why you call it panic in CI.

This warnings might not appear because an older version of rustc ran on the CI than in your fork.

However, if you want to fix these warnings we would certainly welcome PRs for it.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.