Closed b-yap closed 4 months ago
Hey @b-yap, looks like a lot of work went into this. Thanks!
I see that a couple of changes are also pure formatting changes. How is that? Did the formatter settings change or did we not properly use a formatter before?
@TorstenStueber I did not touch the fmt toml file. I think these are all new preferences from the new version?
Like removing ;
of a return statement, or removing {
}
for single statements.
Because I ran cargo +nightly-2024-02-09 fmt --all
after the CI failed.
Hmm, is this expected that the default formatting changes between different versions of rust (and therefore rust fmt)? Or did we not properly format before the change?
@TorstenStueber I confirmed it by running
cargo +nightly-2023-04-15 fmt --all
on a clean main
branch, and there were no changes. We did it properly.
^ In this screenshot, the differences occurred after cargo +nightly-2024-02-09 fmt --all
; the formatting changes are coming from the new version.
Interesting and unexpected. Looking again, there seem to be only a few changes that are only due to formatting. One of them is this and it is clear that this it enacts the trailing_semicolon = false
rule. However, trailing_semicolon
was already defined to be false
before your change (see on main
). So it looks like the formatter did not properly format all files before your change. Maybe a bug in that version of rust. But all good now!
It looks very good 👍!
I am surprised why the mockable
macro works different between versions and now it doesn't allow access to the trait anymore. In any case I think the wrapper trait workaround is not that "ugly" and solves the problem.
The only thing remaining to me is to make it work with the --features runtime-benchmarks
flag.
@ebma
In all the READMEs we now mention +nightly-
.
Testing using the latest version of nightly is fine; as long as it's installed. The danger is testing using an older version. I changed to +nightly
in the READMEs.
Can we define both stable and nightly in the rust-toolchain.toml or similar so that both versions are fixed?
I checked the profile and there's nothing there.
It's not even possible per package; I doubt it can differentiate between build
and test
.
I tried cargo aliases but the override is not a "subcommand", so:
error: no such command: `+nightly`
Cargo does not handle `+toolchain` directives.
Did you mean to invoke `cargo` through `rustup` instead?
@ebma @gianfra-t I had to rebase.
@zoveress as part of this PR, the CI workflows we do for Spacewalk changed. Do you think you are able to adjust the Gitlab testing pipeline based on the contents of this file? Otherwise please reach out and we are happy to help. The current testing pipeline will not work anymore on Gitlab because we switched to a different Rust toolchain and also had to run the CI a bit differently.
closes #506
mocktopus
is a lib for rust nightly alone. Best to constraint its import intest
only, until we plan to fully refactor the code and remove it entirely.build-check
~cmd-all
to build (with stable) the project without thecurrency
'stesting-utils
.redeem
is mocking functions from palletcurrency
. I had to put a wrapper to be able to mock it properly.~How to begin the review:
testing-utils
ofcurrency
pallet2023-12-29
~2024-02-09
2023-12-29
had issues :exclamation: :error[E0658]: use of unstable library feature 'stdsimd'
2024-02-09
nightly
is required for testing.fmt
only works fornightly
cmd-all
script instead+nightly
or a nightly version of your choicenot used
warnings. (need your help on this @gianfra-t)stellar-relay-lib
,testing-utils
feature ofwallet
to access the functions for retrieving the secret keyswallet
(cargo test
)stellar-relay-lib
, it failed withfile not found
.mocktopus
only incfg test
.~mocktopus
only incfg test
~mockable
feature ofcurrency
'sAmount
is inaccessible.~AmountExt
:small_red_triangledown: where we can mock the ff methods ofAmount
_:~fn lock_on()
~fn burn_from()
~fn unlock_on()
~fn transfer()
~Amount
~Amount
methods, with methods of traitAmountExt
:~fn _lock_on()
~fn _burn_from()
~fn _unlock_on()
~fn _transfer()
~Amount
methods, with methods of traitAmountExt
~jsonrpsee
will need theclient
feature